From be34838dbae252619874fc53d720658c17401074 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 27 Feb 2019 23:22:15 +0100 Subject: [PATCH] Shortcut button thingy works ... ish --- .../add-edit-action-popup.vue | 92 ++++++++++--------- .../scope-settings.vue | 65 +++++++++++++ .../set-shortcut-button.vue | 56 +++++++++++ 3 files changed, 170 insertions(+), 43 deletions(-) create mode 100644 src/options/controls-settings/scope-settings-component/scope-settings.vue create mode 100644 src/options/controls-settings/scope-settings-component/set-shortcut-button.vue diff --git a/src/options/controls-settings/add-edit-action-popup.vue b/src/options/controls-settings/add-edit-action-popup.vue index 59b10c1..45e1fbd 100644 --- a/src/options/controls-settings/add-edit-action-popup.vue +++ b/src/options/controls-settings/add-edit-action-popup.vue @@ -58,49 +58,27 @@
- Scopes: + Show this action in the following tabs:
-
- Global: -
+ + + -
-
- - Show in popup - -
-
- -
-
-
-
- - Label (leave empty for default): - -
-
- -
-
-
-
- - Shortcut: - -
-
- TODO: insert shortcut changing component -
-
+ + @@ -110,11 +88,17 @@ import Stretch from '../../common/enums/stretch.enum'; import KeyboardShortcutParser from '../../common/js/KeyboardShortcutParser'; import CommandChain from './command-builder/command-chain'; import CommandAddEdit from './command-builder/command-add-edit'; +import ScopeSettings from './scope-settings-component/scope-settings'; export default { + props: { + settings: Object, + actionIndex: Number, + }, components: { CommandChain: CommandChain, CommandAddEdit: CommandAddEdit, + ScopeSettings, }, data () { return { @@ -123,6 +107,9 @@ export default { name: 'New action', label: 'New action', cmd: [], + scopes: { + + } }, addEditCommand: false, currentCmdIndex: -1, @@ -130,9 +117,28 @@ export default { }, created () { }, - props: { - settings: Object, - actionIndex: Number, + computed: { + globalScopeOptions: function() { + return { + show: this.action.scopes.global && this.action.scopes.global.show || false, + label: (this.action.scopes.global && this.action.scopes.global.label) ? this.action.scopes.global.label : '', + shortcut: this.action.scopes.global && this.action.scopes.global.shortcut + } + }, + siteScopeOptions: function() { + return { + show: this.action.scopes.site && this.action.scopes.site.show || false, + label: (this.action.scopes.site && this.action.scopes.site.label) ? this.action.scopes.site.label : '', + shortcut: this.action.scopes.site && this.action.scopes.site.shortcut + } + }, + pageScopeOptions: function() { + return { + show: this.action.scopes.page && this.action.scopes.page.show || false, + label: (this.action.scopes.page && this.action.scopes.page.label) ? this.action.scopes.page.label : '', + shortcut: this.action.scopes.page && this.action.scopes.page.shortcut + } + } }, methods: { parseActionShortcut(action) { diff --git a/src/options/controls-settings/scope-settings-component/scope-settings.vue b/src/options/controls-settings/scope-settings-component/scope-settings.vue new file mode 100644 index 0000000..36e15b3 --- /dev/null +++ b/src/options/controls-settings/scope-settings-component/scope-settings.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/options/controls-settings/scope-settings-component/set-shortcut-button.vue b/src/options/controls-settings/scope-settings-component/set-shortcut-button.vue new file mode 100644 index 0000000..d14db81 --- /dev/null +++ b/src/options/controls-settings/scope-settings-component/set-shortcut-button.vue @@ -0,0 +1,56 @@ + + + + +