This commit is contained in:
Alex Yatskov 2016-09-14 22:54:07 -07:00
parent c3ead3af93
commit 3608c9c16e
2 changed files with 6 additions and 4 deletions

View File

@ -229,12 +229,12 @@ function onAnkiModelChanged(e) {
$(document).ready(() => { $(document).ready(() => {
loadOptions().then(opts => { loadOptions().then(opts => {
$('#scan-length').val(opts.scanLength);
$('#activate-on-startup').prop('checked', opts.activateOnStartup); $('#activate-on-startup').prop('checked', opts.activateOnStartup);
$('#select-matched-text').prop('checked', opts.selectMatchedText); $('#select-matched-text').prop('checked', opts.selectMatchedText);
$('#show-advanced-options').prop('checked', opts.showAdvancedOptions);
$('#enable-audio-playback').prop('checked', opts.enableAudioPlayback); $('#enable-audio-playback').prop('checked', opts.enableAudioPlayback);
$('#enable-anki-connect').prop('checked', opts.enableAnkiConnect); $('#enable-anki-connect').prop('checked', opts.enableAnkiConnect);
$('#show-advanced-options').prop('checked', opts.showAdvancedOptions);
$('#scan-length').val(opts.scanLength);
$('#anki-card-tags').val(opts.ankiCardTags.join(' ')); $('#anki-card-tags').val(opts.ankiCardTags.join(' '));
$('#sentence-extent').val(opts.sentenceExtent); $('#sentence-extent').val(opts.sentenceExtent);

View File

@ -19,14 +19,16 @@
function sanitizeOptions(options) { function sanitizeOptions(options) {
const defaults = { const defaults = {
scanLength: 20,
activateOnStartup: false, activateOnStartup: false,
selectMatchedText: true, selectMatchedText: true,
showAdvancedOptions: false,
enableAudioPlayback: true, enableAudioPlayback: true,
enableAnkiConnect: false, enableAnkiConnect: false,
showAdvancedOptions: false,
scanLength: 20,
ankiCardTags: ['yomichan'], ankiCardTags: ['yomichan'],
sentenceExtent: 200, sentenceExtent: 200,
ankiTermDeck: '', ankiTermDeck: '',
ankiTermModel: '', ankiTermModel: '',
ankiTermFields: {}, ankiTermFields: {},