diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-01-13 21:06:33 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-01-13 21:06:33 -0800 |
commit | 8fe82573cc456fe1256989e0c3e524590a1a0acf (patch) | |
tree | 08fd34b9a68c26fce82fb0d84c4f00bd3be2ba0d /ext/bg/js/yomichan.js | |
parent | 11fcc465ac151af7f417acc602b58a04bf019d80 (diff) |
WIP
Diffstat (limited to 'ext/bg/js/yomichan.js')
-rw-r--r-- | ext/bg/js/yomichan.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index 7debd9f3..01460289 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -32,9 +32,9 @@ class Yomichan { chrome.browserAction.onClicked.addListener(this.onBrowserAction.bind(this)); chrome.runtime.onInstalled.addListener(this.onInstalled.bind(this)); - loadOptions().then(opts => { + optionsLoad().then(opts => { this.setOptions(opts); - if (this.options.activateOnStartup) { + if (this.options.general.autoStart) { this.setState('loading'); } }); @@ -94,7 +94,7 @@ class Yomichan { setOptions(options) { this.options = options; - if (options.ankiEnable) { + if (options.anki.enable) { this.anki = new AnkiConnect(); } else { this.anki = new AnkiNull(); @@ -116,17 +116,17 @@ class Yomichan { } formatNote(definition, mode) { - const note = {fields: {}, tags: this.options.ankiCardTags}; + const note = {fields: {}, tags: this.options.anki.tags}; let fields = []; if (mode === 'kanji') { - fields = this.options.ankiKanjiFields; - note.deckName = this.options.ankiKanjiDeck; - note.modelName = this.options.ankiKanjiModel; + fields = this.options.anki.kanji.fields; + note.deckName = this.options.anki.kanji.deck; + note.modelName = this.options.anki.kanji.model; } else { - fields = this.options.ankiTermFields; - note.deckName = this.options.ankiTermDeck; - note.modelName = this.options.ankiTermModel; + fields = this.options.anki.terms.fields; + note.deckName = this.options.anki.terms.deck; + note.modelName = this.options.anki.terms.model; const audio = { kanji: definition.expression, @@ -157,7 +157,7 @@ class Yomichan { } api_getOptions({callback}) { - promiseCallback(loadOptions(), callback); + promiseCallback(optionsLoad(), callback); } api_findKanji({text, callback}) { @@ -186,7 +186,7 @@ class Yomichan { this.translator.findTerm( text, dictionaries, - this.options.enableSoftKatakanaSearch + this.options.general.softKatakana ), callback ); @@ -204,7 +204,7 @@ class Yomichan { this.translator.findTermGrouped( text, dictionaries, - this.options.enableSoftKatakanaSearch + this.options.general.softKatakana ), callback ); |