Merge pull request #223 from odehjoseph/master

Add option to enable Alt+B lookup
This commit is contained in:
Alex Yatskov 2019-09-26 21:50:34 -07:00 committed by GitHub
commit 8195e5109b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View File

@ -281,6 +281,7 @@ function profileOptionsCreateDefaults() {
modifier: 'shift', modifier: 'shift',
deepDomScan: false, deepDomScan: false,
popupNestingMaxDepth: 0, popupNestingMaxDepth: 0,
enablePopupSearch: false,
enableOnPopupExpressions: false, enableOnPopupExpressions: false,
enableOnSearchPage: true enableOnSearchPage: true
}, },

View File

@ -50,6 +50,7 @@ async function formRead(options) {
options.scanning.alphanumeric = $('#search-alphanumeric').prop('checked'); options.scanning.alphanumeric = $('#search-alphanumeric').prop('checked');
options.scanning.autoHideResults = $('#auto-hide-results').prop('checked'); options.scanning.autoHideResults = $('#auto-hide-results').prop('checked');
options.scanning.deepDomScan = $('#deep-dom-scan').prop('checked'); options.scanning.deepDomScan = $('#deep-dom-scan').prop('checked');
options.scanning.enablePopupSearch = $('#enable-search-within-first-popup').prop('checked');
options.scanning.enableOnPopupExpressions = $('#enable-scanning-of-popup-expressions').prop('checked'); options.scanning.enableOnPopupExpressions = $('#enable-scanning-of-popup-expressions').prop('checked');
options.scanning.enableOnSearchPage = $('#enable-scanning-on-search-page').prop('checked'); options.scanning.enableOnSearchPage = $('#enable-scanning-on-search-page').prop('checked');
options.scanning.delay = parseInt($('#scan-delay').val(), 10); options.scanning.delay = parseInt($('#scan-delay').val(), 10);
@ -115,6 +116,7 @@ async function formWrite(options) {
$('#search-alphanumeric').prop('checked', options.scanning.alphanumeric); $('#search-alphanumeric').prop('checked', options.scanning.alphanumeric);
$('#auto-hide-results').prop('checked', options.scanning.autoHideResults); $('#auto-hide-results').prop('checked', options.scanning.autoHideResults);
$('#deep-dom-scan').prop('checked', options.scanning.deepDomScan); $('#deep-dom-scan').prop('checked', options.scanning.deepDomScan);
$('#enable-search-within-first-popup').prop('checked', options.scanning.enablePopupSearch);
$('#enable-scanning-of-popup-expressions').prop('checked', options.scanning.enableOnPopupExpressions); $('#enable-scanning-of-popup-expressions').prop('checked', options.scanning.enableOnPopupExpressions);
$('#enable-scanning-on-search-page').prop('checked', options.scanning.enableOnSearchPage); $('#enable-scanning-on-search-page').prop('checked', options.scanning.enableOnSearchPage);
$('#scan-delay').val(options.scanning.delay); $('#scan-delay').val(options.scanning.delay);

View File

@ -413,6 +413,10 @@
This feature can be enabled if the <strong>Maximum number of additional popups</strong> option is set to a value greater than 0. This feature can be enabled if the <strong>Maximum number of additional popups</strong> option is set to a value greater than 0.
</p> </p>
<div class="checkbox">
<label><input type="checkbox" id="enable-search-within-first-popup"> Enable search within the first popup with Alt+B</label>
</div>
<div class="checkbox"> <div class="checkbox">
<label><input type="checkbox" id="enable-scanning-on-search-page"> Enable scanning on search page</label> <label><input type="checkbox" id="enable-scanning-on-search-page"> Enable scanning on search page</label>
</div> </div>

View File

@ -323,7 +323,9 @@ class Display {
$('.action-play-audio').click(this.onAudioPlay.bind(this)); $('.action-play-audio').click(this.onAudioPlay.bind(this));
$('.kanji-link').click(this.onKanjiLookup.bind(this)); $('.kanji-link').click(this.onKanjiLookup.bind(this));
$('.source-term').click(this.onSourceTermView.bind(this)); $('.source-term').click(this.onSourceTermView.bind(this));
if (this.options.scanning.enablePopupSearch) {
$('.glossary-item').click(this.onTermLookup.bind(this)); $('.glossary-item').click(this.onTermLookup.bind(this));
}
await this.adderButtonUpdate(['term-kanji', 'term-kana'], sequence); await this.adderButtonUpdate(['term-kanji', 'term-kana'], sequence);
} catch (e) { } catch (e) {