diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-03-02 22:35:02 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-03-02 22:35:02 -0800 |
commit | faf13d696c874a0c546f5c862a2567032f423d09 (patch) | |
tree | 3018c2ef3616771a310cf25fe6666937f8a97966 /ext/bg/js/yomichan.js | |
parent | a01ca1f17c056179ab9040bf702429fdd97742d6 (diff) |
cleanup
Diffstat (limited to 'ext/bg/js/yomichan.js')
-rw-r--r-- | ext/bg/js/yomichan.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index abf6c10c..63e3e959 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -126,11 +126,11 @@ class Yomichan { return note; } - api_getOptions({callback}) { + api_optionsGet({callback}) { promiseCallback(optionsLoad(), callback); } - api_findKanji({text, callback}) { + api_kanjiFind({text, callback}) { promiseCallback( this.translator.findKanji(text, dictEnabled(this.options)).then(definitions => { return definitions.slice(0, this.options.general.maxResults); @@ -139,7 +139,7 @@ class Yomichan { ); } - api_findTerms({text, callback}) { + api_termsFind({text, callback}) { promiseCallback( this.translator.findTerms(text, dictEnabled(this.options), this.options.general.softKatakana).then(({definitions, length}) => { return {length, definitions: definitions.slice(0, this.options.general.maxResults)}; @@ -148,7 +148,7 @@ class Yomichan { ); } - api_findTermsGrouped({text, callback}) { + api_termsFindGrouped({text, callback}) { promiseCallback( this.translator.findTermsGrouped(text, dictEnabled(this.options), this.options.general.softKatakana).then(({definitions, length}) => { return {length, definitions: definitions.slice(0, this.options.general.maxResults)}; @@ -157,16 +157,16 @@ class Yomichan { ); } - api_renderText({template, data, callback}) { + api_textRender({template, data, callback}) { callback({result: Handlebars.templates[template](data)}); } - api_addDefinition({definition, mode, callback}) { + api_definitionAdd({definition, mode, callback}) { const note = this.formatNote(definition, mode); promiseCallback(this.anki.addNote(note), callback); } - api_canAddDefinitions({definitions, modes, callback}) { + api_definitionsAddable({definitions, modes, callback}) { const notes = []; for (const definition of definitions) { for (const mode of modes) { |