diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-01-07 18:39:36 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-01-07 18:39:36 -0800 |
commit | fab7a03b6c345ccd9fec66adb08a45206557c306 (patch) | |
tree | ea9f92263485a742ea66de7d05fc19e86b525e3d /ext/fg/js/util.js | |
parent | dc4162eeed14d958c65d63b2568fce58890e14e3 (diff) |
WIP
Diffstat (limited to 'ext/fg/js/util.js')
-rw-r--r-- | ext/fg/js/util.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/fg/js/util.js b/ext/fg/js/util.js index 96007b74..aae044c5 100644 --- a/ext/fg/js/util.js +++ b/ext/fg/js/util.js @@ -17,7 +17,7 @@ */ -function invokeApiBg(action, params) { +function invokeBgApi(action, params) { return new Promise((resolve, reject) => { chrome.runtime.sendMessage({action, params}, ({result, error}) => { if (error) { @@ -29,32 +29,32 @@ function invokeApiBg(action, params) { }); } -function getEnabled() { - return invokeApiBg('getEnabled', {}); +function isEnabled() { + return invokeBgApi('getEnabled', {}); } function getOptions() { - return invokeApiBg('getOptions', {}); + return invokeBgApi('getOptions', {}); } function findTerm(text) { - return invokeApiBg('findTerm', {text}); + return invokeBgApi('findTerm', {text}); } function findKanji(text) { - return invokeApiBg('findKanji', {text}); + return invokeBgApi('findKanji', {text}); } function renderText(data, template) { - return invokeApiBg('renderText', {data, template}); + return invokeBgApi('renderText', {data, template}); } function canAddDefinitions(definitions, modes) { - return invokeApiBg('canAddDefinitions', {definitions, modes}).catch(() => null); + return invokeBgApi('canAddDefinitions', {definitions, modes}).catch(() => null); } function addDefinition(definition, mode) { - return invokeApiBg('addDefinition', {definition, mode}); + return invokeBgApi('addDefinition', {definition, mode}); } function textSourceFromPoint(point) { |