summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-18 21:48:40 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-18 21:48:40 -0700
commit28e217b75be75fc52dde9aabdf9b52d413497533 (patch)
treeb9497df4d750f889c0fbca990cd59ae1094fede3 /ext/bg
parent70188eacb15b2e1e9b452dab644b43d7c21bd009 (diff)
WIP
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/options-form.js22
-rw-r--r--ext/bg/js/options.js6
-rw-r--r--ext/bg/js/yomichan.js2
3 files changed, 23 insertions, 7 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 62c5e7b2..3dab0a87 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -32,15 +32,31 @@ function fieldsToDict(selection) {
function modelIdToFieldOptKey(id) {
return {
- 'anki-term-model': 'ankiTermFields',
+ 'anki-term-model': 'ankiTermFields',
'anki-kanji-model': 'ankiKanjiFields'
}[id];
}
function modelIdToMarkers(id) {
return {
- 'anki-term-model': ['audio', 'expression', 'glossary', 'glossary-list', 'reading', 'sentence', 'tags', 'url'],
- 'anki-kanji-model': ['character', 'glossary', 'glossary-list', 'kunyomi', 'onyomi', 'url'],
+ 'anki-term-model': [
+ 'audio',
+ 'expression',
+ 'glossary',
+ 'glossary-list',
+ 'reading',
+ 'sentence',
+ 'tags',
+ 'url'
+ ],
+ 'anki-kanji-model': [
+ 'character',
+ 'glossary',
+ 'glossary-list',
+ 'kunyomi',
+ 'onyomi',
+ 'url'
+ ],
}[id];
}
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 8a6f633a..831bb817 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -28,9 +28,9 @@ function sanitizeOptions(options) {
enableAnkiConnect: false,
ankiCardTags: ['yomichan'],
sentenceExtent: 200,
- ankiTermDeck: options.ankiVocabDeck || '',
- ankiTermModel: options.ankiVocabModel || '',
- ankiTermFields: options.ankiVocabFields || {},
+ ankiTermDeck: '',
+ ankiTermModel: '',
+ ankiTermFields: {},
ankiKanjiDeck: '',
ankiKanjiModel: '',
ankiKanjiFields: {}
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index 4ba28e34..b8fa9593 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -248,7 +248,7 @@ class Yomichan {
}
}
- for (let name in fields) {
+ for (const name in fields) {
note.fields[name] = this.formatField(fields[name], definition, mode);
}