summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-10-15 19:21:02 -0700
committerAlex Yatskov <alex@foosoft.net>2016-10-15 19:21:02 -0700
commit49f98a8c53c396cc0fe69a62c7e2a2ce004f32ce (patch)
treebda618446226e429dfaeb563d7bbf2e48560ccf9 /ext/bg
parent7aa6d6feee78307d998596082caf73a3c1577285 (diff)
WIP
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/ankiweb.js4
-rw-r--r--ext/bg/js/options-form.js17
-rw-r--r--ext/bg/js/options.js1
-rw-r--r--ext/bg/options.html8
4 files changed, 6 insertions, 24 deletions
diff --git a/ext/bg/js/ankiweb.js b/ext/bg/js/ankiweb.js
index d68b81ab..6cfc50be 100644
--- a/ext/bg/js/ankiweb.js
+++ b/ext/bg/js/ankiweb.js
@@ -73,10 +73,6 @@ class AnkiWeb {
});
}
- getStatus() {
- return 'ready';
- }
-
static scrape() {
return new Promise((resolve, reject) => {
$.get('https://ankiweb.net/edit/', (data, status) => {
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 7d280429..674ff07d 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -68,7 +68,6 @@ function getBasicOptions() {
optsNew.activateOnStartup = $('#activate-on-startup').prop('checked');
optsNew.showAdvancedOptions = $('#show-advanced-options').prop('checked');
optsNew.enableAudioPlayback = $('#enable-audio-playback').prop('checked');
- optsNew.enableAnkiConnect = $('#enable-anki-connect').prop('checked');
optsNew.holdShiftToScan = $('#hold-shift-to-scan').prop('checked');
optsNew.selectMatchedText = $('#select-matched-text').prop('checked');
optsNew.scanDelay = parseInt($('#scan-delay').val(), 10);
@@ -243,7 +242,6 @@ $(document).ready(() => {
loadOptions().then(opts => {
$('#activate-on-startup').prop('checked', opts.activateOnStartup);
$('#enable-audio-playback').prop('checked', opts.enableAudioPlayback);
- $('#enable-anki-connect').prop('checked', opts.enableAnkiConnect);
$('#show-advanced-options').prop('checked', opts.showAdvancedOptions);
$('#hold-shift-to-scan').prop('checked', opts.holdShiftToScan);
$('#select-matched-text').prop('checked', opts.selectMatchedText);
@@ -256,20 +254,17 @@ $(document).ready(() => {
$('#anki-card-tags').val(opts.ankiCardTags.join(' '));
$('#sentence-extent').val(opts.sentenceExtent);
- $('#anki-method').change(onOptionsAnkiChanged);
- $('.options-basic input').change(onOptionsBasicChanged);
- $('.options-anki input').change(onOptionsAnkiChanged);
- $('.anki-deck').change(onOptionsAnkiChanged);
+ $('.options-basic').change(onOptionsBasicChanged);
+ $('.options-anki').not('.anki-model').change(onOptionsAnkiChanged);
$('.anki-model').change(onAnkiModelChanged);
if (opts.showAdvancedOptions) {
$('.options-advanced').show();
}
- if (opts.enableAnkiConnect) {
- updateAnkiStatus();
- populateAnkiDeckAndModel(opts);
- $('.options-anki').show();
- }
+ updateAnkiStatus();
+ populateAnkiDeckAndModel(opts);
+
+ $('.options-anki').show();
});
});
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 0dd37c48..e7fa4aad 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -21,7 +21,6 @@ function sanitizeOptions(options) {
const defaults = {
activateOnStartup: true,
enableAudioPlayback: true,
- enableAnkiConnect: false,
showAdvancedOptions: false,
selectMatchedText: true,
holdShiftToScan: true,
diff --git a/ext/bg/options.html b/ext/bg/options.html
index efb3a82f..70b0ff0f 100644
--- a/ext/bg/options.html
+++ b/ext/bg/options.html
@@ -47,14 +47,6 @@
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
- <label class="control-label"><input type="checkbox" id="enable-anki-connect"> Enable <a href="https://foosoft.net/projects/anki-connect">AnkiConnect</a></label>
- </div>
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-10">
- <div class="checkbox">
<label class="control-label"><input type="checkbox" id="show-advanced-options"> Show advanced options</label>
</div>
</div>