From 7addf5a2ddd345bceb7aa0ee492ad51c25019e1a Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 9 Dec 2019 21:00:49 -0500 Subject: Add API calls for optionsGetFull and optionsSave --- ext/bg/js/backend.js | 10 ++++++++++ ext/fg/js/api.js | 8 ++++++++ 2 files changed, 18 insertions(+) (limited to 'ext') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 32b6d4e9..72802ea1 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -190,10 +190,18 @@ class Backend { return apiOptionsGet(optionsContext); } + _onApiOptionsGetFull() { + return apiOptionsGetFull(); + } + _onApiOptionsSet({changedOptions, optionsContext, source}) { return apiOptionsSet(changedOptions, optionsContext, source); } + _onApiOptionsSave({source}) { + return apiOptionsSave(source); + } + _onApiKanjiFind({text, optionsContext}) { return apiKanjiFind(text, optionsContext); } @@ -261,7 +269,9 @@ class Backend { Backend._messageHandlers = new Map([ ['optionsGet', (self, ...args) => self._onApiOptionsGet(...args)], + ['optionsGetFull', (self, ...args) => self._onApiOptionsGetFull(...args)], ['optionsSet', (self, ...args) => self._onApiOptionsSet(...args)], + ['optionsSave', (self, ...args) => self._onApiOptionsSave(...args)], ['kanjiFind', (self, ...args) => self._onApiKanjiFind(...args)], ['termsFind', (self, ...args) => self._onApiTermsFind(...args)], ['textParse', (self, ...args) => self._onApiTextParse(...args)], diff --git a/ext/fg/js/api.js b/ext/fg/js/api.js index 0e100b59..ae74b8dc 100644 --- a/ext/fg/js/api.js +++ b/ext/fg/js/api.js @@ -21,10 +21,18 @@ function apiOptionsGet(optionsContext) { return _apiInvoke('optionsGet', {optionsContext}); } +function apiOptionsGetFull() { + return _apiInvoke('optionsGetFull'); +} + function apiOptionsSet(changedOptions, optionsContext, source) { return _apiInvoke('optionsSet', {changedOptions, optionsContext, source}); } +function apiOptionsSave(source) { + return _apiInvoke('optionsSave', {source}); +} + function apiTermsFind(text, details, optionsContext) { return _apiInvoke('termsFind', {text, details, optionsContext}); } -- cgit v1.2.3