diff options
Diffstat (limited to 'ext/mixed/js')
-rw-r--r-- | ext/mixed/js/api.js | 8 | ||||
-rw-r--r-- | ext/mixed/js/display.js | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js index df6a93f5..feec94df 100644 --- a/ext/mixed/js/api.js +++ b/ext/mixed/js/api.js @@ -53,12 +53,12 @@ function apiKanjiFind(text, optionsContext) { return _apiInvoke('kanjiFind', {text, optionsContext}); } -function apiDefinitionAdd(definition, mode, details, optionsContext) { - return _apiInvoke('definitionAdd', {definition, mode, details, optionsContext}); +function apiDefinitionAdd(definition, mode, context, details, optionsContext) { + return _apiInvoke('definitionAdd', {definition, mode, context, details, optionsContext}); } -function apiDefinitionsAddable(definitions, modes, optionsContext) { - return _apiInvoke('definitionsAddable', {definitions, modes, optionsContext}); +function apiDefinitionsAddable(definitions, modes, context, optionsContext) { + return _apiInvoke('definitionsAddable', {definitions, modes, context, optionsContext}); } function apiNoteView(noteId) { diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 8587657f..ecf92013 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -760,7 +760,7 @@ class Display { } } - const noteId = await apiDefinitionAdd(definition, mode, details, this.getOptionsContext()); + const noteId = await apiDefinitionAdd(definition, mode, this._getNoteContext(), details, this.getOptionsContext()); if (noteId) { const index = this.definitions.indexOf(definition); const adderButton = this.adderButtonFind(index, mode); @@ -908,7 +908,7 @@ class Display { async getDefinitionsAddable(definitions, modes) { try { - return await apiDefinitionsAddable(definitions, modes, this.getOptionsContext()); + return await apiDefinitionsAddable(definitions, modes, this._getNoteContext(), this.getOptionsContext()); } catch (e) { return []; } @@ -934,6 +934,10 @@ class Display { return (typeof key === 'string' ? (key.length === 1 ? key.toUpperCase() : key) : ''); } + _getNoteContext() { + return {}; + } + async _getAudioUri(definition, source) { const optionsContext = this.getOptionsContext(); return await apiAudioGetUri(definition, source, optionsContext); |