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",
|
"enableScanningParser",
|
||||||
"enableMecabParser",
|
"enableMecabParser",
|
||||||
"selectedParser",
|
"selectedParser",
|
||||||
|
"termSpacing",
|
||||||
"readingMode"
|
"readingMode"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -434,9 +435,13 @@
|
|||||||
"type": ["string", "null"],
|
"type": ["string", "null"],
|
||||||
"default": null
|
"default": null
|
||||||
},
|
},
|
||||||
|
"termSpacing": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"readingMode": {
|
"readingMode": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["hiragana", "katakana", "romaji"],
|
"enum": ["hiragana", "katakana", "romaji", "none"],
|
||||||
"default": "hiragana"
|
"default": "hiragana"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,11 @@ class QueryParser extends TextScanner {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setOptions(options) {
|
||||||
|
super.setOptions(options);
|
||||||
|
this.queryParser.dataset.termSpacing = `${options.parsing.termSpacing}`;
|
||||||
|
}
|
||||||
|
|
||||||
refreshSelectedParser() {
|
refreshSelectedParser() {
|
||||||
if (this.parseResults.length > 0) {
|
if (this.parseResults.length > 0) {
|
||||||
if (this.selectedParser === null) {
|
if (this.selectedParser === null) {
|
||||||
|
@ -80,6 +80,7 @@ async function formRead(options) {
|
|||||||
|
|
||||||
options.parsing.enableScanningParser = $('#parsing-scan-enable').prop('checked');
|
options.parsing.enableScanningParser = $('#parsing-scan-enable').prop('checked');
|
||||||
options.parsing.enableMecabParser = $('#parsing-mecab-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();
|
options.parsing.readingMode = $('#parsing-reading-mode').val();
|
||||||
|
|
||||||
const optionsAnkiEnableOld = options.anki.enable;
|
const optionsAnkiEnableOld = options.anki.enable;
|
||||||
|
@ -526,12 +526,17 @@
|
|||||||
<label><input type="checkbox" id="parsing-mecab-enable"> Enable text parsing using MeCab</label>
|
<label><input type="checkbox" id="parsing-mecab-enable"> Enable text parsing using MeCab</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox">
|
||||||
|
<label><input type="checkbox" id="parsing-term-spacing"> Enable small spaces between parsed words</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="parsing-reading-mode">Reading mode</label>
|
<label for="parsing-reading-mode">Reading mode</label>
|
||||||
<select class="form-control" id="parsing-reading-mode">
|
<select class="form-control" id="parsing-reading-mode">
|
||||||
<option value="hiragana">ひらがな</option>
|
<option value="hiragana">ひらがな</option>
|
||||||
<option value="katakana">カタカナ</option>
|
<option value="katakana">カタカナ</option>
|
||||||
<option value="romaji">Romaji</option>
|
<option value="romaji">Romaji</option>
|
||||||
|
<option value="none">Disabled</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -132,7 +132,7 @@ html:root[data-yomichan-page=float] .navigation-header:not([hidden])~.navigation
|
|||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.query-parser-term {
|
#query-parser[data-term-spacing=true] .query-parser-term {
|
||||||
margin-right: 0.2em;
|
margin-right: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,6 +209,8 @@ function jpConvertReading(expressionFragment, readingFragment, readingMode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return readingFragment;
|
return readingFragment;
|
||||||
|
case 'none':
|
||||||
|
return null;
|
||||||
default:
|
default:
|
||||||
return readingFragment;
|
return readingFragment;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user