aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options-form.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-14 12:08:06 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-14 12:08:06 -0700
commitd0654e2cf6ab1138049484af109fc848998c2f5a (patch)
tree737256f5cbc375632660b7293c4cc9a2b703ada4 /ext/bg/js/options-form.js
parent8f8d8d3f513517fdca941bc3fb0bc88722229db5 (diff)
Adding stub for usage guide
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r--ext/bg/js/options-form.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 979f5377..cd0c1ab8 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -54,6 +54,7 @@ function formToOptions(section, callback) {
optsNew.activateOnStartup = $('#activate-on-startup').prop('checked');
optsNew.loadEnamDict = $('#load-enamdict').prop('checked');
optsNew.selectMatchedText = $('#select-matched-text').prop('checked');
+ optsNew.showAdvancedOptions = $('#show-advanced-options').prop('checked');
optsNew.enableAudioPlayback = $('#enable-audio-playback').prop('checked');
optsNew.enableAnkiConnect = $('#enable-anki-connect').prop('checked');
break;
@@ -174,9 +175,15 @@ function onOptionsGeneralChanged(e) {
if (!optsOld.enableAnkiConnect && optsNew.enableAnkiConnect) {
updateAnkiStatus();
populateAnkiDeckAndModel(optsNew);
- $('.options-anki').fadeIn();
+ $('.options-anki').show();
} else if (optsOld.enableAnkiConnect && !optsNew.enableAnkiConnect) {
- $('.options-anki').fadeOut();
+ $('.options-anki').hide();
+ }
+
+ if (optsNew.showAdvancedOptions) {
+ $('.options-advanced').show();
+ } else {
+ $('.options-advanced').hide();
}
});
});
@@ -208,6 +215,7 @@ $(document).ready(() => {
$('#activate-on-startup').prop('checked', opts.activateOnStartup);
$('#load-enamdict').prop('checked', opts.loadEnamDict);
$('#select-matched-text').prop('checked', opts.selectMatchedText);
+ $('#show-advanced-options').prop('checked', opts.showAdvancedOptions);
$('#enable-audio-playback').prop('checked', opts.enableAudioPlayback);
$('#enable-anki-connect').prop('checked', opts.enableAnkiConnect);
@@ -219,6 +227,10 @@ $(document).ready(() => {
$('.anki-deck').change(onOptionsAnkiChanged);
$('.anki-model').change(onAnkiModelChanged);
+ if (opts.showAdvancedOptions) {
+ $('.options-advanced').show();
+ }
+
if (opts.enableAnkiConnect) {
updateAnkiStatus();
populateAnkiDeckAndModel(opts);