aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-07-25 20:28:56 -0700
committerAlex Yatskov <alex@foosoft.net>2016-07-25 20:28:56 -0700
commit80fedc4f7afd551481314585336199e53af843c5 (patch)
tree4f7d06a6936c47b0ab5d8c4aa72716bc967dae8f /ext/bg/js
parent2b2e6cba3f0a1f474191ba306b800a18819dde57 (diff)
Hook up sentence search extent to options
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options-form.js2
-rw-r--r--ext/bg/js/options.js1
2 files changed, 3 insertions, 0 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 712b7243..c72508c6 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -49,6 +49,7 @@ function formToOptions(section, callback) {
break;
case 'anki':
optsNew.ankiCardTags = $('#anki-card-tags').val().split(/[,; ]+/);
+ optsNew.sentenceExtent = parseInt($('#sentence-extent').val());
optsNew.ankiVocabDeck = $('#anki-vocab-deck').val();
optsNew.ankiVocabModel = $('#anki-vocab-model').val();
optsNew.ankiVocabFields = fieldsToDict($('#vocab .anki-field-value'));
@@ -174,6 +175,7 @@ $(document).ready(() => {
$('#enable-anki-connect').prop('checked', opts.enableAnkiConnect);
$('#anki-card-tags').val(opts.ankiCardTags.join(' '));
+ $('#sentence-extent').val(opts.sentenceExtent);
$('.options-general input').change(onOptionsGeneralChanged);
$('.options-anki input').change(onOptionsAnkiChanged);
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 18707e43..44236e68 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -26,6 +26,7 @@ function sanitizeOptions(options) {
enableAudioPlayback: true,
enableAnkiConnect: false,
ankiCardTags: ['yomichan'],
+ sentenceExtent: 200,
ankiVocabDeck: '',
ankiVocabModel: '',
ankiVocabFields: {},