diff options
Diffstat (limited to 'ext/fg/js/util.js')
-rw-r--r-- | ext/fg/js/util.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/fg/js/util.js b/ext/fg/js/util.js index 96007b74..cedfb887 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,36 @@ 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 findTermGrouped(text) { + return invokeBgApi('findTermGrouped', {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) { |