From 0d00f7e1cf8a0fa1e2b1aa2732bceaae39f4e23c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 9 Sep 2020 16:59:03 -0400 Subject: Scanning input generalization (#789) * Add inputs to options.scanning * Update CSS for mouse buttons * Update list counters * Set up HTML/CSS * Add input controller * Use new inputs * Include mouse buttons * Update how button inputs are detected * Add index/empty fields to the input details object * Update none check for scanning modifier * Remove old settings * Remove unused global --- ext/fg/js/frontend.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ext/fg/js') diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 3ddf0d25..8189b8ad 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -254,12 +254,12 @@ class Frontend { await this.updateOptions(); } - _onSearched({type, definitions, sentence, input: {cause}, textSource, optionsContext, error}) { + _onSearched({type, definitions, sentence, input: {cause, empty}, textSource, optionsContext, error}) { const scanningOptions = this._options.scanning; if (error !== null) { if (yomichan.isExtensionUnloaded) { - if (textSource !== null && scanningOptions.modifier !== 'none') { + if (textSource !== null && !empty) { this._showExtensionUnloaded(textSource); } } else { @@ -321,10 +321,9 @@ class Frontend { await this._updatePopup(); this._textScanner.setOptions({ + inputs: scanningOptions.inputs, deepContentScan: scanningOptions.deepDomScan, selectText: scanningOptions.selectText, - modifier: scanningOptions.modifier, - useMiddleMouse: scanningOptions.middleMouse, delay: scanningOptions.delay, touchInputEnabled: scanningOptions.touchInputEnabled, scanLength: scanningOptions.length, -- cgit v1.2.3