From 9f190fb1d2e1eccd82ee612a26041f3ba4bdcac8 Mon Sep 17 00:00:00 2001 From: shinigami-eyes <43276258+shinigami-eyes@users.noreply.github.com> Date: Sun, 28 Jul 2019 07:31:24 +0200 Subject: [PATCH] Format code --- extension/content.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extension/content.ts b/extension/content.ts index 6bd69ad..1bca3f7 100644 --- a/extension/content.ts +++ b/extension/content.ts @@ -129,11 +129,11 @@ var lastRightClickedElement: HTMLElement = null; var lastAppliedYouTubeUrl: string = null; var lastAppliedYouTubeTitle: string = null; -function updateTwitterClasses(){ +function updateTwitterClasses() { for (const a of document.querySelectorAll('a')) { if (a.assignedCssLabel && !a.classList.contains('has-assigned-label')) { a.classList.add('assigned-label-' + a.assignedCssLabel); - a.classList.add('has-assigned-label'); + a.classList.add('has-assigned-label'); } } } @@ -367,14 +367,14 @@ function getIdentifierFromElementImpl(element: HTMLAnchorElement): string { p = p.parentElement; } } - } else if(hostname == 'twitter.com') { + } else if (hostname == 'twitter.com') { if (dataset && dataset.expandedUrl) return getIdentifier(dataset.expandedUrl); if (element.href.startsWith('https://t.co/')) { const title = element.title; if (title && (title.startsWith('http://') || title.startsWith('https://'))) return getIdentifier(title); const content = element.textContent; - if(!content.includes(' ') && content.includes('.')) + if (!content.includes(' ') && content.includes('.')) return getIdentifier('http://' + content); } } @@ -469,10 +469,10 @@ function getIdentifierFromURLImpl(url: URL): string { const m = captureRegex(host, /([a-zA-Z0-9\-]*)\.blogspot/); if (m) return m + '.blogspot.com'; else return null; - } else if(host.includes('google.')){ - if(url.pathname == '/search' && searchParams.get('stick') && !searchParams.get('tbm') && !searchParams.get('start')){ + } else if (host.includes('google.')) { + if (url.pathname == '/search' && searchParams.get('stick') && !searchParams.get('tbm') && !searchParams.get('start')) { const q = searchParams.get('q'); - if(q) return 'wikipedia.org/wiki/' + q.replace(/\s/g, '_'); + if (q) return 'wikipedia.org/wiki/' + q.replace(/\s/g, '_'); } return null; } else {