diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-09-15 21:03:58 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-09-15 21:03:58 -0700 |
commit | b969e8952c551fdc7c150dcc111eccdc90ac7408 (patch) | |
tree | 2fa21a903155412870c1807f5cc2ee8cab07f47f /ext/fg/js/util.js | |
parent | b87611cfddf5ca0e1529b88ed1610ebe0d4657e6 (diff) |
Cleanup
Diffstat (limited to 'ext/fg/js/util.js')
-rw-r--r-- | ext/fg/js/util.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/fg/js/util.js b/ext/fg/js/util.js index 176765fc..c24ad885 100644 --- a/ext/fg/js/util.js +++ b/ext/fg/js/util.js @@ -17,28 +17,28 @@ */ -function sendMessage(action, params) { +function invokeApiBg(action, params) { return new Promise((resolve, reject) => chrome.runtime.sendMessage({action, params}, resolve)); } function findTerm(text) { - return sendMessage('findTerm', {text}); + return invokeApiBg('findTerm', {text}); } function findKanji(text) { - return sendMessage('findKanji', {text}); + return invokeApiBg('findKanji', {text}); } function renderText(data, template) { - return sendMessage('renderText', {data, template}); + return invokeApiBg('renderText', {data, template}); } function canAddDefinitions(definitions, modes) { - return sendMessage('canAddDefinitions', {definitions, modes}); + return invokeApiBg('canAddDefinitions', {definitions, modes}); } function addDefinition(definition, mode) { - return sendMessage('addDefinition', {definition, mode}); + return invokeApiBg('addDefinition', {definition, mode}); } function textSourceFromPoint(point) { |