diff options
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/data/options-schema.json | 7 | ||||
-rw-r--r-- | ext/bg/js/search-query-parser.js | 5 | ||||
-rw-r--r-- | ext/bg/js/settings/main.js | 1 | ||||
-rw-r--r-- | ext/bg/settings.html | 5 |
4 files changed, 17 insertions, 1 deletions
diff --git a/ext/bg/data/options-schema.json b/ext/bg/data/options-schema.json index c65bb1e9..a20a0619 100644 --- a/ext/bg/data/options-schema.json +++ b/ext/bg/data/options-schema.json @@ -419,6 +419,7 @@ "enableScanningParser", "enableMecabParser", "selectedParser", + "termSpacing", "readingMode" ], "properties": { @@ -434,9 +435,13 @@ "type": ["string", "null"], "default": null }, + "termSpacing": { + "type": "boolean", + "default": true + }, "readingMode": { "type": "string", - "enum": ["hiragana", "katakana", "romaji"], + "enum": ["hiragana", "katakana", "romaji", "none"], "default": "hiragana" } } 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 6dccc7e0..b2ac82f9 100644 --- a/ext/bg/js/settings/main.js +++ b/ext/bg/js/settings/main.js @@ -80,6 +80,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; diff --git a/ext/bg/settings.html b/ext/bg/settings.html index 82ec26d9..3e06d4b5 100644 --- a/ext/bg/settings.html +++ b/ext/bg/settings.html @@ -526,12 +526,17 @@ <label><input type="checkbox" id="parsing-mecab-enable"> Enable text parsing using MeCab</label> </div> + <div class="checkbox"> + <label><input type="checkbox" id="parsing-term-spacing"> Enable small spaces between parsed words</label> + </div> + <div class="form-group"> <label for="parsing-reading-mode">Reading mode</label> <select class="form-control" id="parsing-reading-mode"> <option value="hiragana">ひらがな</option> <option value="katakana">カタカナ</option> <option value="romaji">Romaji</option> + <option value="none">Disabled</option> </select> </div> </div> |