cleanup
This commit is contained in:
parent
c512412c05
commit
655bcec511
@ -29,9 +29,9 @@ function getFormValues() {
|
|||||||
const optionsNew = $.extend({}, optionsOld);
|
const optionsNew = $.extend({}, optionsOld);
|
||||||
|
|
||||||
optionsNew.general.autoStart = $('#activate-on-startup').prop('checked');
|
optionsNew.general.autoStart = $('#activate-on-startup').prop('checked');
|
||||||
optionsNew.general.audioPlayback = $('#enable-audio-playback').prop('checked');
|
optionsNew.general.audioPlayback = $('#audio-playback-buttons').prop('checked');
|
||||||
optionsNew.general.softKatakana = $('#enable-soft-katakana-search').prop('checked');
|
optionsNew.general.softKatakana = $('#soft-katakana-search').prop('checked');
|
||||||
optionsNew.general.groupResults = $('#group-term-results').prop('checked');
|
optionsNew.general.groupResults = $('#group-terms-results').prop('checked');
|
||||||
optionsNew.general.showAdvanced = $('#show-advanced-options').prop('checked');
|
optionsNew.general.showAdvanced = $('#show-advanced-options').prop('checked');
|
||||||
|
|
||||||
optionsNew.scanning.requireShift = $('#hold-shift-to-scan').prop('checked');
|
optionsNew.scanning.requireShift = $('#hold-shift-to-scan').prop('checked');
|
||||||
@ -40,10 +40,10 @@ function getFormValues() {
|
|||||||
optionsNew.scanning.length = parseInt($('#scan-length').val(), 10);
|
optionsNew.scanning.length = parseInt($('#scan-length').val(), 10);
|
||||||
|
|
||||||
optionsNew.anki.enable = $('#anki-enable').prop('checked');
|
optionsNew.anki.enable = $('#anki-enable').prop('checked');
|
||||||
optionsNew.anki.tags = $('#anki-card-tags').val().split(/[,; ]+/);
|
optionsNew.anki.tags = $('#card-tags').val().split(/[,; ]+/);
|
||||||
optionsNew.anki.sentenceExt = parseInt($('#sentence-extent').val(), 10);
|
optionsNew.anki.sentenceExt = parseInt($('#sentence-detection-extent').val(), 10);
|
||||||
optionsNew.anki.terms.deck = $('#anki-term-deck').val();
|
optionsNew.anki.terms.deck = $('#anki-terms-deck').val();
|
||||||
optionsNew.anki.terms.model = $('#anki-term-model').val();
|
optionsNew.anki.terms.model = $('#anki-terms-model').val();
|
||||||
optionsNew.anki.terms.fields = fieldsToDict($('#terms .anki-field-value'));
|
optionsNew.anki.terms.fields = fieldsToDict($('#terms .anki-field-value'));
|
||||||
optionsNew.anki.kanji.deck = $('#anki-kanji-deck').val();
|
optionsNew.anki.kanji.deck = $('#anki-kanji-deck').val();
|
||||||
optionsNew.anki.kanji.model = $('#anki-kanji-model').val();
|
optionsNew.anki.kanji.model = $('#anki-kanji-model').val();
|
||||||
@ -82,9 +82,9 @@ $(document).ready(() => {
|
|||||||
|
|
||||||
optionsLoad().then(options => {
|
optionsLoad().then(options => {
|
||||||
$('#activate-on-startup').prop('checked', options.general.autoStart);
|
$('#activate-on-startup').prop('checked', options.general.autoStart);
|
||||||
$('#enable-audio-playback').prop('checked', options.general.audioPlayback);
|
$('#audio-playback-buttons').prop('checked', options.general.audioPlayback);
|
||||||
$('#enable-soft-katakana-search').prop('checked', options.general.softKatakana);
|
$('#soft-katakana-search').prop('checked', options.general.softKatakana);
|
||||||
$('#group-term-results').prop('checked', options.general.groupResults);
|
$('#group-terms-results').prop('checked', options.general.groupResults);
|
||||||
$('#show-advanced-options').prop('checked', options.general.showAdvanced);
|
$('#show-advanced-options').prop('checked', options.general.showAdvanced);
|
||||||
|
|
||||||
$('#hold-shift-to-scan').prop('checked', options.scanning.requireShift);
|
$('#hold-shift-to-scan').prop('checked', options.scanning.requireShift);
|
||||||
@ -98,8 +98,8 @@ $(document).ready(() => {
|
|||||||
$('#dict-url').on('input', onDictionaryUpdateUrl);
|
$('#dict-url').on('input', onDictionaryUpdateUrl);
|
||||||
|
|
||||||
$('#anki-enable').prop('checked', options.anki.enable);
|
$('#anki-enable').prop('checked', options.anki.enable);
|
||||||
$('#anki-card-tags').val(options.anki.tags.join(' '));
|
$('#card-tags').val(options.anki.tags.join(' '));
|
||||||
$('#sentence-extent').val(options.anki.sentenceExt);
|
$('#sentence-detection-extent').val(options.anki.sentenceExt);
|
||||||
$('input, select').not('.anki-model').change(onOptionsChanged);
|
$('input, select').not('.anki-model').change(onOptionsChanged);
|
||||||
$('.anki-model').change(onAnkiModelChanged);
|
$('.anki-model').change(onAnkiModelChanged);
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ function populateAnkiDeckAndModel(options) {
|
|||||||
ankiDeck.find('option').remove();
|
ankiDeck.find('option').remove();
|
||||||
deckNames.forEach(name => ankiDeck.append($('<option/>', {value: name, text: name})));
|
deckNames.forEach(name => ankiDeck.append($('<option/>', {value: name, text: name})));
|
||||||
|
|
||||||
$('#anki-term-deck').val(options.anki.terms.deck);
|
$('#anki-terms-deck').val(options.anki.terms.deck);
|
||||||
$('#anki-kanji-deck').val(options.anki.kanji.deck);
|
$('#anki-kanji-deck').val(options.anki.kanji.deck);
|
||||||
|
|
||||||
const ankiModel = $('.anki-model');
|
const ankiModel = $('.anki-model');
|
||||||
@ -317,7 +317,7 @@ function populateAnkiDeckAndModel(options) {
|
|||||||
modelNames.forEach(name => ankiModel.append($('<option/>', {value: name, text: name})));
|
modelNames.forEach(name => ankiModel.append($('<option/>', {value: name, text: name})));
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
populateAnkiFields($('#anki-term-model').val(options.anki.terms.model), options),
|
populateAnkiFields($('#anki-terms-model').val(options.anki.terms.model), options),
|
||||||
populateAnkiFields($('#anki-kanji-model').val(options.anki.kanji.model), options)
|
populateAnkiFields($('#anki-kanji-model').val(options.anki.kanji.model), options)
|
||||||
]);
|
]);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -30,15 +30,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label><input type="checkbox" id="enable-audio-playback"> Enable audio playback</label>
|
<label><input type="checkbox" id="audio-playback-buttons"> Audio playback buttons</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label><input type="checkbox" id="enable-soft-katakana-search"> Enable soft Katakana search</label>
|
<label><input type="checkbox" id="soft-katakana-search"> Soft Katakana search</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label><input type="checkbox" id="group-term-results"> Group term results</label>
|
<label><input type="checkbox" id="group-terms-results"> Group term results</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
@ -143,13 +143,13 @@
|
|||||||
|
|
||||||
<div id="anki-general">
|
<div id="anki-general">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="anki-card-tags">Card tags (comma or space separated)</label>
|
<label for="card-tags">Card tags (comma or space separated)</label>
|
||||||
<input type="text" id="anki-card-tags" class="form-control">
|
<input type="text" id="card-tags" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group options-advanced">
|
<div class="form-group options-advanced">
|
||||||
<label for="sentence-extent">Sentence detection extent</label>
|
<label for="sentence-detection-extent">Sentence detection extent</label>
|
||||||
<input type="number" min="1" id="sentence-extent" class="form-control">
|
<input type="number" min="1" id="sentence-detection-extent" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="anki-format">
|
<div id="anki-format">
|
||||||
@ -162,13 +162,13 @@
|
|||||||
<div id="terms" class="tab-pane fade in active">
|
<div id="terms" class="tab-pane fade in active">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-xs-6">
|
<div class="form-group col-xs-6">
|
||||||
<label for="anki-term-deck">Deck</label>
|
<label for="anki-terms-deck">Deck</label>
|
||||||
<select class="form-control anki-deck" id="anki-term-deck"></select>
|
<select class="form-control anki-deck" id="anki-terms-deck"></select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-xs-6">
|
<div class="form-group col-xs-6">
|
||||||
<label for="anki-term-model">Model</label>
|
<label for="anki-terms-model">Model</label>
|
||||||
<select class="form-control anki-model" id="anki-term-model"></select>
|
<select class="form-control anki-model" id="anki-terms-model"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user