WIP
This commit is contained in:
parent
7aa6d6feee
commit
49f98a8c53
@ -73,10 +73,6 @@ class AnkiWeb {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getStatus() {
|
|
||||||
return 'ready';
|
|
||||||
}
|
|
||||||
|
|
||||||
static scrape() {
|
static scrape() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
$.get('https://ankiweb.net/edit/', (data, status) => {
|
$.get('https://ankiweb.net/edit/', (data, status) => {
|
||||||
|
@ -68,7 +68,6 @@ function getBasicOptions() {
|
|||||||
optsNew.activateOnStartup = $('#activate-on-startup').prop('checked');
|
optsNew.activateOnStartup = $('#activate-on-startup').prop('checked');
|
||||||
optsNew.showAdvancedOptions = $('#show-advanced-options').prop('checked');
|
optsNew.showAdvancedOptions = $('#show-advanced-options').prop('checked');
|
||||||
optsNew.enableAudioPlayback = $('#enable-audio-playback').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.holdShiftToScan = $('#hold-shift-to-scan').prop('checked');
|
||||||
optsNew.selectMatchedText = $('#select-matched-text').prop('checked');
|
optsNew.selectMatchedText = $('#select-matched-text').prop('checked');
|
||||||
optsNew.scanDelay = parseInt($('#scan-delay').val(), 10);
|
optsNew.scanDelay = parseInt($('#scan-delay').val(), 10);
|
||||||
@ -243,7 +242,6 @@ $(document).ready(() => {
|
|||||||
loadOptions().then(opts => {
|
loadOptions().then(opts => {
|
||||||
$('#activate-on-startup').prop('checked', opts.activateOnStartup);
|
$('#activate-on-startup').prop('checked', opts.activateOnStartup);
|
||||||
$('#enable-audio-playback').prop('checked', opts.enableAudioPlayback);
|
$('#enable-audio-playback').prop('checked', opts.enableAudioPlayback);
|
||||||
$('#enable-anki-connect').prop('checked', opts.enableAnkiConnect);
|
|
||||||
$('#show-advanced-options').prop('checked', opts.showAdvancedOptions);
|
$('#show-advanced-options').prop('checked', opts.showAdvancedOptions);
|
||||||
$('#hold-shift-to-scan').prop('checked', opts.holdShiftToScan);
|
$('#hold-shift-to-scan').prop('checked', opts.holdShiftToScan);
|
||||||
$('#select-matched-text').prop('checked', opts.selectMatchedText);
|
$('#select-matched-text').prop('checked', opts.selectMatchedText);
|
||||||
@ -256,20 +254,17 @@ $(document).ready(() => {
|
|||||||
$('#anki-card-tags').val(opts.ankiCardTags.join(' '));
|
$('#anki-card-tags').val(opts.ankiCardTags.join(' '));
|
||||||
$('#sentence-extent').val(opts.sentenceExtent);
|
$('#sentence-extent').val(opts.sentenceExtent);
|
||||||
|
|
||||||
$('#anki-method').change(onOptionsAnkiChanged);
|
$('.options-basic').change(onOptionsBasicChanged);
|
||||||
$('.options-basic input').change(onOptionsBasicChanged);
|
$('.options-anki').not('.anki-model').change(onOptionsAnkiChanged);
|
||||||
$('.options-anki input').change(onOptionsAnkiChanged);
|
|
||||||
$('.anki-deck').change(onOptionsAnkiChanged);
|
|
||||||
$('.anki-model').change(onAnkiModelChanged);
|
$('.anki-model').change(onAnkiModelChanged);
|
||||||
|
|
||||||
if (opts.showAdvancedOptions) {
|
if (opts.showAdvancedOptions) {
|
||||||
$('.options-advanced').show();
|
$('.options-advanced').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.enableAnkiConnect) {
|
|
||||||
updateAnkiStatus();
|
updateAnkiStatus();
|
||||||
populateAnkiDeckAndModel(opts);
|
populateAnkiDeckAndModel(opts);
|
||||||
|
|
||||||
$('.options-anki').show();
|
$('.options-anki').show();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,6 @@ function sanitizeOptions(options) {
|
|||||||
const defaults = {
|
const defaults = {
|
||||||
activateOnStartup: true,
|
activateOnStartup: true,
|
||||||
enableAudioPlayback: true,
|
enableAudioPlayback: true,
|
||||||
enableAnkiConnect: false,
|
|
||||||
showAdvancedOptions: false,
|
showAdvancedOptions: false,
|
||||||
selectMatchedText: true,
|
selectMatchedText: true,
|
||||||
holdShiftToScan: true,
|
holdShiftToScan: true,
|
||||||
|
@ -44,14 +44,6 @@
|
|||||||
</div>
|
</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="enable-anki-connect"> Enable <a href="https://foosoft.net/projects/anki-connect">AnkiConnect</a></label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-offset-2 col-sm-10">
|
<div class="col-sm-offset-2 col-sm-10">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
Loading…
Reference in New Issue
Block a user