diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2022-05-21 15:28:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-21 15:28:44 -0400 |
commit | fd00a5285651313ce96f7fd00078c4bc72c00eb2 (patch) | |
tree | 5d84f50cf1293e76844b48980f1308c93c611f0d /ext/js/background | |
parent | 10e9f7acb867194d5f79e6254b4e8695ea5a6002 (diff) |
Anki findNotes (#2152)
* Add findNotes API
* Add api.findAnkiNotes
Diffstat (limited to 'ext/js/background')
-rw-r--r-- | ext/js/background/backend.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index 66f80351..b25b6033 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -129,7 +129,8 @@ class Backend { ['triggerDatabaseUpdated', {async: false, contentScript: true, handler: this._onApiTriggerDatabaseUpdated.bind(this)}], ['testMecab', {async: true, contentScript: true, handler: this._onApiTestMecab.bind(this)}], ['textHasJapaneseCharacters', {async: false, contentScript: true, handler: this._onApiTextHasJapaneseCharacters.bind(this)}], - ['getTermFrequencies', {async: true, contentScript: true, handler: this._onApiGetTermFrequencies.bind(this)}] + ['getTermFrequencies', {async: true, contentScript: true, handler: this._onApiGetTermFrequencies.bind(this)}], + ['findAnkiNotes', {async: true, contentScript: true, handler: this._onApiFindAnkiNotes.bind(this)}] ]); this._messageHandlersWithProgress = new Map([ ]); @@ -752,6 +753,10 @@ class Backend { return await this._translator.getTermFrequencies(termReadingList, dictionaries); } + async _onApiFindAnkiNotes({query}) { + return await this._anki.findNotes(query); + } + // Command handlers async _onCommandOpenSearchPage(params) { |