This commit is contained in:
Alex Yatskov 2016-08-18 21:48:40 -07:00
parent 70188eacb1
commit 28e217b75b
3 changed files with 23 additions and 7 deletions

View File

@ -32,15 +32,31 @@ function fieldsToDict(selection) {
function modelIdToFieldOptKey(id) { function modelIdToFieldOptKey(id) {
return { return {
'anki-term-model': 'ankiTermFields', 'anki-term-model': 'ankiTermFields',
'anki-kanji-model': 'ankiKanjiFields' 'anki-kanji-model': 'ankiKanjiFields'
}[id]; }[id];
} }
function modelIdToMarkers(id) { function modelIdToMarkers(id) {
return { return {
'anki-term-model': ['audio', 'expression', 'glossary', 'glossary-list', 'reading', 'sentence', 'tags', 'url'], 'anki-term-model': [
'anki-kanji-model': ['character', 'glossary', 'glossary-list', 'kunyomi', 'onyomi', 'url'], 'audio',
'expression',
'glossary',
'glossary-list',
'reading',
'sentence',
'tags',
'url'
],
'anki-kanji-model': [
'character',
'glossary',
'glossary-list',
'kunyomi',
'onyomi',
'url'
],
}[id]; }[id];
} }

View File

@ -28,9 +28,9 @@ function sanitizeOptions(options) {
enableAnkiConnect: false, enableAnkiConnect: false,
ankiCardTags: ['yomichan'], ankiCardTags: ['yomichan'],
sentenceExtent: 200, sentenceExtent: 200,
ankiTermDeck: options.ankiVocabDeck || '', ankiTermDeck: '',
ankiTermModel: options.ankiVocabModel || '', ankiTermModel: '',
ankiTermFields: options.ankiVocabFields || {}, ankiTermFields: {},
ankiKanjiDeck: '', ankiKanjiDeck: '',
ankiKanjiModel: '', ankiKanjiModel: '',
ankiKanjiFields: {} ankiKanjiFields: {}

View File

@ -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); note.fields[name] = this.formatField(fields[name], definition, mode);
} }