fix set-extension-mode commands

This commit is contained in:
Tamius Han 2022-07-26 01:04:36 +02:00
parent 8c403f106c
commit 2b749d6a3b
5 changed files with 13 additions and 13 deletions

View File

@ -10,7 +10,7 @@ export default {
}) || []; }) || [];
}, },
extensionActions: function(){ 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(){ aardActions: function(){
return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-autoar-mode') || []; 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) || []; return this.scopeActions.filter(x => x.cmd.length > 1) || [];
} }
} }
} }

View File

@ -179,7 +179,7 @@ var ActionList = {
page: true, page: true,
} }
}, },
'set-ExtensionMode': { 'set-extension-mode': {
name: 'Set extension mode', name: 'Set extension mode',
args: [{ args: [{
name: 'Enable', name: 'Enable',
@ -259,4 +259,4 @@ var ActionList = {
} }
}; };
export default ActionList; export default ActionList;

View File

@ -782,7 +782,7 @@ const ExtensionConf: SettingsInterface = {
name: 'Enable extension', name: 'Enable extension',
label: 'Enable', label: 'Enable',
cmd: [{ cmd: [{
action: 'set-ExtensionMode', action: 'set-extension-mode',
arg: ExtensionMode.Enabled, arg: ExtensionMode.Enabled,
persistent: true, persistent: true,
}], }],
@ -798,7 +798,7 @@ const ExtensionConf: SettingsInterface = {
name: 'Enable extension on whitelisted sites only', name: 'Enable extension on whitelisted sites only',
label: 'On whitelist only', label: 'On whitelist only',
cmd: [{ cmd: [{
action: 'set-ExtensionMode', action: 'set-extension-mode',
arg: ExtensionMode.Whitelist, arg: ExtensionMode.Whitelist,
persistent: true, persistent: true,
}], }],
@ -811,7 +811,7 @@ const ExtensionConf: SettingsInterface = {
name: 'Extension mode: use default settings', name: 'Extension mode: use default settings',
label: 'Default', label: 'Default',
cmd: [{ cmd: [{
action: 'set-ExtensionMode', action: 'set-extension-mode',
arg: ExtensionMode.Default, arg: ExtensionMode.Default,
persistent: true, persistent: true,
}], }],
@ -824,7 +824,7 @@ const ExtensionConf: SettingsInterface = {
name: 'Disable extension', name: 'Disable extension',
label: 'Disable', label: 'Disable',
cmd: [{ cmd: [{
action: 'set-ExtensionMode', action: 'set-extension-mode',
arg: ExtensionMode.Disabled, arg: ExtensionMode.Disabled,
persistent: true, persistent: true,
}], }],
@ -1250,4 +1250,4 @@ const ExtensionConf: SettingsInterface = {
} }
} }
export default ExtensionConf; export default ExtensionConf;

View File

@ -4,7 +4,7 @@ import Settings from '../../ext/lib/Settings';
class ExecAction { class ExecAction {
settings: Settings; settings: Settings;
site: any; site: any;
constructor(settings, site) { constructor(settings, site) {
this.settings = settings; this.settings = settings;
this.site = site; this.site = site;
@ -35,7 +35,7 @@ class ExecAction {
// it's important to do that BEFORE the save step // it's important to do that BEFORE the save step
if (cmd.action === 'set-ar-persistence') { if (cmd.action === 'set-ar-persistence') {
// even when setting global defaults, we only send message to the current tab in // 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 = { const message = {
forwardToActive: true, forwardToActive: true,
targetFrame: frame, targetFrame: frame,
@ -63,7 +63,7 @@ class ExecAction {
this.settings.active.sites[site].stretch = cmd.arg; this.settings.active.sites[site].stretch = cmd.arg;
} else if (cmd.action === "set-alignment") { } else if (cmd.action === "set-alignment") {
this.settings.active.sites[site].videoAlignment = cmd.arg; 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; this.settings.active.sites[site].mode = cmd.arg;
} else if (cmd.action === "set-autoar-mode") { } else if (cmd.action === "set-autoar-mode") {
this.settings.active.sites[site].autoar = cmd.arg; this.settings.active.sites[site].autoar = cmd.arg;

View File

@ -117,7 +117,7 @@
@click.native="execAction(action)" @click.native="execAction(action)"
> >
</ShortcutButton> </ShortcutButton>
</div> </div>
</div> </div>
</div> </div>
</template> </template>