Merge pull request #330 from siikamiika/query-parser-helper-disabling
Query parser helper disabling
This commit is contained in:
commit
7357eaf07a
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
@ -132,7 +132,7 @@ html:root[data-yomichan-page=float] .navigation-header:not([hidden])~.navigation
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.query-parser-term {
|
||||
#query-parser[data-term-spacing=true] .query-parser-term {
|
||||
margin-right: 0.2em;
|
||||
}
|
||||
|
||||
|
@ -209,6 +209,8 @@ function jpConvertReading(expressionFragment, readingFragment, readingMode) {
|
||||
}
|
||||
}
|
||||
return readingFragment;
|
||||
case 'none':
|
||||
return null;
|
||||
default:
|
||||
return readingFragment;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user