2021-01-21 00:21:15 +01:00
|
|
|
<template>
|
|
|
|
<div class="" style="padding-bottom: 20px">
|
2021-01-27 00:41:13 +01:00
|
|
|
<div>
|
|
|
|
<h1>Crop video:</h1>
|
|
|
|
<div class="flex flex-row flex-wrap">
|
|
|
|
<ShortcutButton v-for="(action, index) of aspectRatioActions"
|
|
|
|
class="flex b3 flex-grow button"
|
|
|
|
:key="index"
|
|
|
|
:label="(action.scopes.page && action.scopes.page.label) ? action.scopes.page.label : action.label"
|
|
|
|
:shortcut="parseShortcut(action)"
|
|
|
|
@clic.native="execAction(action)"
|
|
|
|
>
|
2021-01-21 00:21:15 +01:00
|
|
|
|
2021-01-27 00:41:13 +01:00
|
|
|
</ShortcutButton>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h1>Streth video:</h1>
|
|
|
|
<div class="flex flex-row flex-wrap">
|
2021-01-27 00:41:42 +01:00
|
|
|
<div @click="testAction()">TEST CLICK ME</div>
|
2021-01-27 00:41:13 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h1>Manual zoom:</h1>
|
|
|
|
<div class="flex flex-row flex-wrap">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h1>Video alignment:</h1>
|
|
|
|
<div class="flex flex-row flex-wrap">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-21 00:21:15 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import KeyboardShortcutParser from '../../common/js/KeyboardShortcutParser';
|
|
|
|
import ShortcutButton from '../../common/components/ShortcutButton';
|
|
|
|
import ComputeActionsMixin from '../../common/mixins/ComputeActionsMixin';
|
|
|
|
import ExecAction from '../ui-libs/ExecAction';
|
|
|
|
import BrowserDetect from '../../ext/conf/BrowserDetect';
|
2021-08-26 01:07:39 +02:00
|
|
|
import AspectRatioType from '../../common/enums/AspectRatioType.enum';
|
|
|
|
import CropModePersistence from '../../common/enums/CropModePersistence.enum';
|
2021-01-21 00:21:15 +01:00
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
scope: 'page',
|
|
|
|
CropModePersistence: CropModePersistence,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mixins: [
|
2021-01-27 00:41:13 +01:00
|
|
|
ComputeActionsMixin
|
2021-01-21 00:21:15 +01:00
|
|
|
],
|
|
|
|
props: [
|
|
|
|
'settings',
|
|
|
|
'frame',
|
|
|
|
'zoom',
|
|
|
|
'cropModePersistence',
|
|
|
|
],
|
|
|
|
created() {
|
2021-01-27 00:41:13 +01:00
|
|
|
this.exec = new ExecAction(this.settings);
|
2021-01-21 00:21:15 +01:00
|
|
|
},
|
|
|
|
components: {
|
2021-01-27 00:41:13 +01:00
|
|
|
ShortcutButton,
|
2021-01-21 00:21:15 +01:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
// logarithmicZoom: function(){
|
|
|
|
// return Math.log2(this.zoom);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async openOptionsPage() {
|
|
|
|
BrowserDetect.runtime.openOptionsPage();
|
|
|
|
},
|
|
|
|
execAction(action) {
|
2021-01-27 00:41:13 +01:00
|
|
|
this.exec.exec(action, 'page', this.frame);
|
2021-01-21 00:21:15 +01:00
|
|
|
},
|
|
|
|
parseShortcut(action) {
|
2021-01-27 00:41:13 +01:00
|
|
|
if (! action.scopes.page.shortcut) {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
return KeyboardShortcutParser.parseShortcut(action.scopes.page.shortcut[0]);
|
2021-01-21 00:21:15 +01:00
|
|
|
},
|
|
|
|
resetZoom() {
|
|
|
|
this.zoom = 1;
|
|
|
|
},
|
|
|
|
changeZoom(nz) {
|
|
|
|
nz = Math.pow(2, nz);
|
|
|
|
this.$emit('zoom-change', nz);
|
|
|
|
// this.exec.exec(
|
|
|
|
// {cmd: [{action: 'set-zoom', arg: nz}]},
|
|
|
|
// 'page',
|
|
|
|
// this.frame
|
|
|
|
// );
|
2021-01-27 00:41:42 +01:00
|
|
|
},
|
|
|
|
testAction() {
|
2021-08-26 01:07:39 +02:00
|
|
|
window.ultrawidify.videos[0].setAr({type: AspectRatioType.FitWidth});
|
2021-01-21 00:21:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.b3 {
|
|
|
|
width: 9rem;
|
|
|
|
padding-left: 0.33rem;
|
|
|
|
padding-right: 0.33rem;
|
|
|
|
}
|
|
|
|
.input-slider {
|
|
|
|
width: 480px;
|
|
|
|
}
|
|
|
|
.warning-lite {
|
|
|
|
padding-right: 16px;
|
|
|
|
padding-bottom: 16px;
|
|
|
|
padding-top: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|