From 2b749d6a3b89e33d39608321b306b03291beecd3 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 26 Jul 2022 01:04:36 +0200 Subject: [PATCH] fix set-extension-mode commands --- src/common/mixins/ComputeActionsMixin.js | 4 ++-- src/ext/conf/ActionList.js | 4 ++-- src/ext/conf/ExtensionConf.ts | 10 +++++----- src/popup/js/ExecAction.ts | 6 +++--- src/popup/panels/DefaultSettingsPanel.vue | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/common/mixins/ComputeActionsMixin.js b/src/common/mixins/ComputeActionsMixin.js index 0e4acf7..0380770 100644 --- a/src/common/mixins/ComputeActionsMixin.js +++ b/src/common/mixins/ComputeActionsMixin.js @@ -10,7 +10,7 @@ export default { }) || []; }, extensionActions: function(){ - return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ExtensionMode') || []; + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-extension-mode') || []; }, aardActions: function(){ return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-autoar-mode') || []; @@ -34,4 +34,4 @@ export default { return this.scopeActions.filter(x => x.cmd.length > 1) || []; } } -} \ No newline at end of file +} diff --git a/src/ext/conf/ActionList.js b/src/ext/conf/ActionList.js index 11a0243..efa73f3 100644 --- a/src/ext/conf/ActionList.js +++ b/src/ext/conf/ActionList.js @@ -179,7 +179,7 @@ var ActionList = { page: true, } }, - 'set-ExtensionMode': { + 'set-extension-mode': { name: 'Set extension mode', args: [{ name: 'Enable', @@ -259,4 +259,4 @@ var ActionList = { } }; -export default ActionList; \ No newline at end of file +export default ActionList; diff --git a/src/ext/conf/ExtensionConf.ts b/src/ext/conf/ExtensionConf.ts index e5eca49..c675a7b 100644 --- a/src/ext/conf/ExtensionConf.ts +++ b/src/ext/conf/ExtensionConf.ts @@ -782,7 +782,7 @@ const ExtensionConf: SettingsInterface = { name: 'Enable extension', label: 'Enable', cmd: [{ - action: 'set-ExtensionMode', + action: 'set-extension-mode', arg: ExtensionMode.Enabled, persistent: true, }], @@ -798,7 +798,7 @@ const ExtensionConf: SettingsInterface = { name: 'Enable extension on whitelisted sites only', label: 'On whitelist only', cmd: [{ - action: 'set-ExtensionMode', + action: 'set-extension-mode', arg: ExtensionMode.Whitelist, persistent: true, }], @@ -811,7 +811,7 @@ const ExtensionConf: SettingsInterface = { name: 'Extension mode: use default settings', label: 'Default', cmd: [{ - action: 'set-ExtensionMode', + action: 'set-extension-mode', arg: ExtensionMode.Default, persistent: true, }], @@ -824,7 +824,7 @@ const ExtensionConf: SettingsInterface = { name: 'Disable extension', label: 'Disable', cmd: [{ - action: 'set-ExtensionMode', + action: 'set-extension-mode', arg: ExtensionMode.Disabled, persistent: true, }], @@ -1250,4 +1250,4 @@ const ExtensionConf: SettingsInterface = { } } -export default ExtensionConf; \ No newline at end of file +export default ExtensionConf; diff --git a/src/popup/js/ExecAction.ts b/src/popup/js/ExecAction.ts index 3b5f31f..0fefe5b 100644 --- a/src/popup/js/ExecAction.ts +++ b/src/popup/js/ExecAction.ts @@ -4,7 +4,7 @@ import Settings from '../../ext/lib/Settings'; class ExecAction { settings: Settings; site: any; - + constructor(settings, site) { this.settings = settings; this.site = site; @@ -35,7 +35,7 @@ class ExecAction { // it's important to do that BEFORE the save step if (cmd.action === 'set-ar-persistence') { // even when setting global defaults, we only send message to the current tab in - // order to avoid problems related to + // order to avoid problems related to const message = { forwardToActive: true, targetFrame: frame, @@ -63,7 +63,7 @@ class ExecAction { this.settings.active.sites[site].stretch = cmd.arg; } else if (cmd.action === "set-alignment") { this.settings.active.sites[site].videoAlignment = cmd.arg; - } else if (cmd.action === "set-ExtensionMode") { + } else if (cmd.action === "set-extension-mode") { this.settings.active.sites[site].mode = cmd.arg; } else if (cmd.action === "set-autoar-mode") { this.settings.active.sites[site].autoar = cmd.arg; diff --git a/src/popup/panels/DefaultSettingsPanel.vue b/src/popup/panels/DefaultSettingsPanel.vue index 282c953..f2e5c11 100644 --- a/src/popup/panels/DefaultSettingsPanel.vue +++ b/src/popup/panels/DefaultSettingsPanel.vue @@ -117,7 +117,7 @@ @click.native="execAction(action)" > - +