From 331a2e62941e04a4d50a21faefed663a92ddc00a Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 29 May 2022 21:24:41 -0400 Subject: Add support for guiEditNote to view notes (#2143) * Add AnkiConnect.guiEditNote * Update _onApiNoteView to first try guiEditNote * Add setting * Update noteView API * Use setting * Return which mode was used * Update DisplayGenerator * Handle errors in DisplayAnki * Update docs * Add isErrorUnsupportedAction function * Add an allowFallback option to noteView * Disambiguate * Simplify now that preferredMode isn't used * Update settings info * Implement test buttons * Update styles * Update status visibility * Wrap layout * Update description * Update date --- ext/js/data/options-util.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ext/js/data') diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 593fed29..f87bfa4b 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -467,7 +467,8 @@ class OptionsUtil { {async: false, update: this._updateVersion15.bind(this)}, {async: false, update: this._updateVersion16.bind(this)}, {async: false, update: this._updateVersion17.bind(this)}, - {async: false, update: this._updateVersion18.bind(this)} + {async: false, update: this._updateVersion18.bind(this)}, + {async: false, update: this._updateVersion19.bind(this)} ]; if (typeof targetVersion === 'number' && targetVersion < result.length) { result.splice(targetVersion); @@ -947,4 +948,13 @@ class OptionsUtil { } return options; } + + _updateVersion19(options) { + // Version 19 changes: + // Added anki.noteGuiMode. + for (const profile of options.profiles) { + profile.options.anki.noteGuiMode = 'browse'; + } + return options; + } } -- cgit v1.2.3