2018-12-30 23:16:09 +01:00
|
|
|
<template>
|
2019-09-28 00:13:50 +02:00
|
|
|
<div class="action">
|
|
|
|
<div class="flex-row action-name-cmd-container">
|
2018-12-30 23:16:09 +01:00
|
|
|
<div class="">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="flex action-name">
|
2021-02-08 23:04:54 +01:00
|
|
|
<span v-if="action.cmd && action.cmd.length > 1 || action.cmd[0].action === 'set-ar' && action.userAdded || (action.cmd[0].arg === AspectRatioType.Fixed)" class="icon red" @click="removeAction()">🗙</span>
|
2019-09-28 00:13:50 +02:00
|
|
|
<span v-else class="icon transparent">🗙</span>
|
2019-05-22 01:03:15 +02:00
|
|
|
<span class="icon" @click="editAction()">🖉</span>
|
|
|
|
{{action.name}}
|
2018-12-30 23:16:09 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-28 00:13:50 +02:00
|
|
|
<div class="command-details">
|
|
|
|
<div class="flex flex-column cmd-container cd-pad">
|
2018-12-30 23:16:09 +01:00
|
|
|
<div class="flex bold">
|
|
|
|
Command:
|
|
|
|
</div>
|
|
|
|
<div class="flex cmdlist">
|
|
|
|
{{parseCommand(action.cmd)}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- SCOPES -->
|
2019-09-28 00:13:50 +02:00
|
|
|
<div class="flex flex-column scopes-container cd-pad">
|
|
|
|
<div class="flex bold">Popup tabs:</div>
|
2018-12-30 23:16:09 +01:00
|
|
|
|
|
|
|
<!-- global scope -->
|
|
|
|
<div v-if="action.scopes.global"
|
|
|
|
class="flex flex-row scope-row"
|
|
|
|
>
|
|
|
|
<div class="flex scope-scope">
|
|
|
|
Global:
|
|
|
|
</div>
|
|
|
|
<div class="flex scope-row-label scope-visible">
|
|
|
|
Visible? <span class="scope-row-highlight">{{action.scopes.global.show ? 'Yes' : 'No'}}</span>
|
|
|
|
</div>
|
|
|
|
<div v-if="action.scopes.global.show"
|
|
|
|
class="flex scope-row-label scope-button-label"
|
|
|
|
>
|
|
|
|
Button label?
|
|
|
|
<span class="scope-row-highlight">
|
|
|
|
{{action.scopes.global.label ? action.scopes.global.label : (action.label ? action.label : '')}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="flex scope-row-label">
|
|
|
|
Keyboard shortcut:
|
|
|
|
<span class="scope-row-highlight">
|
|
|
|
{{action.scopes.global.shortcut ? parseActionShortcut(action.scopes.global.shortcut[0]) : 'None'}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- site scope -->
|
|
|
|
<div v-if="action.scopes.site"
|
|
|
|
class="flex flex-row scope-row"
|
|
|
|
>
|
|
|
|
<div class="flex scope-scope">
|
|
|
|
Site:
|
|
|
|
</div>
|
|
|
|
<div class="flex scope-row-label scope-visible">
|
|
|
|
Visible? <span class="scope-row-highlight">{{action.scopes.site.show ? 'Yes' : 'No'}}</span>
|
|
|
|
</div>
|
|
|
|
<div v-if="action.scopes.site.show"
|
|
|
|
class="flex scope-row-label scope-button-label"
|
|
|
|
>
|
|
|
|
Button label?
|
|
|
|
<span class="scope-row-highlight">
|
|
|
|
{{action.scopes.site.label ? action.scopes.site.label : (action.label ? action.label : '')}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="flex scope-row-label">
|
|
|
|
Keyboard shortcut:
|
|
|
|
<span class="scope-row-highlight">
|
|
|
|
{{action.scopes.site.shortcut ? parseActionShortcut(action.scopes.site.shortcut[0]) : 'None'}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- page scope -->
|
|
|
|
<div v-if="action.scopes.page"
|
|
|
|
class="flex flex-row scope-row"
|
|
|
|
>
|
|
|
|
<div class="flex scope-scope">
|
|
|
|
Page:
|
|
|
|
</div>
|
|
|
|
<div class="flex scope-row-label scope-visible">
|
|
|
|
Visible? <span class="scope-row-highlight">{{action.scopes.page.show ? 'Yes' : 'No'}}</span>
|
|
|
|
</div>
|
|
|
|
<div v-if="action.scopes.page.show"
|
|
|
|
class="flex scope-row-label scope-button-label"
|
|
|
|
>
|
|
|
|
Button label?
|
|
|
|
<span class="scope-row-highlight">
|
|
|
|
{{action.scopes.page.label ? action.scopes.page.label : (action.label ? action.label : '')}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="flex scope-row-label">
|
|
|
|
Keyboard shortcut:
|
|
|
|
<span class="scope-row-highlight">
|
|
|
|
{{action.scopes.page.shortcut ? parseActionShortcut(action.scopes.page.shortcut[0]) : 'None'}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-02-08 23:04:54 +01:00
|
|
|
import StretchType from '../enums/StretchType.enum';
|
|
|
|
import AspectRatioType from '../enums/AspectRatioType.enum';
|
2018-12-30 23:16:09 +01:00
|
|
|
import KeyboardShortcutParser from '../js/KeyboardShortcutParser';
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
2021-04-01 21:23:59 +02:00
|
|
|
StretchType: StretchType,
|
2019-09-28 00:13:50 +02:00
|
|
|
AspectRatio: AspectRatio,
|
2018-12-30 23:16:09 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
action: Object,
|
|
|
|
index: Number,
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
parseActionShortcut(shortcut) {
|
|
|
|
return KeyboardShortcutParser.parseShortcut(shortcut);
|
|
|
|
},
|
|
|
|
parseCommand(cmd) {
|
|
|
|
let cmdstring = '';
|
|
|
|
for (const c of cmd) {
|
|
|
|
cmdstring += `${c.action} ${c.arg}${c.persistent ? ' persistent' : ''}; `;
|
|
|
|
}
|
|
|
|
return cmdstring;
|
|
|
|
},
|
|
|
|
editAction() {
|
|
|
|
this.$emit('edit');
|
|
|
|
},
|
|
|
|
removeAction() {
|
|
|
|
this.$emit('remove');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '../../res/css/colors.scss';
|
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.uw-ultrawidify-container-root {
|
|
|
|
.action {
|
|
|
|
cursor: pointer;
|
|
|
|
position: relative;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.action .command-details {
|
|
|
|
height: 0px;
|
|
|
|
max-height: 0px;
|
|
|
|
transition: max-height 0.5s ease;
|
|
|
|
overflow: hidden;
|
|
|
|
transition: height 0.5s ease;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
width: 50%;
|
|
|
|
}
|
2019-05-22 01:03:15 +02:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.action:hover .command-details {
|
|
|
|
height: auto;
|
|
|
|
max-height: 200px;
|
|
|
|
transition: max-height 0.5s ease;
|
|
|
|
}
|
2019-05-22 01:03:15 +02:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.command-details {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
width: 50%;
|
|
|
|
}
|
2019-09-28 00:13:50 +02:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.action-name-cmd-container, .p1rem {
|
|
|
|
padding: 1rem;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.cd-pad {
|
|
|
|
padding: 0.5em;
|
|
|
|
}
|
2019-09-28 00:13:50 +02:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.action-name {
|
|
|
|
font-size: 1.5rem;
|
|
|
|
font-weight: 300;
|
|
|
|
color: $text-normal;
|
|
|
|
width: 50%;
|
|
|
|
}
|
2019-09-28 00:13:50 +02:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.action-name:hover, .action:hover .action-name {
|
|
|
|
color: lighten($primary-color, 20%);
|
|
|
|
}
|
2019-05-22 01:03:15 +02:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.red {
|
|
|
|
color: $primary-color !important;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.cmd-container {
|
|
|
|
width: 13.37rem;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.cmdlist {
|
|
|
|
font-family: 'Overpass Mono';
|
|
|
|
font-size: 0.9rem;
|
|
|
|
color: $text-dim;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.bold {
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.scope-scope {
|
|
|
|
width: 5rem;
|
|
|
|
text-align: right !important;
|
|
|
|
color: $secondary-color;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.scope-visible {
|
|
|
|
width: 7rem;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.scope-button-label {
|
|
|
|
width: 16rem;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.scope-row-label {
|
|
|
|
color: $text-dark;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.scope-row-highlight {
|
|
|
|
color: $text-normal;
|
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2020-12-12 00:38:51 +01:00
|
|
|
.transparent {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
2019-09-28 00:13:50 +02:00
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
</style>
|