From 8292be92d8958fc09dceb7c6bf252ac1c170ed1a Mon Sep 17 00:00:00 2001 From: siikamiika Date: Thu, 16 Jan 2020 23:22:38 +0200 Subject: use TextScanner in QueryParser --- ext/fg/js/frontend.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ext/fg/js') diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 034d9075..9621ed2b 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -90,9 +90,8 @@ class Frontend extends TextScanner { } async updateOptions() { - this.options = await apiOptionsGet(this.getOptionsContext()); + this.setOptions(await apiOptionsGet(this.getOptionsContext())); await this.popup.setOptions(this.options); - this.setEnabled(this.options.general.enable); } async onSearchSource(textSource, cause) { -- cgit v1.2.3 From dbbcfa5739d10a6e45eb6e8b964e6a576431ff20 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 27 Dec 2019 17:42:36 -0500 Subject: Only use Display.setContent --- ext/bg/js/search.js | 4 ++-- ext/fg/js/float.js | 2 +- ext/mixed/js/display.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/fg/js') diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index ba66d5a9..673f066b 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -220,12 +220,12 @@ class DisplaySearch extends Display { this.updateSearchButton(); if (valid) { const {definitions} = await apiTermsFind(query, details, this.optionsContext); - this.setContentTerms(definitions, { + this.setContent('terms', {definitions, context: { focus: false, disableHistory: true, sentence: {text: query, offset: 0}, url: window.location.href - }); + }}); } else { this.container.textContent = ''; } diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js index 513d246b..c550579d 100644 --- a/ext/fg/js/float.js +++ b/ext/fg/js/float.js @@ -35,7 +35,7 @@ class DisplayFloat extends Display { onError(error) { if (this._orphaned) { - this.setContentOrphaned(); + this.setContent('orphaned'); } else { logError(error, true); } diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index f5b2225d..cc5bc95f 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -77,7 +77,7 @@ class Display { }; const definitions = await apiKanjiFind(link.textContent, this.getOptionsContext()); - this.setContentKanji(definitions, context); + this.setContent('kanji', {definitions, context}); } catch (error) { this.onError(error); } @@ -131,7 +131,7 @@ class Display { }); } - this.setContentTerms(definitions, context); + this.setContent('terms', {definitions, context}); if (selectText) { textSource.select(); -- cgit v1.2.3 From 62da7ec5cc3efa7011260bebe7366fabcb610ab4 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 16 Jan 2020 18:56:20 -0500 Subject: Update expression-scan-toggle to term-expression-text --- ext/bg/js/search-frontend.js | 2 +- ext/fg/js/popup-nested.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/fg/js') diff --git a/ext/bg/js/search-frontend.js b/ext/bg/js/search-frontend.js index 2fe50a13..bd2ddb50 100644 --- a/ext/bg/js/search-frontend.js +++ b/ext/bg/js/search-frontend.js @@ -27,7 +27,7 @@ async function searchFrontendSetup() { const ignoreNodes = ['.scan-disable', '.scan-disable *']; if (!options.scanning.enableOnPopupExpressions) { - ignoreNodes.push('.expression-scan-toggle', '.expression-scan-toggle *'); + ignoreNodes.push('.term-expression-text', '.term-expression-text *'); } window.frontendInitializationData = {depth: 1, ignoreNodes, proxy: false}; diff --git a/ext/fg/js/popup-nested.js b/ext/fg/js/popup-nested.js index bacf3b93..e0e52cb7 100644 --- a/ext/fg/js/popup-nested.js +++ b/ext/fg/js/popup-nested.js @@ -35,7 +35,7 @@ async function popupNestedInitialize(id, depth, parentFrameId, url) { const ignoreNodes = ['.scan-disable', '.scan-disable *']; if (!options.scanning.enableOnPopupExpressions) { - ignoreNodes.push('.expression-scan-toggle', '.expression-scan-toggle *'); + ignoreNodes.push('.term-expression-text', '.term-expression-text *'); } window.frontendInitializationData = {id, depth, parentFrameId, ignoreNodes, url, proxy: true}; -- cgit v1.2.3 From f969b5b8a9fa3b77bfc3bbb13830913c620c48da Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 16 Jan 2020 19:35:19 -0500 Subject: Update popup scan ignore selectors --- ext/bg/js/search-frontend.js | 2 +- ext/fg/js/popup-nested.js | 2 +- ext/mixed/display-templates.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/fg/js') diff --git a/ext/bg/js/search-frontend.js b/ext/bg/js/search-frontend.js index bd2ddb50..e453ccef 100644 --- a/ext/bg/js/search-frontend.js +++ b/ext/bg/js/search-frontend.js @@ -27,7 +27,7 @@ async function searchFrontendSetup() { const ignoreNodes = ['.scan-disable', '.scan-disable *']; if (!options.scanning.enableOnPopupExpressions) { - ignoreNodes.push('.term-expression-text', '.term-expression-text *'); + ignoreNodes.push('.source-text', '.source-text *'); } window.frontendInitializationData = {depth: 1, ignoreNodes, proxy: false}; diff --git a/ext/fg/js/popup-nested.js b/ext/fg/js/popup-nested.js index e0e52cb7..3f3c945e 100644 --- a/ext/fg/js/popup-nested.js +++ b/ext/fg/js/popup-nested.js @@ -35,7 +35,7 @@ async function popupNestedInitialize(id, depth, parentFrameId, url) { const ignoreNodes = ['.scan-disable', '.scan-disable *']; if (!options.scanning.enableOnPopupExpressions) { - ignoreNodes.push('.term-expression-text', '.term-expression-text *'); + ignoreNodes.push('.source-text', '.source-text *'); } window.frontendInitializationData = {id, depth, parentFrameId, ignoreNodes, url, proxy: true}; diff --git a/ext/mixed/display-templates.html b/ext/mixed/display-templates.html index 01cfeffc..62f3c69c 100644 --- a/ext/mixed/display-templates.html +++ b/ext/mixed/display-templates.html @@ -20,7 +20,7 @@
    
     
    -