From 8b07a23de95ded3e6af93c78ab4f7f70cc449ea0 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 15 Mar 2020 17:02:34 -0400 Subject: [PATCH] Rename context to details --- ext/bg/js/backend.js | 6 +++--- ext/mixed/js/api.js | 4 ++-- ext/mixed/js/display.js | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 1e8c979f..e7ae7026 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -455,7 +455,7 @@ class Backend { return results; } - async _onApiDefinitionAdd({definition, mode, context, optionsContext}) { + async _onApiDefinitionAdd({definition, mode, details, optionsContext}) { const options = this.getOptions(optionsContext); const templates = this.defaultAnkiFieldTemplates; @@ -468,11 +468,11 @@ class Backend { ); } - if (context && context.screenshot) { + if (details && details.screenshot) { await this._injectScreenshot( definition, options.anki.terms.fields, - context.screenshot + details.screenshot ); } diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js index 0ab07039..df6a93f5 100644 --- a/ext/mixed/js/api.js +++ b/ext/mixed/js/api.js @@ -53,8 +53,8 @@ function apiKanjiFind(text, optionsContext) { return _apiInvoke('kanjiFind', {text, optionsContext}); } -function apiDefinitionAdd(definition, mode, context, optionsContext) { - return _apiInvoke('definitionAdd', {definition, mode, context, optionsContext}); +function apiDefinitionAdd(definition, mode, details, optionsContext) { + return _apiInvoke('definitionAdd', {definition, mode, details, optionsContext}); } function apiDefinitionsAddable(definitions, modes, optionsContext) { diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 4a71efe0..8587657f 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -752,15 +752,15 @@ class Display { try { this.setSpinnerVisible(true); - const context = {}; + const details = {}; if (this.noteUsesScreenshot(mode)) { const screenshot = await this.getScreenshot(); if (screenshot) { - context.screenshot = screenshot; + details.screenshot = screenshot; } } - const noteId = await apiDefinitionAdd(definition, mode, context, this.getOptionsContext()); + const noteId = await apiDefinitionAdd(definition, mode, details, this.getOptionsContext()); if (noteId) { const index = this.definitions.indexOf(definition); const adderButton = this.adderButtonFind(index, mode);