diff options
Diffstat (limited to 'ext/bg/js/backend.js')
| -rw-r--r-- | ext/bg/js/backend.js | 13 | 
1 files changed, 11 insertions, 2 deletions
| diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 5fdca569..1bc831e9 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -58,8 +58,8 @@ class Backend {              useCache: false          });          this._ankiNoteBuilder = new AnkiNoteBuilder({ -            audioSystem: this._audioSystem,              renderTemplate: this._renderTemplate.bind(this), +            getDefinitionAudio: this._getDefinitionAudio.bind(this),              getClipboardImage: this._onApiClipboardImageGet.bind(this),              getScreenshot: this._getScreenshot.bind(this)          }); @@ -124,7 +124,8 @@ class Backend {              ['getSettings',                  {async: false, contentScript: true,  handler: this._onApiGetSettings.bind(this)}],              ['setAllSettings',               {async: true,  contentScript: false, handler: this._onApiSetAllSettings.bind(this)}],              ['getOrCreateSearchPopup',       {async: true,  contentScript: true,  handler: this._onApiGetOrCreateSearchPopup.bind(this)}], -            ['isTabSearchPopup',             {async: true,  contentScript: true,  handler: this._onApiIsTabSearchPopup.bind(this)}] +            ['isTabSearchPopup',             {async: true,  contentScript: true,  handler: this._onApiIsTabSearchPopup.bind(this)}], +            ['getDefinitionAudio',           {async: true,  contentScript: true,  handler: this._onApiGetDefinitionAudio.bind(this)}]          ]);          this._messageHandlersWithProgress = new Map([              ['deleteDictionary',        {async: true,  contentScript: false, handler: this._onApiDeleteDictionary.bind(this)}] @@ -827,6 +828,10 @@ class Backend {          return (tab !== null);      } +    async _onApiGetDefinitionAudio({definition, sources, details}) { +        return this._getDefinitionAudio(definition, sources, details); +    } +      // Command handlers      async _onCommandSearch(params) { @@ -1631,4 +1636,8 @@ class Backend {              }          }      } + +    async _getDefinitionAudio(definition, sources, details) { +        return await this._audioSystem.getDefinitionAudio(definition, sources, details); +    }  } |