From 62b95a656f5e55395893982822b0388a425f5a29 Mon Sep 17 00:00:00 2001 From: odehjoseph Date: Thu, 26 Sep 2019 21:33:33 -0700 Subject: Add option to enable Alt+B lookup --- ext/bg/js/options.js | 1 + ext/bg/js/settings.js | 2 ++ ext/bg/settings.html | 4 ++++ ext/mixed/js/display.js | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index e9e321df..2c9de1ec 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -281,6 +281,7 @@ function profileOptionsCreateDefaults() { modifier: 'shift', deepDomScan: false, popupNestingMaxDepth: 0, + enablePopupSearch: false, enableOnPopupExpressions: false, enableOnSearchPage: true }, diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js index cb3ddd4e..a0fe7c70 100644 --- a/ext/bg/js/settings.js +++ b/ext/bg/js/settings.js @@ -50,6 +50,7 @@ async function formRead(options) { options.scanning.alphanumeric = $('#search-alphanumeric').prop('checked'); options.scanning.autoHideResults = $('#auto-hide-results').prop('checked'); options.scanning.deepDomScan = $('#deep-dom-scan').prop('checked'); + options.scanning.enablePopupSearch = $('#enable-search-within-first-popup').prop('checked'); options.scanning.enableOnPopupExpressions = $('#enable-scanning-of-popup-expressions').prop('checked'); options.scanning.enableOnSearchPage = $('#enable-scanning-on-search-page').prop('checked'); options.scanning.delay = parseInt($('#scan-delay').val(), 10); @@ -115,6 +116,7 @@ async function formWrite(options) { $('#search-alphanumeric').prop('checked', options.scanning.alphanumeric); $('#auto-hide-results').prop('checked', options.scanning.autoHideResults); $('#deep-dom-scan').prop('checked', options.scanning.deepDomScan); + $('#enable-search-within-first-popup').prop('checked', options.scanning.enablePopupSearch); $('#enable-scanning-of-popup-expressions').prop('checked', options.scanning.enableOnPopupExpressions); $('#enable-scanning-on-search-page').prop('checked', options.scanning.enableOnSearchPage); $('#scan-delay').val(options.scanning.delay); diff --git a/ext/bg/settings.html b/ext/bg/settings.html index d38aa090..6fdd54c4 100644 --- a/ext/bg/settings.html +++ b/ext/bg/settings.html @@ -413,6 +413,10 @@ This feature can be enabled if the Maximum number of additional popups option is set to a value greater than 0.

+
+ +
+
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index ca1738a6..3a728ee8 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -323,7 +323,9 @@ class Display { $('.action-play-audio').click(this.onAudioPlay.bind(this)); $('.kanji-link').click(this.onKanjiLookup.bind(this)); $('.source-term').click(this.onSourceTermView.bind(this)); - $('.glossary-item').click(this.onTermLookup.bind(this)); + if (this.options.scanning.enablePopupSearch) { + $('.glossary-item').click(this.onTermLookup.bind(this)); + } await this.adderButtonUpdate(['term-kanji', 'term-kana'], sequence); } catch (e) { -- cgit v1.2.3