aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data/options-util.js
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-04-22 22:24:50 +0200
committerGitHub <noreply@github.com>2024-04-22 20:24:50 +0000
commitf0196aaf6beac57e17972c87153376bbbcdd7282 (patch)
tree225ed467e09f8d83c02a666d419fef044621c9dd /ext/js/data/options-util.js
parentc6d93a965a5536979221fda856903356c10c1603 (diff)
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 <jmaa@berkeley.edu> Signed-off-by: StefanVukovic99 <stefanvukovic44@gmail.com> * Update docs/anki-integration.md Co-authored-by: James Maa <jmaa@berkeley.edu> Signed-off-by: StefanVukovic99 <stefanvukovic44@gmail.com> * Update docs/anki-integration.md Co-authored-by: James Maa <jmaa@berkeley.edu> Signed-off-by: StefanVukovic99 <stefanvukovic44@gmail.com> * remove suggestion comment --------- Signed-off-by: StefanVukovic99 <stefanvukovic44@gmail.com> Co-authored-by: James Maa <jmaa@berkeley.edu> --------- Signed-off-by: StefanVukovic99 <stefanvukovic44@gmail.com> Co-authored-by: James Maa <jmaa@berkeley.edu>
Diffstat (limited to 'ext/js/data/options-util.js')
-rw-r--r--ext/js/data/options-util.js17
1 files changed, 16 insertions, 1 deletions
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) {
@@ -1245,6 +1246,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<chrome.tabs.Tab>}
*/