summaryrefslogtreecommitdiff
path: root/ext/bg/js/options-form.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-01-11 20:44:53 -0800
committerAlex Yatskov <alex@foosoft.net>2017-01-11 20:44:53 -0800
commitc574ef4bc035947aac304b19101a791db3a8b91f (patch)
treef2724b44d6a2a85956e3184da18b15692ad47d4d /ext/bg/js/options-form.js
parent5c1c894df936fde38a351c8c7db6a6e323f4331c (diff)
parented1b1d91812fcb7283c39415ee7d11330b969b28 (diff)
Merge branch 'master' into dev
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r--ext/bg/js/options-form.js20
1 files changed, 1 insertions, 19 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 957f4ce5..8cffb2f7 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -40,8 +40,6 @@ function getFormValues() {
optsNew.scanLength = parseInt($('#scan-length').val(), 10);
optsNew.ankiMethod = $('#anki-method').val();
- optsNew.ankiUsername = $('#anki-username').val();
- optsNew.ankiPassword = $('#anki-password').val();
optsNew.ankiCardTags = $('#anki-card-tags').val().split(/[,; ]+/);
optsNew.sentenceExtent = parseInt($('#sentence-extent').val(), 10);
optsNew.ankiTermDeck = $('#anki-term-deck').val();
@@ -68,13 +66,8 @@ function getFormValues() {
function updateVisibility(opts) {
switch (opts.ankiMethod) {
- case 'ankiweb':
- $('#anki-general').show();
- $('.anki-login').show();
- break;
case 'ankiconnect':
$('#anki-general').show();
- $('.anki-login').hide();
break;
default:
$('#anki-general').hide();
@@ -104,8 +97,6 @@ $(document).ready(() => {
$('#scan-length').val(opts.scanLength);
$('#anki-method').val(opts.ankiMethod);
- $('#anki-username').val(opts.ankiUsername);
- $('#anki-password').val(opts.ankiPassword);
$('#anki-card-tags').val(opts.ankiCardTags.join(' '));
$('#sentence-extent').val(opts.sentenceExtent);
@@ -433,16 +424,7 @@ function onOptionsChanged(e) {
return saveOptions(optsNew).then(() => {
yomichan().setOptions(optsNew);
updateVisibility(optsNew);
-
- const loginChanged =
- optsNew.ankiUsername !== optsOld.ankiUsername ||
- optsNew.ankiPassword !== optsOld.ankiPassword;
-
- if (loginChanged && optsNew.ankiMethod === 'ankiweb') {
- showAnkiError(null);
- showAnkiSpinner(true);
- return anki().logout().then(() => populateAnkiDeckAndModel(optsNew));
- } else if (optsNew.ankiMethod !== optsOld.ankiMethod) {
+ if (optsNew.ankiMethod !== optsOld.ankiMethod) {
showAnkiError(null);
showAnkiSpinner(true);
return populateAnkiDeckAndModel(optsNew);