diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-01-09 23:10:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-09 23:10:55 -0500 |
commit | 083da93142ec6302021ee1c29428121b54fc9e68 (patch) | |
tree | c07c7e3ae808682e127603303f4698056204abd7 /ext/mixed/js/display.js | |
parent | da1e1e5c5b4dc20cc6aa46b51c55a496d094ed5c (diff) |
Refactor sentence parsing (#1215)
* Rename sentenceExtent with sentenceScanExtent
* Update TextScanner.setOptions
* Change function argument order
* Rename quote map variables
* Fix edge case quote handling
* Update terminator maps to support character inclusion
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r-- | ext/mixed/js/display.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 60842a3d..4c8d2f91 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -309,7 +309,7 @@ class Display extends EventDispatcher { async updateOptions() { const options = await api.optionsGet(this.getOptionsContext()); - const scanning = options.scanning; + const {scanning: scanningOptions, sentenceParsing: sentenceParsingOptions} = options; this._options = options; this._updateDocumentOptions(options); @@ -320,16 +320,16 @@ class Display extends EventDispatcher { selectedParser: options.parsing.selectedParser, termSpacing: options.parsing.termSpacing, scanning: { - inputs: scanning.inputs, - deepContentScan: scanning.deepDomScan, - selectText: scanning.selectText, - delay: scanning.delay, - touchInputEnabled: scanning.touchInputEnabled, - pointerEventsEnabled: scanning.pointerEventsEnabled, - scanLength: scanning.length, - sentenceExtent: options.sentenceParsing.scanExtent, - layoutAwareScan: scanning.layoutAwareScan, - preventMiddleMouse: scanning.preventMiddleMouse.onSearchQuery + inputs: scanningOptions.inputs, + deepContentScan: scanningOptions.deepDomScan, + selectText: scanningOptions.selectText, + delay: scanningOptions.delay, + touchInputEnabled: scanningOptions.touchInputEnabled, + pointerEventsEnabled: scanningOptions.pointerEventsEnabled, + scanLength: scanningOptions.length, + sentenceScanExtent: sentenceParsingOptions.scanExtent, + layoutAwareScan: scanningOptions.layoutAwareScan, + preventMiddleMouse: scanningOptions.preventMiddleMouse.onSearchQuery } }); @@ -1810,7 +1810,7 @@ class Display extends EventDispatcher { this._definitionTextScanner.on('searched', this._onDefinitionTextScannerSearched.bind(this)); } - const scanningOptions = options.scanning; + const {scanning: scanningOptions, sentenceParsing: sentenceParsingOptions} = options; this._definitionTextScanner.setOptions({ inputs: [{ include: 'mouse0', @@ -1832,7 +1832,7 @@ class Display extends EventDispatcher { touchInputEnabled: false, pointerEventsEnabled: false, scanLength: scanningOptions.length, - sentenceExtent: options.sentenceParsing.scanExtent, + sentenceScanExtent: sentenceParsingOptions.scanExtent, layoutAwareScan: scanningOptions.layoutAwareScan, preventMiddleMouse: false }); |