aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-01-25 02:57:57 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-01-25 02:57:57 +0200
commitfa4004437d8ca5aff34c31f61ce8aea485be24d1 (patch)
treeebe85023c8a5e5efbb8ec708699118b32ac61e87 /ext/bg/js
parentaa5a044dade6a6b4caaa368215b96add53a312b4 (diff)
query parser: add toggle for term spacing
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/search-query-parser.js5
-rw-r--r--ext/bg/js/settings/main.js1
2 files changed, 6 insertions, 0 deletions
diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js
index 8115dd46..e8e6d11f 100644
--- a/ext/bg/js/search-query-parser.js
+++ b/ext/bg/js/search-query-parser.js
@@ -88,6 +88,11 @@ class QueryParser extends TextScanner {
];
}
+ setOptions(options) {
+ super.setOptions(options);
+ this.queryParser.dataset.termSpacing = `${options.parsing.termSpacing}`;
+ }
+
refreshSelectedParser() {
if (this.parseResults.length > 0) {
if (this.selectedParser === null) {
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js
index ac255978..bed57f7d 100644
--- a/ext/bg/js/settings/main.js
+++ b/ext/bg/js/settings/main.js
@@ -74,6 +74,7 @@ async function formRead(options) {
options.parsing.enableScanningParser = $('#parsing-scan-enable').prop('checked');
options.parsing.enableMecabParser = $('#parsing-mecab-enable').prop('checked');
+ options.parsing.termSpacing = $('#parsing-term-spacing').prop('checked');
options.parsing.readingMode = $('#parsing-reading-mode').val();
const optionsAnkiEnableOld = options.anki.enable;