2019-01-02 20:36:00 +01:00
|
|
|
<template>
|
2019-01-17 22:16:55 +01:00
|
|
|
<div class="w100">
|
|
|
|
<div v-if="true" class="w100">
|
2019-01-02 20:36:00 +01:00
|
|
|
<div class="label">Cropping mode:</div>
|
2019-01-03 02:07:16 +01:00
|
|
|
<div class="flex flex-row flex-wrap">
|
2019-01-02 20:36:00 +01:00
|
|
|
<template v-for="action of settings.active.actions">
|
|
|
|
<ShortcutButton v-if="action.scopes.page && action.scopes.page.show && action.cmd.length === 1 && action.cmd[0].action === 'set-ar'"
|
2019-02-13 16:15:56 +01:00
|
|
|
class="flex b3 flex-grow button"
|
2019-01-02 20:36:00 +01:00
|
|
|
:label="(action.scopes.page && action.scopes.page.label) ? action.scopes.page.label : action.label"
|
|
|
|
:shortcut="parseShortcut(action)"
|
|
|
|
@click.native="execAction(action)"
|
|
|
|
>
|
|
|
|
</ShortcutButton>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-01-17 22:16:55 +01:00
|
|
|
<div v-if="true" class="w100">
|
2019-01-02 20:36:00 +01:00
|
|
|
<div class="label">Zooming and panning</div>
|
2019-01-17 22:16:55 +01:00
|
|
|
<div class="row w100"
|
|
|
|
>
|
2019-01-02 20:36:00 +01:00
|
|
|
<!--
|
|
|
|
min, max and value need to be implemented in js as this slider
|
|
|
|
should use logarithmic scale
|
|
|
|
-->
|
2019-01-17 22:16:55 +01:00
|
|
|
<input id="_input_zoom_slider"
|
|
|
|
class="w100"
|
2019-01-02 20:36:00 +01:00
|
|
|
type="range"
|
|
|
|
step="any"
|
2019-01-03 02:07:16 +01:00
|
|
|
min="-1"
|
|
|
|
max="4"
|
|
|
|
:value="logarithmicZoom"
|
|
|
|
@input="changeZoom($event.target.value)"
|
2019-01-02 20:36:00 +01:00
|
|
|
/>
|
2019-01-17 22:16:55 +01:00
|
|
|
<div style="overflow: auto" class="flex flex-row">
|
|
|
|
<div class="flex flex-grow medium-small x-pad-1em">
|
2019-01-03 02:07:16 +01:00
|
|
|
Zoom: {{(zoom * 100).toFixed()}}%
|
2019-01-02 20:36:00 +01:00
|
|
|
</div>
|
2019-01-17 22:16:55 +01:00
|
|
|
<div class="flex flex-nogrow flex-noshrink medium-small">
|
2019-01-02 20:36:00 +01:00
|
|
|
<a class="_zoom_reset x-pad-1em" @click="resetZoom()">reset</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="m-t-0-33em w100 display-block">
|
|
|
|
<input id="_input_zoom_site_allow_pan"
|
|
|
|
type="checkbox"
|
|
|
|
/>
|
|
|
|
Pan with mouse
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-if="true">
|
|
|
|
<div class="label">Stretching mode:</div>
|
2019-01-03 02:07:16 +01:00
|
|
|
<div class="flex flex-row flex-wrap">
|
2019-01-02 20:36:00 +01:00
|
|
|
<template v-for="action of settings.active.actions">
|
|
|
|
<ShortcutButton v-if="action.scopes.page && action.scopes.page.show && action.cmd.length === 1 && action.cmd[0].action === 'set-stretch'"
|
2019-02-13 16:15:56 +01:00
|
|
|
class="flex b3 flex-grow button"
|
2019-01-02 20:36:00 +01:00
|
|
|
:label="(action.scopes.page && action.scopes.page.label) ? action.scopes.page.label : action.label"
|
|
|
|
:shortcut="parseShortcut(action)"
|
|
|
|
@click.native="execAction(action)"
|
|
|
|
>
|
|
|
|
</ShortcutButton>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-if="true">
|
|
|
|
<div class="label">Video alignment:</div>
|
2019-01-03 02:07:16 +01:00
|
|
|
<div class="flex flex-row flex-wrap">
|
2019-01-02 20:36:00 +01:00
|
|
|
<template v-for="action of settings.active.actions">
|
|
|
|
<ShortcutButton v-if="action.scopes.page && action.scopes.page.show && action.cmd.length === 1 && action.cmd[0].action === 'set-alignment'"
|
2019-01-03 02:07:16 +01:00
|
|
|
class="flex b3 button"
|
2019-01-02 20:36:00 +01:00
|
|
|
:label="(action.scopes.page && action.scopes.page.label) ? action.scopes.page.label : action.label"
|
|
|
|
:shortcut="parseShortcut(action)"
|
|
|
|
@click.native="execAction(action)"
|
|
|
|
>
|
|
|
|
</ShortcutButton>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-if="true">
|
|
|
|
<div class="label">Multi-command actions:</div>
|
2019-01-03 02:07:16 +01:00
|
|
|
<div class="flex flex-row flex-wrap">
|
2019-01-02 20:36:00 +01:00
|
|
|
<template v-for="action of settings.active.actions">
|
|
|
|
<ShortcutButton v-if="action.scopes.page && action.scopes.page.show && action.cmd.length > 1"
|
2019-01-03 02:07:16 +01:00
|
|
|
class="flex b3 button"
|
2019-01-02 20:36:00 +01:00
|
|
|
:label="(action.scopes.page && action.scopes.page.label) ? action.scopes.page.label : action.label"
|
|
|
|
:shortcut="parseShortcut(action)"
|
|
|
|
@click.native="execAction(action)"
|
|
|
|
>
|
|
|
|
</ShortcutButton>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import ExecAction from '../js/ExecAction'
|
|
|
|
import KeyboardShortcutParser from '../../common/js/KeyboardShortcutParser'
|
|
|
|
import ShortcutButton from '../../common/components/shortcut-button'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
2019-01-03 02:07:16 +01:00
|
|
|
return {
|
|
|
|
}
|
2019-01-02 20:36:00 +01:00
|
|
|
},
|
|
|
|
props: [
|
|
|
|
'settings',
|
2019-01-03 02:07:16 +01:00
|
|
|
'frame',
|
|
|
|
'zoom'
|
2019-01-02 20:36:00 +01:00
|
|
|
],
|
|
|
|
created() {
|
|
|
|
this.exec = new ExecAction(this.settings);
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
ShortcutButton,
|
|
|
|
},
|
2019-01-03 02:07:16 +01:00
|
|
|
computed: {
|
|
|
|
logarithmicZoom: function(){
|
|
|
|
return Math.log2(this.zoom);
|
|
|
|
}
|
|
|
|
},
|
2019-01-02 20:36:00 +01:00
|
|
|
methods: {
|
2019-01-20 20:36:24 +01:00
|
|
|
execAction(action) {
|
2019-01-02 20:36:00 +01:00
|
|
|
this.exec.exec(action, 'page', this.frame);
|
|
|
|
},
|
|
|
|
parseShortcut(action) {
|
|
|
|
if (! action.scopes.page.shortcut) {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
return KeyboardShortcutParser.parseShortcut(action.scopes.page.shortcut[0]);
|
|
|
|
},
|
|
|
|
resetZoom() {
|
2019-01-03 02:07:16 +01:00
|
|
|
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
|
|
|
|
);
|
2019-01-02 20:36:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2019-01-03 02:07:16 +01:00
|
|
|
.b3 {
|
|
|
|
width: 9rem;
|
|
|
|
padding-left: 0.33rem;
|
|
|
|
padding-right: 0.33rem;
|
|
|
|
}
|
2019-01-02 20:36:00 +01:00
|
|
|
</style>
|