From f0196aaf6beac57e17972c87153376bbbcdd7282 Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Mon, 22 Apr 2024 22:24:50 +0200 Subject: add profile switching keyboard shortcuts (#832) * add profile switching * add duplicate behavior dropdown (#853) * duplicate behavior dropdown * allow duplicate for existing users * Update docs/anki-integration.md Co-authored-by: James Maa Signed-off-by: StefanVukovic99 * Update docs/anki-integration.md Co-authored-by: James Maa Signed-off-by: StefanVukovic99 * Update docs/anki-integration.md Co-authored-by: James Maa Signed-off-by: StefanVukovic99 * remove suggestion comment --------- Signed-off-by: StefanVukovic99 Co-authored-by: James Maa --------- Signed-off-by: StefanVukovic99 Co-authored-by: James Maa --- ext/js/data/options-util.js | 17 ++++++++++++++++- 1 file changed, 16 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 62b062aa..5319cfe4 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -537,7 +537,8 @@ export class OptionsUtil { this._updateVersion28, this._updateVersion29, this._updateVersion30, - this._updateVersion31 + this._updateVersion31, + this._updateVersion32 ]; /* eslint-enable @typescript-eslint/unbound-method */ if (typeof targetVersion === 'number' && targetVersion < result.length) { @@ -1244,6 +1245,20 @@ export class OptionsUtil { } } + /** + * - Added profilePrevious and profileNext to hotkeys. + * @type {import('options-util').UpdateFunction} + */ + async _updateVersion32(options) { + for (const profile of options.profiles) { + profile.options.inputs.hotkeys.push( + {action: 'profilePrevious', key: 'Minus', modifiers: ['alt'], scopes: ['popup', 'search'], enabled: true}, + {action: 'profileNext', key: 'Equal', modifiers: ['alt'], scopes: ['popup', 'search'], enabled: true} + ); + } + } + + /** * @param {string} url * @returns {Promise} -- cgit v1.2.3