Migrate pseudo-enums to typescript enums. Fix related imports & stuff

This commit is contained in:
Tamius Han 2021-02-08 23:04:54 +01:00
parent ee3ccef0e4
commit 9a864bc11c
38 changed files with 264 additions and 286 deletions

View File

@ -1,4 +1,4 @@
# Ultrawidify — aspect ratio fixer for youtube and netflix # Ultrawidify — aspect ratio fixer for youtube and netflix
## Super TL;DR: I'm just looking for the install links, thanks ## Super TL;DR: I'm just looking for the install links, thanks

View File

@ -5,7 +5,7 @@
</div> </div>
<div class="flex action-name"> <div class="flex action-name">
<span v-if="action.cmd && action.cmd.length > 1 || action.cmd[0].action === 'set-ar' && action.userAdded || (action.cmd[0].arg === AspectRatio.Fixed)" class="icon red" @click="removeAction()">🗙</span> <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>
<span v-else class="icon transparent">🗙</span> &nbsp; &nbsp; <span v-else class="icon transparent">🗙</span> &nbsp; &nbsp;
<span class="icon" @click="editAction()">🖉</span> &nbsp; &nbsp; <span class="icon" @click="editAction()">🖉</span> &nbsp; &nbsp;
{{action.name}} {{action.name}}
@ -108,8 +108,8 @@
</template> </template>
<script> <script>
import Stretch from '../enums/stretch.enum'; import StretchType from '../enums/StretchType.enum';
import AspectRatio from '../enums/aspect-ratio.enum'; import AspectRatioType from '../enums/AspectRatioType.enum';
import KeyboardShortcutParser from '../js/KeyboardShortcutParser'; import KeyboardShortcutParser from '../js/KeyboardShortcutParser';

View File

@ -46,7 +46,7 @@
</template> </template>
<script> <script>
import Stretch from '../enums/stretch.enum'; import StretchType from '../enums/StretchType.enum';
import KeyboardShortcutParser from '../js/KeyboardShortcutParser' import KeyboardShortcutParser from '../js/KeyboardShortcutParser'
export default { export default {

View File

@ -0,0 +1,7 @@
enum AntiGradientMode {
Disabled = 0,
Lax = 1,
Strict = 2
}
export default AntiGradientMode;

View File

@ -0,0 +1,11 @@
enum AspectRatioType {
Initial = -1, // page default
Reset = 0, // reset to initial
Automatic = 1, // set by Aard
FitWidth = 2, // legacy/dynamic = fit to width
FitHeight = 3, // legacy/dynamic = fit to height
Fixed = 4, // pre-determined aspect ratio
Manual = 5, // ratio achieved by zooming in/zooming out
}
export default AspectRatioType;

View File

@ -0,0 +1,9 @@
enum CropModePersistence {
Default = -1,
Disabled = 0,
UntilPageReload = 1,
CurrentSession = 2,
Forever = 3,
}
export default CropModePersistence;

View File

@ -0,0 +1,10 @@
enum ExtensionMode {
AutoDisabled = -2,
Disabled = -1,
Default = 0,
Whitelist = 1,
Basic = 2,
Enabled = 3,
};
export default ExtensionMode;

View File

@ -0,0 +1,11 @@
enum StretchType {
NoStretch = 0,
Basic = 1,
Hybrid = 2,
Conditional = 3,
Fixed = 4,
FixedSource = 5,
Default = -1
};
export default StretchType;

View File

@ -0,0 +1,8 @@
enum VideoAlignmentType {
Left = 0,
Center = 1,
Right = 2,
Default = -1
};
export default VideoAlignmentType;

View File

@ -1,7 +0,0 @@
var AntiGradientMode = Object.freeze({
Disabled: 0,
Lax: 1,
Strict: 2
});
export default AntiGradientMode;

View File

@ -1,24 +0,0 @@
var AspectRatio = Object.freeze({
Initial: -1, // page default
Reset: 0, // reset to initial
Automatic: 1, // set by Aard
FitWidth: 2, // legacy/dynamic: fit to width
FitHeight: 3, // legacy/dynamic: fit to height
Fixed: 4, // pre-determined aspect ratio
Manual: 5, // ratio achieved by zooming in/zooming out
toString: (ar) => {
switch (ar) {
case -1: return 'Initial';
case 0: return 'Reset';
case 1: return 'Automatic';
case 2: return 'FitWidth';
case 3: return 'FitHeight';
case 4: return 'Fixed';
case 5: return 'Manual';
default: return '<not an valid enum value>'
}
}
});
export default AspectRatio;

View File

@ -1,9 +0,0 @@
var CropModePersistence = Object.freeze({
Default: -1,
Disabled: 0,
UntilPageReload: 1,
CurrentSession: 2,
Forever: 3,
});
export default CropModePersistence;

View File

@ -1,19 +0,0 @@
if (process.env.CHANNEL !== 'stable') {
console.info('Loading ExtensionMode');
}
var ExtensionMode = Object.freeze({
AutoDisabled: -2,
Disabled: -1,
Default: 0,
Whitelist: 1,
Basic: 2,
Enabled: 3,
});
if (process.env.CHANNEL !== 'stable') {
console.info('Loaded ExtensionMode');
}
export default ExtensionMode;

View File

@ -1,11 +0,0 @@
var Stretch = Object.freeze({
NoStretch: 0,
Basic: 1,
Hybrid: 2,
Conditional: 3,
Fixed: 4,
FixedSource: 5,
Default: -1
});
export default Stretch;

View File

@ -1,8 +0,0 @@
var VideoAlignment = Object.freeze({
Left: 0,
Center: 1,
Right: 2,
Default: -1
});
export default VideoAlignment;

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-extension-mode') || []; return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ExtensionMode') || [];
}, },
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') || [];

View File

@ -1,27 +1,27 @@
import VideoAlignment from '../../common/enums/video-alignment.enum'; import VideoAlignmentType from '../../common/enums/VideoAlignmentType.enum';
import Stretch from '../../common/enums/stretch.enum'; import StretchType from '../../common/enums/StretchType.enum';
import ExtensionMode from '../../common/enums/extension-mode.enum'; import ExtensionMode from '../../common/enums/ExtensionMode.enum';
import AspectRatio from '../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../common/enums/AspectRatioType.enum';
import CropModePersistence from '../../common/enums/crop-mode-persistence.enum'; import CropModePersistence from '../../common/enums/CropModePersistence.enum';
var ActionList = { var ActionList = {
'set-ar': { 'set-ar': {
name: 'Set aspect ratio', name: 'Set aspect ratio',
args: [{ args: [{
name: 'Automatic', name: 'Automatic',
arg: AspectRatio.Automatic, arg: AspectRatioType.Automatic,
},{ },{
name: 'Fit width', name: 'Fit width',
arg: AspectRatio.FitWidth, arg: AspectRatioType.FitWidth,
},{ },{
name: 'Fit height', name: 'Fit height',
arg: AspectRatio.FitHeight, arg: AspectRatioType.FitHeight,
},{ },{
name: 'Reset', name: 'Reset',
arg: AspectRatio.Reset, arg: AspectRatioType.Reset,
},{ },{
name: 'Manually specify ratio', name: 'Manually specify ratio',
arg: AspectRatio.Fixed, arg: AspectRatioType.Fixed,
customArg: true, customArg: true,
customSetter: (value) => { customSetter: (value) => {
const [width, height] = value.split(':'); const [width, height] = value.split(':');
@ -70,33 +70,33 @@ var ActionList = {
name: 'Set stretch', name: 'Set stretch',
args: [{ args: [{
name: 'Normal', name: 'Normal',
arg: Stretch.NoStretch arg: StretchType.NoStretch
},{ },{
name: 'Basic', name: 'Basic',
arg: Stretch.Basic, arg: StretchType.Basic,
},{ },{
name: 'Hybrid', name: 'Hybrid',
arg: Stretch.Hybrid, arg: StretchType.Hybrid,
},{ },{
name: 'Thin borders', name: 'Thin borders',
arg: Stretch.Conditional, arg: StretchType.Conditional,
},{ },{
name: 'Fixed (source)', name: 'Fixed (source)',
arg: Stretch.FixedSource, arg: StretchType.FixedSource,
customArg: true, customArg: true,
scopes: { scopes: {
page: true, page: true,
} }
},{ },{
name: 'Fixed (displayed)', name: 'Fixed (displayed)',
arg: Stretch.Fixed, arg: StretchType.Fixed,
customArg: true, customArg: true,
scopes: { scopes: {
page: true, page: true,
} }
},{ },{
name: 'Default', name: 'Default',
arg: Stretch.Default, arg: StretchType.Default,
scopes: { scopes: {
site: true site: true
} }
@ -111,16 +111,16 @@ var ActionList = {
name: 'Set video alignment', name: 'Set video alignment',
args: [{ args: [{
name: 'Left', name: 'Left',
arg: VideoAlignment.Left, arg: VideoAlignmentType.Left,
},{ },{
name: 'Center', name: 'Center',
arg: VideoAlignment.Center, arg: VideoAlignmentType.Center,
},{ },{
name: 'Right', name: 'Right',
arg: VideoAlignment.Right arg: VideoAlignmentType.Right
},{ },{
name: 'Default', name: 'Default',
arg: VideoAlignment.Default, arg: VideoAlignmentType.Default,
scopes: { scopes: {
site: true, site: true,
} }
@ -179,7 +179,7 @@ var ActionList = {
page: true, page: true,
} }
}, },
'set-extension-mode': { 'set-ExtensionMode': {
name: 'Set extension mode', name: 'Set extension mode',
args: [{ args: [{
name: 'Enable', name: 'Enable',

View File

@ -1,8 +1,8 @@
// How to use: // How to use:
// version: {ExtensionConf object, but only properties that get overwritten} // version: {ExtensionConf object, but only properties that get overwritten}
import Stretch from '../../common/enums/stretch.enum'; import StretchType from '../../common/enums/StretchType.enum';
import ExtensionMode from '../../common/enums/extension-mode.enum'; import ExtensionMode from '../../common/enums/ExtensionMode.enum';
import VideoAlignment from '../../common/enums/video-alignment.enum'; import VideoAlignmentType from '../../common/enums/VideoAlignmentType.enum';
const ExtensionConfPatch = [ const ExtensionConfPatch = [
{ {
@ -267,7 +267,7 @@ const ExtensionConfPatch = [
label: '4:3 stretch (src)', label: '4:3 stretch (src)',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.FixedSource, arg: StretchType.FixedSource,
customArg: 1.33, customArg: 1.33,
}], }],
scopes: { scopes: {
@ -284,7 +284,7 @@ const ExtensionConfPatch = [
label: '16:9 stretch (src)', label: '16:9 stretch (src)',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.FixedSource, arg: StretchType.FixedSource,
customArg: 1.77, customArg: 1.77,
}], }],
scopes: { scopes: {
@ -309,8 +309,8 @@ const ExtensionConfPatch = [
autoar: ExtensionMode.Enabled, autoar: ExtensionMode.Enabled,
autoarFallback: ExtensionMode.Enabled, autoarFallback: ExtensionMode.Enabled,
override: true, // ignore value localStorage in favour of this override: true, // ignore value localStorage in favour of this
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
DOM: { DOM: {
player: { player: {
@ -339,8 +339,8 @@ const ExtensionConfPatch = [
autoar: ExtensionMode.Enabled, autoar: ExtensionMode.Enabled,
override: false, override: false,
type: 'community', type: 'community',
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
arPersistence: true, // persist aspect ratio between different videos arPersistence: true, // persist aspect ratio between different videos
autoarPreventConditions: { // prevents autoar on following conditions autoarPreventConditions: { // prevents autoar on following conditions

View File

@ -1,11 +1,11 @@
import Debug from './Debug'; import Debug from './Debug';
import currentBrowser from './BrowserDetect'; import currentBrowser from './BrowserDetect';
import VideoAlignment from '../../common/enums/video-alignment.enum'; import VideoAlignmentType from '../../common/enums/VideoAlignmentType.enum';
import Stretch from '../../common/enums/stretch.enum'; import StretchType from '../../common/enums/StretchType.enum';
import ExtensionMode from '../../common/enums/extension-mode.enum'; import ExtensionMode from '../../common/enums/ExtensionMode.enum';
import AntiGradientMode from '../../common/enums/anti-gradient-mode.enum'; import AntiGradientMode from '../../common/enums/AntiGradientMode.enum';
import AspectRatio from '../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../common/enums/AspectRatioType.enum';
import CropModePersistence from '../../common/enums/crop-mode-persistence.enum'; import CropModePersistence from '../../common/enums/CropModePersistence.enum';
if(Debug.debug) if(Debug.debug)
console.log("Loading: ExtensionConf.js"); console.log("Loading: ExtensionConf.js");
@ -176,7 +176,7 @@ var ExtensionConf = {
label: 'Automatic', // name displayed in ui (can be overridden in scope/playerUi) label: 'Automatic', // name displayed in ui (can be overridden in scope/playerUi)
cmd: [{ cmd: [{
action: 'set-ar', action: 'set-ar',
arg: AspectRatio.Automatic, arg: AspectRatioType.Automatic,
persistent: false, // optional, false by default. If true, change doesn't take effect immediately. persistent: false, // optional, false by default. If true, change doesn't take effect immediately.
// Instead, this action saves stuff to settings // Instead, this action saves stuff to settings
}], }],
@ -211,7 +211,7 @@ var ExtensionConf = {
label: 'Reset', label: 'Reset',
cmd: [{ cmd: [{
action: 'set-ar', action: 'set-ar',
arg: AspectRatio.Reset, arg: AspectRatioType.Reset,
}], }],
scopes: { scopes: {
page: { page: {
@ -237,7 +237,7 @@ var ExtensionConf = {
label: 'Fit width', label: 'Fit width',
cmd: [{ cmd: [{
action: 'set-ar', action: 'set-ar',
arg: AspectRatio.FitWidth, arg: AspectRatioType.FitWidth,
}], }],
scopes: { scopes: {
page: { page: {
@ -263,7 +263,7 @@ var ExtensionConf = {
label: 'Fit height', label: 'Fit height',
cmd: [{ cmd: [{
action: 'set-ar', action: 'set-ar',
arg: AspectRatio.FitHeight arg: AspectRatioType.FitHeight
}], }],
scopes: { scopes: {
page: { page: {
@ -290,7 +290,7 @@ var ExtensionConf = {
label: '16:9', label: '16:9',
cmd: [{ cmd: [{
action: 'set-ar', action: 'set-ar',
arg: AspectRatio.Fixed, arg: AspectRatioType.Fixed,
customArg: 1.78, customArg: 1.78,
}], }],
scopes: { scopes: {
@ -318,7 +318,7 @@ var ExtensionConf = {
label: '21:9', label: '21:9',
cmd: [{ cmd: [{
action: 'set-ar', action: 'set-ar',
arg: AspectRatio.Fixed, arg: AspectRatioType.Fixed,
customArg: 2.39 customArg: 2.39
}], }],
scopes: { scopes: {
@ -346,7 +346,7 @@ var ExtensionConf = {
label: '18:9', label: '18:9',
cmd: [{ cmd: [{
action: 'set-ar', action: 'set-ar',
arg: AspectRatio.Fixed, arg: AspectRatioType.Fixed,
customArg: 2.0, customArg: 2.0,
}], }],
scopes: { scopes: {
@ -547,7 +547,7 @@ var ExtensionConf = {
label: 'Don\'t stretch', label: 'Don\'t stretch',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.NoStretch, arg: StretchType.NoStretch,
}], }],
scopes: { scopes: {
global: { global: {
@ -572,7 +572,7 @@ var ExtensionConf = {
label: 'Basic stretch', label: 'Basic stretch',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.Basic, arg: StretchType.Basic,
}], }],
scopes: { scopes: {
global: { global: {
@ -597,7 +597,7 @@ var ExtensionConf = {
label: 'Hybrid stretch', label: 'Hybrid stretch',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.Hybrid, arg: StretchType.Hybrid,
}], }],
scopes: { scopes: {
global: { global: {
@ -622,7 +622,7 @@ var ExtensionConf = {
label: 'Thin borders only', label: 'Thin borders only',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.Conditional, arg: StretchType.Conditional,
}], }],
scopes: { scopes: {
global: { global: {
@ -647,7 +647,7 @@ var ExtensionConf = {
label: 'Default', label: 'Default',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.Default, arg: StretchType.Default,
}], }],
scopes: { scopes: {
site: { site: {
@ -660,7 +660,7 @@ var ExtensionConf = {
label: '4:3 stretch (src)', label: '4:3 stretch (src)',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.FixedSource, arg: StretchType.FixedSource,
customArg: 1.33, customArg: 1.33,
}], }],
scopes: { scopes: {
@ -677,7 +677,7 @@ var ExtensionConf = {
label: '16:9 stretch (src)', label: '16:9 stretch (src)',
cmd: [{ cmd: [{
action: 'set-stretch', action: 'set-stretch',
arg: Stretch.FixedSource, arg: StretchType.FixedSource,
customArg: 1.77, customArg: 1.77,
}], }],
scopes: { scopes: {
@ -698,7 +698,7 @@ var ExtensionConf = {
label: 'Left', label: 'Left',
cmd: [{ cmd: [{
action: 'set-alignment', action: 'set-alignment',
arg: VideoAlignment.Left, arg: VideoAlignmentType.Left,
}], }],
scopes: { scopes: {
global: { global: {
@ -720,7 +720,7 @@ var ExtensionConf = {
label: 'Center', label: 'Center',
cmd: [{ cmd: [{
action: 'set-alignment', action: 'set-alignment',
arg: VideoAlignment.Center, arg: VideoAlignmentType.Center,
}], }],
scopes: { scopes: {
global: { global: {
@ -742,7 +742,7 @@ var ExtensionConf = {
label: 'Right', label: 'Right',
cmd: [{ cmd: [{
action: 'set-alignment', action: 'set-alignment',
arg: VideoAlignment.Right arg: VideoAlignmentType.Right
}], }],
scopes: { scopes: {
global: { global: {
@ -764,7 +764,7 @@ var ExtensionConf = {
label: 'Default', label: 'Default',
cmd: [{ cmd: [{
action: 'set-alignment', action: 'set-alignment',
arg: VideoAlignment.Default arg: VideoAlignmentType.Default
}], }],
scopes: { scopes: {
site: { site: {
@ -780,7 +780,7 @@ var ExtensionConf = {
name: 'Enable extension', name: 'Enable extension',
label: 'Enable', label: 'Enable',
cmd: [{ cmd: [{
action: 'set-extension-mode', action: 'set-ExtensionMode',
arg: ExtensionMode.Enabled, arg: ExtensionMode.Enabled,
persistent: true, persistent: true,
}], }],
@ -796,7 +796,7 @@ var ExtensionConf = {
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-extension-mode', action: 'set-ExtensionMode',
arg: ExtensionMode.Whitelist, arg: ExtensionMode.Whitelist,
persistent: true, persistent: true,
}], }],
@ -809,7 +809,7 @@ var ExtensionConf = {
name: 'Extension mode: use default settings', name: 'Extension mode: use default settings',
label: 'Default', label: 'Default',
cmd: [{ cmd: [{
action: 'set-extension-mode', action: 'set-ExtensionMode',
arg: ExtensionMode.Default, arg: ExtensionMode.Default,
persistent: true, persistent: true,
}], }],
@ -822,7 +822,7 @@ var ExtensionConf = {
name: 'Disable extension', name: 'Disable extension',
label: 'Disable', label: 'Disable',
cmd: [{ cmd: [{
action: 'set-extension-mode', action: 'set-ExtensionMode',
arg: ExtensionMode.Disabled, arg: ExtensionMode.Disabled,
persistent: true, persistent: true,
}], }],
@ -1006,8 +1006,8 @@ var ExtensionConf = {
autoarFallback: currentBrowser.firefox ? // if autoAr fails, try fallback mode? autoarFallback: currentBrowser.firefox ? // if autoAr fails, try fallback mode?
ExtensionMode.Enabled : // Options same as in autoar. ExtensionMode.Enabled : // Options same as in autoar.
ExtensionMode.Disabled, // if autoar is disabled, this setting is irrelevant ExtensionMode.Disabled, // if autoar is disabled, this setting is irrelevant
stretch: Stretch.NoStretch, // Default stretch mode. stretch: StretchType.NoStretch, // Default stretch mode.
videoAlignment: VideoAlignment.Center, // Video alignment videoAlignment: VideoAlignmentType.Center, // Video alignment
keyboardShortcutsEnabled: ExtensionMode.Enabled, keyboardShortcutsEnabled: ExtensionMode.Enabled,
}, },
"www.youtube.com" : { "www.youtube.com" : {
@ -1017,8 +1017,8 @@ var ExtensionConf = {
override: false, // ignore value localStorage in favour of this override: false, // ignore value localStorage in favour of this
type: 'official', // is officially supported? (Alternatives are 'community' and 'user-defined') type: 'official', // is officially supported? (Alternatives are 'community' and 'user-defined')
actions: null, // overrides global keyboard shortcuts and button configs. Is array, is optional. actions: null, // overrides global keyboard shortcuts and button configs. Is array, is optional.
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
DOM: { DOM: {
player: { player: {
@ -1035,8 +1035,8 @@ var ExtensionConf = {
autoar: ExtensionMode.Enabled, autoar: ExtensionMode.Enabled,
override: false, override: false,
type: 'official', type: 'official',
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
arPersistence: true, // persist aspect ratio between different videos arPersistence: true, // persist aspect ratio between different videos
"DOM": { "DOM": {
@ -1054,8 +1054,8 @@ var ExtensionConf = {
autoar: ExtensionMode.Enabled, autoar: ExtensionMode.Enabled,
override: false, override: false,
type: 'community', type: 'community',
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
arPersistence: true, // persist aspect ratio between different videos arPersistence: true, // persist aspect ratio between different videos
DOM: { DOM: {
@ -1074,8 +1074,8 @@ var ExtensionConf = {
autoar: ExtensionMode.Enabled, autoar: ExtensionMode.Enabled,
override: true, override: true,
type: 'official', type: 'official',
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
DOM: { DOM: {
player: { player: {
@ -1117,8 +1117,8 @@ var ExtensionConf = {
autoar:ExtensionMode.Enabled, autoar:ExtensionMode.Enabled,
override: false, override: false,
type: 'testing', type: 'testing',
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
DOM: { DOM: {
player: { player: {
@ -1134,8 +1134,8 @@ var ExtensionConf = {
autoar: ExtensionMode.Enabled, autoar: ExtensionMode.Enabled,
override: false, override: false,
type: 'testing', type: 'testing',
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
DOM: { DOM: {
player: { player: {

View File

@ -1,6 +1,6 @@
import Debug from '../conf/Debug'; import Debug from '../conf/Debug';
import PlayerData from './video-data/PlayerData'; import PlayerData from './video-data/PlayerData';
import ExtensionMode from '../../common/enums/extension-mode.enum'; import ExtensionMode from '../../common/enums/ExtensionMode.enum';
if(process.env.CHANNEL !== 'stable'){ if(process.env.CHANNEL !== 'stable'){
console.info("Loading ActionHandler"); console.info("Loading ActionHandler");
@ -275,7 +275,7 @@ class ActionHandler {
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-extension-mode") { } else if (cmd.action === "set-ExtensionMode") {
this.settings.active.sites[site].status = cmd.arg; this.settings.active.sites[site].status = cmd.arg;
} else if (cmd.action === "set-autoar-mode") { } else if (cmd.action === "set-autoar-mode") {
this.settings.active.sites[site].arStatus = cmd.arg; this.settings.active.sites[site].arStatus = cmd.arg;

View File

@ -1,12 +1,12 @@
import Debug from '../conf/Debug'; import Debug from '../conf/Debug';
import currentBrowser from '../conf/BrowserDetect'; import currentBrowser from '../conf/BrowserDetect';
import ExtensionConf from '../conf/ExtensionConf'; import ExtensionConf from '../conf/ExtensionConf';
import ExtensionMode from '../../common/enums/extension-mode.enum'; import ExtensionMode from '../../common/enums/ExtensionMode.enum';
import ObjectCopy from '../lib/ObjectCopy'; import ObjectCopy from '../lib/ObjectCopy';
import Stretch from '../../common/enums/stretch.enum'; import StretchType from '../../common/enums/StretchType.enum';
import VideoAlignment from '../../common/enums/video-alignment.enum'; import VideoAlignmentType from '../../common/enums/VideoAlignmentType.enum';
import ExtensionConfPatch from '../conf/ExtConfPatches'; import ExtensionConfPatch from '../conf/ExtConfPatches';
import CropModePersistence from '../../common/enums/crop-mode-persistence.enum'; import CropModePersistence from '../../common/enums/CropModePersistence.enum';
import BrowserDetect from '../conf/BrowserDetect'; import BrowserDetect from '../conf/BrowserDetect';
if(process.env.CHANNEL !== 'stable'){ if(process.env.CHANNEL !== 'stable'){
@ -301,10 +301,10 @@ class Settings {
sites[site].autoar = ExtensionMode.Default; sites[site].autoar = ExtensionMode.Default;
} }
if (sites[site].stretch === undefined) { if (sites[site].stretch === undefined) {
sites[site].stretch = Stretch.Default; sites[site].stretch = StretchType.Default;
} }
if (sites[site].videoAlignment === undefined) { if (sites[site].videoAlignment === undefined) {
sites[site].videoAlignment = VideoAlignment.Default; sites[site].videoAlignment = VideoAlignmentType.Default;
} }
if (sites[site].keyboardShortcutsEnabled === undefined) { if (sites[site].keyboardShortcutsEnabled === undefined) {
sites[site].keyboardShortcutsEnabled = ExtensionMode.Default; sites[site].keyboardShortcutsEnabled = ExtensionMode.Default;
@ -544,8 +544,8 @@ class Settings {
mode: ExtensionMode.Default, mode: ExtensionMode.Default,
autoar: ExtensionMode.Default, autoar: ExtensionMode.Default,
autoarFallback: ExtensionMode.Default, autoarFallback: ExtensionMode.Default,
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
}; };
if (!option || allDefault[option] === undefined) { if (!option || allDefault[option] === undefined) {
@ -565,7 +565,7 @@ class Settings {
} }
getDefaultStretchMode(site) { getDefaultStretchMode(site) {
if (site && (this.active.sites[site]?.stretch ?? Stretch.Default) !== Stretch.Default) { if (site && (this.active.sites[site]?.stretch ?? StretchType.Default) !== StretchType.Default) {
return this.active.sites[site].stretch; return this.active.sites[site].stretch;
} }
@ -573,7 +573,7 @@ class Settings {
} }
getDefaultCropPersistenceMode(site) { getDefaultCropPersistenceMode(site) {
if (site && (this.active.sites[site]?.cropModePersistence ?? Stretch.Default) !== Stretch.Default) { if (site && (this.active.sites[site]?.cropModePersistence ?? StretchType.Default) !== StretchType.Default) {
return this.active.sites[site].cropModePersistence; return this.active.sites[site].cropModePersistence;
} }
@ -582,7 +582,7 @@ class Settings {
} }
getDefaultVideoAlignment(site) { getDefaultVideoAlignment(site) {
if ( (this.active.sites[site]?.videoAlignment ?? VideoAlignment.Default) !== VideoAlignment.Default) { if ( (this.active.sites[site]?.videoAlignment ?? VideoAlignmentType.Default) !== VideoAlignmentType.Default) {
return this.active.sites[site].videoAlignment; return this.active.sites[site].videoAlignment;
} }

View File

@ -6,8 +6,8 @@ import EdgeDetectPrimaryDirection from './edge-detect/enums/EdgeDetectPrimaryDir
import EdgeDetectQuality from './edge-detect/enums/EdgeDetectQualityEnum'; import EdgeDetectQuality from './edge-detect/enums/EdgeDetectQualityEnum';
import GuardLine from './GuardLine'; import GuardLine from './GuardLine';
// import DebugCanvas from './DebugCanvas'; // import DebugCanvas from './DebugCanvas';
import VideoAlignment from '../../../common/enums/video-alignment.enum'; import VideoAlignmentType from '../../../common/enums/VideoAlignmentType.enum';
import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
import {sleep} from '../../lib/Util'; import {sleep} from '../../lib/Util';
import BrowserDetect from '../../conf/BrowserDetect'; import BrowserDetect from '../../conf/BrowserDetect';
@ -187,7 +187,7 @@ class ArDetector {
this.resetBlackLevel(); this.resetBlackLevel();
// if we're restarting ArDetect, we need to do this in order to force-recalculate aspect ratio // if we're restarting ArDetect, we need to do this in order to force-recalculate aspect ratio
this.conf.resizer.setLastAr({type: AspectRatio.Automatic, ratio: this.getDefaultAr()}); this.conf.resizer.setLastAr({type: AspectRatioType.Automatic, ratio: this.getDefaultAr()});
this.canvasImageDataRowLength = cwidth << 2; this.canvasImageDataRowLength = cwidth << 2;
this.noLetterboxCanvasReset = false; this.noLetterboxCanvasReset = false;
@ -212,9 +212,9 @@ class ArDetector {
return; return;
} }
if (this.conf.resizer.lastAr.type === AspectRatio.Automatic) { if (this.conf.resizer.lastAr.type === AspectRatioType.Automatic) {
// ensure first autodetection will run in any case // ensure first autodetection will run in any case
this.conf.resizer.setLastAr({type: AspectRatio.Automatic, ratio: this.getDefaultAr()}); this.conf.resizer.setLastAr({type: AspectRatioType.Automatic, ratio: this.getDefaultAr()});
} }
@ -475,7 +475,7 @@ class ArDetector {
// poglejmo, če se je razmerje stranic spremenilo // poglejmo, če se je razmerje stranic spremenilo
// check if aspect ratio is changed: // check if aspect ratio is changed:
let lastAr = this.conf.resizer.getLastAr(); let lastAr = this.conf.resizer.getLastAr();
if (lastAr.type === AspectRatio.Automatic && lastAr.ratio !== null && lastAr.ratio !== undefined){ if (lastAr.type === AspectRatioType.Automatic && lastAr.ratio !== null && lastAr.ratio !== undefined){
// spremembo lahko zavrnemo samo, če uporabljamo avtomatski način delovanja in če smo razmerje stranic // spremembo lahko zavrnemo samo, če uporabljamo avtomatski način delovanja in če smo razmerje stranic
// že nastavili. // že nastavili.
// //
@ -500,7 +500,7 @@ class ArDetector {
} }
this.logger.log('info', 'debug', `%c[ArDetect::processAr] <@${this.arid}> Triggering aspect ratio change. New aspect ratio: ${trueAr}`, _ard_console_change); this.logger.log('info', 'debug', `%c[ArDetect::processAr] <@${this.arid}> Triggering aspect ratio change. New aspect ratio: ${trueAr}`, _ard_console_change);
this.conf.resizer.updateAr({type: AspectRatio.Automatic, ratio: trueAr}, {type: AspectRatio.Automatic, ratio: trueAr}); this.conf.resizer.updateAr({type: AspectRatioType.Automatic, ratio: trueAr}, {type: AspectRatioType.Automatic, ratio: trueAr});
} }
clearImageData(id) { clearImageData(id) {
@ -575,7 +575,7 @@ class ArDetector {
this.drmNotificationShown = true; this.drmNotificationShown = true;
this.conf.player.showNotification('AARD_DRM'); this.conf.player.showNotification('AARD_DRM');
this.conf.resizer.setAr({type: AspectRatio.Reset}); this.conf.resizer.setAr({type: AspectRatioType.Reset});
} }
return; return;
@ -588,9 +588,9 @@ class ArDetector {
let newCanvasWidth = window.innerHeight * (this.video.videoWidth / this.video.videoHeight); let newCanvasWidth = window.innerHeight * (this.video.videoWidth / this.video.videoHeight);
let newCanvasHeight = window.innerHeight; let newCanvasHeight = window.innerHeight;
if (this.conf.resizer.videoAlignment === VideoAlignment.Center) { if (this.conf.resizer.videoAlignment === VideoAlignmentType.Center) {
this.canvasDrawWindowHOffset = Math.round((window.innerWidth - newCanvasWidth) * 0.5); this.canvasDrawWindowHOffset = Math.round((window.innerWidth - newCanvasWidth) * 0.5);
} else if (this.conf.resizer.videoAlignment === VideoAlignment.Left) { } else if (this.conf.resizer.videoAlignment === VideoAlignmentType.Left) {
this.canvasDrawWindowHOffset = 0; this.canvasDrawWindowHOffset = 0;
} else { } else {
this.canvasDrawWindowHOffset = window.innerWidth - newCanvasWidth; this.canvasDrawWindowHOffset = window.innerWidth - newCanvasWidth;
@ -637,7 +637,7 @@ class ArDetector {
// da je letterbox izginil. // da je letterbox izginil.
// If we don't detect letterbox, we reset aspect ratio to aspect ratio of the video file. The aspect ratio could // If we don't detect letterbox, we reset aspect ratio to aspect ratio of the video file. The aspect ratio could
// have been corrected manually. It's also possible that letterbox (that was there before) disappeared. // have been corrected manually. It's also possible that letterbox (that was there before) disappeared.
this.conf.resizer.updateAr({type: AspectRatio.Automatic, ratio: this.getDefaultAr()}); this.conf.resizer.updateAr({type: AspectRatioType.Automatic, ratio: this.getDefaultAr()});
this.guardLine.reset(); this.guardLine.reset();
this.noLetterboxCanvasReset = true; this.noLetterboxCanvasReset = true;
@ -677,7 +677,7 @@ class ArDetector {
// (since the new letterbox edge isn't present in our sample due to technical // (since the new letterbox edge isn't present in our sample due to technical
// limitations) // limitations)
if (this.fallbackMode && guardLineOut.blackbarFail) { if (this.fallbackMode && guardLineOut.blackbarFail) {
this.conf.resizer.setAr({type: AspectRatio.Automatic, ratio: this.getDefaultAr()}); this.conf.resizer.setAr({type: AspectRatioType.Automatic, ratio: this.getDefaultAr()});
this.guardLine.reset(); this.guardLine.reset();
this.noLetterboxCanvasReset = true; this.noLetterboxCanvasReset = true;
@ -702,7 +702,7 @@ class ArDetector {
if(guardLineOut.blackbarFail){ if(guardLineOut.blackbarFail){
this.logger.log('info', 'arDetect', `[ArDetect::frameCheck] Detected blackbar violation and pillarbox. Resetting to default aspect ratio.`); this.logger.log('info', 'arDetect', `[ArDetect::frameCheck] Detected blackbar violation and pillarbox. Resetting to default aspect ratio.`);
this.conf.resizer.setAr({type: AspectRatio.Automatic, ratio: this.getDefaultAr()}); this.conf.resizer.setAr({type: AspectRatioType.Automatic, ratio: this.getDefaultAr()});
this.guardLine.reset(); this.guardLine.reset();
} }
@ -774,7 +774,7 @@ class ArDetector {
// WE DO NOT RESET ASPECT RATIO HERE IN CASE OF PROBLEMS, CAUSES UNWARRANTED RESETS: // WE DO NOT RESET ASPECT RATIO HERE IN CASE OF PROBLEMS, CAUSES UNWARRANTED RESETS:
// (eg. here: https://www.youtube.com/watch?v=nw5Z93Yt-UQ&t=410) // (eg. here: https://www.youtube.com/watch?v=nw5Z93Yt-UQ&t=410)
// //
// this.conf.resizer.setAr({type: AspectRatio.Automatic, ratio: this.getDefaultAr()}); // this.conf.resizer.setAr({type: AspectRatioType.Automatic, ratio: this.getDefaultAr()});
} }
this.clearImageData(imageData); this.clearImageData(imageData);

View File

@ -2,7 +2,7 @@ import Debug from '../../../conf/Debug';
import EdgeStatus from './enums/EdgeStatusEnum'; import EdgeStatus from './enums/EdgeStatusEnum';
import EdgeDetectQuality from './enums/EdgeDetectQualityEnum'; import EdgeDetectQuality from './enums/EdgeDetectQualityEnum';
import EdgeDetectPrimaryDirection from './enums/EdgeDetectPrimaryDirectionEnum'; import EdgeDetectPrimaryDirection from './enums/EdgeDetectPrimaryDirectionEnum';
import AntiGradientMode from '../../../../common/enums/anti-gradient-mode.enum'; import AntiGradientMode from '../../../../common/enums/AntiGradientMode.enum';
if (Debug.debug) { if (Debug.debug) {
console.log("Loading EdgeDetect.js"); console.log("Loading EdgeDetect.js");

View File

@ -1,8 +1,8 @@
import Debug from '../../conf/Debug'; import Debug from '../../conf/Debug';
import VideoData from './VideoData'; import VideoData from './VideoData';
import RescanReason from './enums/RescanReason'; import RescanReason from './enums/RescanReason';
import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
import CropModePersistence from '../../../common/enums/crop-mode-persistence.enum'; import CropModePersistence from '../../../common/enums/CropModePersistence.enum';
if (process.env.CHANNEL !== 'stable'){ if (process.env.CHANNEL !== 'stable'){
console.info("Loading PageInfo"); console.info("Loading PageInfo");
@ -414,7 +414,7 @@ class PageInfo {
setAr(ar, playingOnly){ setAr(ar, playingOnly){
this.logger.log('info', 'debug', '[PageInfo::setAr] aspect ratio:', ar, "playing only?", playingOnly) this.logger.log('info', 'debug', '[PageInfo::setAr] aspect ratio:', ar, "playing only?", playingOnly)
if (ar.type !== AspectRatio.Automatic) { if (ar.type !== AspectRatioType.Automatic) {
this.stopArDetection(playingOnly); this.stopArDetection(playingOnly);
} else { } else {
this.logger.log('info', 'debug', '[PageInfo::setAr] aspect ratio is auto'); this.logger.log('info', 'debug', '[PageInfo::setAr] aspect ratio is auto');
@ -434,7 +434,7 @@ class PageInfo {
} }
// TODO: find a way to only change aspect ratio for one video // TODO: find a way to only change aspect ratio for one video
if (ar === AspectRatio.Reset) { if (ar === AspectRatioType.Reset) {
for (var vd of this.videos) { for (var vd of this.videos) {
if (!playingOnly || vd.isPlaying()) { if (!playingOnly || vd.isPlaying()) {
vd.resetAr(); vd.resetAr();

View File

@ -1,6 +1,6 @@
import Debug from '../../conf/Debug'; import Debug from '../../conf/Debug';
import ExtensionMode from '../../../common/enums/extension-mode.enum' import ExtensionMode from '../../../common/enums/ExtensionMode.enum'
import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
import PlayerNotificationUi from '../uwui/PlayerNotificationUI'; import PlayerNotificationUi from '../uwui/PlayerNotificationUI';
import PlayerUi from '../uwui/PlayerUI'; import PlayerUi from '../uwui/PlayerUI';
import BrowserDetect from '../../conf/BrowserDetect'; import BrowserDetect from '../../conf/BrowserDetect';

View File

@ -2,7 +2,7 @@ import Debug from '../../conf/Debug';
import PlayerData from './PlayerData'; import PlayerData from './PlayerData';
import Resizer from '../video-transform/Resizer'; import Resizer from '../video-transform/Resizer';
import ArDetector from '../ar-detect/ArDetector'; import ArDetector from '../ar-detect/ArDetector';
import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
import * as _ from 'lodash'; import * as _ from 'lodash';
import BrowserDetect from '../../conf/BrowserDetect'; import BrowserDetect from '../../conf/BrowserDetect';
import Logger from '../Logger'; import Logger from '../Logger';
@ -570,7 +570,7 @@ class VideoData {
return; return;
} }
if (ar.type === AspectRatio.Fixed || ar.type === AspectRatio.FitHeight || ar.type === AspectRatio.FitHeight) { if (ar.type === AspectRatioType.Fixed || ar.type === AspectRatioType.FitHeight || ar.type === AspectRatioType.FitHeight) {
this.player.forceRefreshPlayerElement(); this.player.forceRefreshPlayerElement();
} }

View File

@ -3,11 +3,11 @@ import Scaler from './Scaler';
import Stretcher from './Stretcher'; import Stretcher from './Stretcher';
import Zoom from './Zoom'; import Zoom from './Zoom';
import PlayerData from '../video-data/PlayerData'; import PlayerData from '../video-data/PlayerData';
import ExtensionMode from '../../../common/enums/extension-mode.enum'; import ExtensionMode from '../../../common/enums/ExtensionMode.enum';
import Stretch from '../../../common/enums/stretch.enum'; import StretchType from '../../../common/enums/StretchType.enum';
import VideoAlignment from '../../../common/enums/video-alignment.enum'; import VideoAlignmentType from '../../../common/enums/VideoAlignmentType.enum';
import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
import CropModePersistance from '../../../common/enums/crop-mode-persistence.enum'; import CropModePersistance from '../../../common/enums/CropModePersistence.enum';
import { sleep } from '../Util'; import { sleep } from '../Util';
import Logger from '../Logger'; import Logger from '../Logger';
import Settings from '../Settings'; import Settings from '../Settings';
@ -43,7 +43,7 @@ class Resizer {
currentPlayerStyleString: any; currentPlayerStyleString: any;
currentCssValidFor: any; currentCssValidFor: any;
currentVideoSettings: any; currentVideoSettings: any;
lastAr: {type: any, ratio?: number} = {type: AspectRatio.Initial}; lastAr: {type: any, ratio?: number} = {type: AspectRatioType.Initial};
resizerId: any; resizerId: any;
videoAlignment: any; videoAlignment: any;
userCss: string; userCss: string;
@ -98,12 +98,12 @@ class Resizer {
calculateRatioForLegacyOptions(ar){ calculateRatioForLegacyOptions(ar){
// also present as modeToAr in Scaler.js // also present as modeToAr in Scaler.js
if (ar.type !== AspectRatio.FitWidth && ar.type !== AspectRatio.FitHeight && ar.ratio) { if (ar.type !== AspectRatioType.FitWidth && ar.type !== AspectRatioType.FitHeight && ar.ratio) {
return ar; return ar;
} }
// Skrbi za "stare" možnosti, kot na primer "na širino zaslona", "na višino zaslona" in "ponastavi". // Skrbi za "stare" možnosti, kot na primer "na širino zaslona", "na višino zaslona" in "ponastavi".
// Približevanje opuščeno. // Približevanje opuščeno.
// handles "legacy" options, such as 'fit to widht', 'fit to height' and AspectRatio.Reset. No zoom tho // handles "legacy" options, such as 'fit to widht', 'fit to height' and AspectRatioType.Reset. No zoom tho
var ratioOut; var ratioOut;
if (!this.conf.video) { if (!this.conf.video) {
@ -128,13 +128,13 @@ class Resizer {
var fileAr = this.conf.video.videoWidth / this.conf.video.videoHeight; var fileAr = this.conf.video.videoWidth / this.conf.video.videoHeight;
if (ar.type === AspectRatio.FitWidth){ if (ar.type === AspectRatioType.FitWidth){
ar.ratio = ratioOut > fileAr ? ratioOut : fileAr; ar.ratio = ratioOut > fileAr ? ratioOut : fileAr;
} }
else if(ar.type === AspectRatio.FitHeight){ else if(ar.type === AspectRatioType.FitHeight){
ar.ratio = ratioOut < fileAr ? ratioOut : fileAr; ar.ratio = ratioOut < fileAr ? ratioOut : fileAr;
} }
else if(ar.type === AspectRatio.Reset){ else if(ar.type === AspectRatioType.Reset){
this.logger.log('info', 'debug', "[Scaler.js::modeToAr] Using original aspect ratio -", fileAr); this.logger.log('info', 'debug', "[Scaler.js::modeToAr] Using original aspect ratio -", fileAr);
ar.ratio = fileAr; ar.ratio = fileAr;
} else { } else {
@ -152,7 +152,7 @@ class Resizer {
// Some options require a bit more testing re: whether they make sense // Some options require a bit more testing re: whether they make sense
// if they don't, we refuse to update aspect ratio until they do // if they don't, we refuse to update aspect ratio until they do
if (ar.type === AspectRatio.Automatic || ar.type === AspectRatio.Fixed) { if (ar.type === AspectRatioType.Automatic || ar.type === AspectRatioType.Fixed) {
if (!ar.ratio || isNaN(ar.ratio)) { if (!ar.ratio || isNaN(ar.ratio)) {
return; return;
} }
@ -184,9 +184,9 @@ class Resizer {
let stretchFactors: {xFactor: number, yFactor: number, arCorrectionFactor?: number, ratio?: number} | any; let stretchFactors: {xFactor: number, yFactor: number, arCorrectionFactor?: number, ratio?: number} | any;
// reset zoom, but only on aspect ratio switch. We also know that aspect ratio gets converted to // reset zoom, but only on aspect ratio switch. We also know that aspect ratio gets converted to
// AspectRatio.Fixed when zooming, so let's keep that in mind // AspectRatioType.Fixed when zooming, so let's keep that in mind
if ( if (
(ar.type !== AspectRatio.Fixed && ar.type !== AspectRatio.Manual) // anything not these two _always_ changes AR (ar.type !== AspectRatioType.Fixed && ar.type !== AspectRatioType.Manual) // anything not these two _always_ changes AR
|| ar.type !== this.lastAr.type // this also means aspect ratio has changed || ar.type !== this.lastAr.type // this also means aspect ratio has changed
|| ar.ratio !== this.lastAr.ratio // this also means aspect ratio has changed || ar.ratio !== this.lastAr.ratio // this also means aspect ratio has changed
) { ) {
@ -198,9 +198,9 @@ class Resizer {
// this means here's the optimal place to set or forget aspect ratio. Saving of current crop ratio // this means here's the optimal place to set or forget aspect ratio. Saving of current crop ratio
// is handled in pageInfo.updateCurrentCrop(), which also makes sure to persist aspect ratio if ar // is handled in pageInfo.updateCurrentCrop(), which also makes sure to persist aspect ratio if ar
// is set to persist between videos / through current session / until manual reset. // is set to persist between videos / through current session / until manual reset.
if (ar.type === AspectRatio.Automatic || if (ar.type === AspectRatioType.Automatic ||
ar.type === AspectRatio.Reset || ar.type === AspectRatioType.Reset ||
ar.type === AspectRatio.Initial ) { ar.type === AspectRatioType.Initial ) {
// reset/undo default // reset/undo default
this.conf.pageInfo.updateCurrentCrop(undefined); this.conf.pageInfo.updateCurrentCrop(undefined);
} else { } else {
@ -221,7 +221,7 @@ class Resizer {
this.lastAr = {type: ar.type, ratio: ar.ratio} this.lastAr = {type: ar.type, ratio: ar.ratio}
} }
// if (this.extensionMode === ExtensionMode.Basic && !PlayerData.isFullScreen() && ar.type !== AspectRatio.Reset) { // if (this.extensionMode === ExtensionMode.Basic && !PlayerData.isFullScreen() && ar.type !== AspectRatioType.Reset) {
// // don't actually apply or calculate css when using basic mode if not in fullscreen // // don't actually apply or calculate css when using basic mode if not in fullscreen
// // ... unless we're resetting the aspect ratio to original // // ... unless we're resetting the aspect ratio to original
// return; // return;
@ -236,18 +236,18 @@ class Resizer {
// * ar.type is auto, but stretch is set to basic basic stretch // * ar.type is auto, but stretch is set to basic basic stretch
// //
// unpause when using other modes // unpause when using other modes
if (ar.type !== AspectRatio.Automatic || this.stretcher.mode === Stretch.Basic) { if (ar.type !== AspectRatioType.Automatic || this.stretcher.mode === StretchType.Basic) {
this.conf?.arDetector?.pause(); this.conf?.arDetector?.pause();
} else { } else {
if (this.lastAr.type === AspectRatio.Automatic) { if (this.lastAr.type === AspectRatioType.Automatic) {
this.conf?.arDetector?.unpause(); this.conf?.arDetector?.unpause();
} }
} }
// do stretch thingy // do stretch thingy
if (this.stretcher.mode === Stretch.NoStretch if (this.stretcher.mode === StretchType.NoStretch
|| this.stretcher.mode === Stretch.Conditional || this.stretcher.mode === StretchType.Conditional
|| this.stretcher.mode === Stretch.FixedSource){ || this.stretcher.mode === StretchType.FixedSource){
stretchFactors = this.scaler.calculateCrop(ar); stretchFactors = this.scaler.calculateCrop(ar);
@ -268,25 +268,25 @@ class Resizer {
} }
} }
if (this.stretcher.mode === Stretch.Conditional){ if (this.stretcher.mode === StretchType.Conditional){
this.stretcher.applyConditionalStretch(stretchFactors, ar.ratio); this.stretcher.applyConditionalStretch(stretchFactors, ar.ratio);
} else if (this.stretcher.mode === Stretch.FixedSource) { } else if (this.stretcher.mode === StretchType.FixedSource) {
this.stretcher.applyStretchFixedSource(stretchFactors); this.stretcher.applyStretchFixedSource(stretchFactors);
} }
this.logger.log('info', 'debug', "[Resizer::setAr] Processed stretch factors for ", this.logger.log('info', 'debug', "[Resizer::setAr] Processed stretch factors for ",
this.stretcher.mode === Stretch.NoStretch ? 'stretch-free crop.' : this.stretcher.mode === StretchType.NoStretch ? 'stretch-free crop.' :
this.stretcher.mode === Stretch.Conditional ? 'crop with conditional stretch.' : 'crop with fixed stretch', this.stretcher.mode === StretchType.Conditional ? 'crop with conditional StretchType.' : 'crop with fixed stretch',
'Stretch factors are:', stretchFactors 'Stretch factors are:', stretchFactors
); );
} else if (this.stretcher.mode === Stretch.Hybrid) { } else if (this.stretcher.mode === StretchType.Hybrid) {
stretchFactors = this.stretcher.calculateStretch(ar.ratio); stretchFactors = this.stretcher.calculateStretch(ar.ratio);
this.logger.log('info', 'debug', '[Resizer::setAr] Processed stretch factors for hybrid stretch/crop. Stretch factors are:', stretchFactors); this.logger.log('info', 'debug', '[Resizer::setAr] Processed stretch factors for hybrid stretch/crop. Stretch factors are:', stretchFactors);
} else if (this.stretcher.mode === Stretch.Fixed) { } else if (this.stretcher.mode === StretchType.Fixed) {
stretchFactors = this.stretcher.calculateStretchFixed(ar.ratio) stretchFactors = this.stretcher.calculateStretchFixed(ar.ratio)
} else if (this.stretcher.mode === Stretch.Basic) { } else if (this.stretcher.mode === StretchType.Basic) {
stretchFactors = this.stretcher.calculateBasicStretch(); stretchFactors = this.stretcher.calculateBasicStretch();
this.logger.log('info', 'debug', '[Resizer::setAr] Processed stretch factors for basic stretch. Stretch factors are:', stretchFactors); this.logger.log('info', 'debug', '[Resizer::setAr] Processed stretch factors for basic StretchType. Stretch factors are:', stretchFactors);
} else { } else {
stretchFactors = {xFactor: 1, yFactor: 1}; stretchFactors = {xFactor: 1, yFactor: 1};
this.logger.log('error', 'debug', '[Resizer::setAr] Okay wtf happened? If you see this, something has gone wrong', stretchFactors,"\n------[ i n f o d u m p ]------\nstretcher:", this.stretcher); this.logger.log('error', 'debug', '[Resizer::setAr] Okay wtf happened? If you see this, something has gone wrong', stretchFactors,"\n------[ i n f o d u m p ]------\nstretcher:", this.stretcher);
@ -309,12 +309,12 @@ class Resizer {
// converting to fixed AR means we also turn off autoAR // converting to fixed AR means we also turn off autoAR
this.setAr({ this.setAr({
ratio: this.lastAr.ratio, ratio: this.lastAr.ratio,
type: AspectRatio.Fixed type: AspectRatioType.Fixed
}); });
} }
resetLastAr() { resetLastAr() {
this.lastAr = {type: AspectRatio.Initial}; this.lastAr = {type: AspectRatioType.Initial};
} }
setLastAr(override){ setLastAr(override){
@ -336,10 +336,10 @@ class Resizer {
return; return;
} }
// dont allow weird floats // dont allow weird floats
this.videoAlignment = VideoAlignment.Center; this.videoAlignment = VideoAlignmentType.Center;
// because non-fixed aspect ratios reset panning: // because non-fixed aspect ratios reset panning:
if (this.lastAr.type !== AspectRatio.Fixed) { if (this.lastAr.type !== AspectRatioType.Fixed) {
this.toFixedAr(); this.toFixedAr();
} }
@ -385,8 +385,8 @@ class Resizer {
this.logger.log('info', 'debug', "[Resizer::restore] <rid:"+this.resizerId+"> attempting to restore aspect ratio", {'lastAr': this.lastAr} ); this.logger.log('info', 'debug', "[Resizer::restore] <rid:"+this.resizerId+"> attempting to restore aspect ratio", {'lastAr': this.lastAr} );
// this is true until we verify that css has actually been applied // this is true until we verify that css has actually been applied
if(this.lastAr.type === AspectRatio.Initial){ if(this.lastAr.type === AspectRatioType.Initial){
this.setAr({type: AspectRatio.Reset}); this.setAr({type: AspectRatioType.Reset});
} }
else { else {
if (this.lastAr?.ratio === null) { if (this.lastAr?.ratio === null) {
@ -402,7 +402,7 @@ class Resizer {
this.setStretchMode(this.settings.active.sites[window.location.hostname]?.stretch ?? this.settings.active.sites['@global'].stretch); this.setStretchMode(this.settings.active.sites[window.location.hostname]?.stretch ?? this.settings.active.sites['@global'].stretch);
this.zoom.setZoom(1); this.zoom.setZoom(1);
this.resetPan(); this.resetPan();
this.setAr({type: AspectRatio.Reset}); this.setAr({type: AspectRatioType.Reset});
} }
setPanMode(mode) { setPanMode(mode) {
@ -429,11 +429,11 @@ class Resizer {
} }
resetCrop(){ resetCrop(){
this.setAr({type: AspectRatio.Reset}); this.setAr({type: AspectRatioType.Reset});
} }
resetStretch(){ resetStretch(){
this.stretcher.setStretchMode(Stretch.NoStretch); this.stretcher.setStretchMode(StretchType.NoStretch);
this.restore(); this.restore();
} }
@ -535,10 +535,10 @@ class Resizer {
translate.y += hdiffAfterZoom * this.pan.relativeOffsetY * this.zoom.scale; translate.y += hdiffAfterZoom * this.pan.relativeOffsetY * this.zoom.scale;
} }
} else { } else {
if (this.videoAlignment == VideoAlignment.Left) { if (this.videoAlignment == VideoAlignmentType.Left) {
translate.x += wdiffAfterZoom * 0.5; translate.x += wdiffAfterZoom * 0.5;
} }
else if (this.videoAlignment == VideoAlignment.Right) { else if (this.videoAlignment == VideoAlignmentType.Right) {
translate.x -= wdiffAfterZoom * 0.5; translate.x -= wdiffAfterZoom * 0.5;
} }
} }

View File

@ -1,5 +1,5 @@
import Debug from '../../conf/Debug'; import Debug from '../../conf/Debug';
import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
import BrowserDetect from '../../conf/BrowserDetect'; import BrowserDetect from '../../conf/BrowserDetect';
@ -19,9 +19,9 @@ class Scaler {
// Skrbi za "stare" možnosti, kot na primer "na širino zaslona", "na višino zaslona" in "ponastavi". // Skrbi za "stare" možnosti, kot na primer "na širino zaslona", "na višino zaslona" in "ponastavi".
// Približevanje opuščeno. // Približevanje opuščeno.
// handles "legacy" options, such as 'fit to widht', 'fit to height' and AspectRatio.Reset. No zoom tho // handles "legacy" options, such as 'fit to widht', 'fit to height' and AspectRatioType.Reset. No zoom tho
modeToAr (ar) { modeToAr (ar) {
if (ar.type !== AspectRatio.FitWidth && ar.type !== AspectRatio.FitHeight && ar.ratio) { if (ar.type !== AspectRatioType.FitWidth && ar.type !== AspectRatioType.FitHeight && ar.ratio) {
return ar.ratio; return ar.ratio;
} }
@ -48,17 +48,17 @@ class Scaler {
var fileAr = this.conf.video.videoWidth / this.conf.video.videoHeight; var fileAr = this.conf.video.videoWidth / this.conf.video.videoHeight;
if (ar.type === AspectRatio.FitWidth) { if (ar.type === AspectRatioType.FitWidth) {
ratioOut > fileAr ? ratioOut : fileAr ratioOut > fileAr ? ratioOut : fileAr
ar.ratio = ratioOut; ar.ratio = ratioOut;
return ratioOut; return ratioOut;
} }
else if (ar.type === AspectRatio.FitHeight) { else if (ar.type === AspectRatioType.FitHeight) {
ratioOut < fileAr ? ratioOut : fileAr ratioOut < fileAr ? ratioOut : fileAr
ar.ratio = ratioOut; ar.ratio = ratioOut;
return ratioOut; return ratioOut;
} }
else if (ar.type === AspectRatio.Reset) { else if (ar.type === AspectRatioType.Reset) {
this.logger.log('info', 'debug', "[Scaler.js::modeToAr] Using original aspect ratio -", fileAr) this.logger.log('info', 'debug', "[Scaler.js::modeToAr] Using original aspect ratio -", fileAr)
ar.ar = fileAr; ar.ar = fileAr;
return fileAr; return fileAr;
@ -76,7 +76,7 @@ class Scaler {
* undoes any zoom that style="height:123%" on the video element adds. * undoes any zoom that style="height:123%" on the video element adds.
* *
* There are few exceptions and additional caveatss: * There are few exceptions and additional caveatss:
* * AspectRatio.FitHeight: we don't want to pre-downscale the video at all, as things * * AspectRatioType.FitHeight: we don't want to pre-downscale the video at all, as things
* will be scaled to fit height as-is. * will be scaled to fit height as-is.
* * When player is wider than stream, we want to undo any height compensations site * * When player is wider than stream, we want to undo any height compensations site
* tacks on the video tag. * tacks on the video tag.
@ -94,10 +94,10 @@ class Scaler {
let arCorrectionFactor = 1; let arCorrectionFactor = 1;
if (ar.type !== AspectRatio.FitHeight) { if (ar.type !== AspectRatioType.FitHeight) {
if (playerAr < compensatedStreamAr) { if (playerAr < compensatedStreamAr) {
arCorrectionFactor = this.conf.player.dimensions.width / this.conf.video.offsetWidth; arCorrectionFactor = this.conf.player.dimensions.width / this.conf.video.offsetWidth;
} else if (ar.type !== AspectRatio.Reset) { } else if (ar.type !== AspectRatioType.Reset) {
arCorrectionFactor /= heightCompensationFactor; arCorrectionFactor /= heightCompensationFactor;
} }
} }
@ -116,7 +116,7 @@ class Scaler {
return {error: "illegal_video_dimensions"}; return {error: "illegal_video_dimensions"};
} }
if (ar.type === AspectRatio.Reset){ if (ar.type === AspectRatioType.Reset){
return {xFactor: arCorrectionFactor, yFactor: arCorrectionFactor, arCorrectionFactor: arCorrectionFactor} return {xFactor: arCorrectionFactor, yFactor: arCorrectionFactor, arCorrectionFactor: arCorrectionFactor}
} }
@ -139,7 +139,7 @@ class Scaler {
// Dejansko razmerje stranic datoteke/<video> značke // Dejansko razmerje stranic datoteke/<video> značke
// Actual aspect ratio of the file/<video> tag // Actual aspect ratio of the file/<video> tag
if (ar.type === AspectRatio.Initial || !ar.ratio) { if (ar.type === AspectRatioType.Initial || !ar.ratio) {
ar.ratio = streamAr; ar.ratio = streamAr;
} }

View File

@ -1,6 +1,6 @@
import Stretch from '../../../common/enums/stretch.enum'; import StretchType from '../../../common/enums/StretchType.enum';
import BrowserDetect from '../../conf/BrowserDetect'; import BrowserDetect from '../../conf/BrowserDetect';
import AspectRatio from '../../../common/enums/aspect-ratio.enum'; import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
import VideoData from '../video-data/VideoData'; import VideoData from '../video-data/VideoData';
import Logger from '../Logger'; import Logger from '../Logger';
import Settings from '../Settings'; import Settings from '../Settings';
@ -36,10 +36,10 @@ class Stretcher {
} }
setStretchMode(stretchMode, fixedStretchRatio?) { setStretchMode(stretchMode, fixedStretchRatio?) {
if (stretchMode === Stretch.Default) { if (stretchMode === StretchType.Default) {
this.mode = this.settings.getDefaultStretchMode(window.location.hostname); this.mode = this.settings.getDefaultStretchMode(window.location.hostname);
} else { } else {
if (stretchMode === Stretch.Fixed || stretchMode == Stretch.FixedSource) { if (stretchMode === StretchType.Fixed || stretchMode == StretchType.FixedSource) {
this.fixedStretchRatio = fixedStretchRatio; this.fixedStretchRatio = fixedStretchRatio;
} }
this.mode = stretchMode; this.mode = stretchMode;
@ -68,11 +68,11 @@ class Stretcher {
actualWidth = newWidth; actualWidth = newWidth;
} }
var minW = this.conf.player.dimensions.width * (1 - this.settings.active.stretch.conditionalDifferencePercent); var minW = this.conf.player.dimensions.width * (1 - this.settings.active.StretchType.conditionalDifferencePercent);
var maxW = this.conf.player.dimensions.width * (1 + this.settings.active.stretch.conditionalDifferencePercent); var maxW = this.conf.player.dimensions.width * (1 + this.settings.active.StretchType.conditionalDifferencePercent);
var minH = this.conf.player.dimensions.height * (1 - this.settings.active.stretch.conditionalDifferencePercent); var minH = this.conf.player.dimensions.height * (1 - this.settings.active.StretchType.conditionalDifferencePercent);
var maxH = this.conf.player.dimensions.height * (1 + this.settings.active.stretch.conditionalDifferencePercent); var maxH = this.conf.player.dimensions.height * (1 + this.settings.active.StretchType.conditionalDifferencePercent);
if (actualWidth >= minW && actualWidth <= maxW) { if (actualWidth >= minW && actualWidth <= maxW) {
stretchFactors.xFactor *= this.conf.player.dimensions.width / actualWidth; stretchFactors.xFactor *= this.conf.player.dimensions.width / actualWidth;
@ -260,7 +260,7 @@ squeezeFactor: ${squeezeFactor}`, '\nvideo', this.conf.video);
* * user is using a noVideo card * * user is using a noVideo card
* * user is in full screen mode * * user is in full screen mode
* * the video is both roughly taller and roughly wider than the monitor * * the video is both roughly taller and roughly wider than the monitor
* Then the video will do Stretch.Basic no matter what you put in `transform: scale(x,y)`. * Then the video will do StretchType.Basic no matter what you put in `transform: scale(x,y)`.
* *
* In practice, the issue appears slightly _before_ the last condition is met (video needs to be ~3434 px wide * In practice, the issue appears slightly _before_ the last condition is met (video needs to be ~3434 px wide
* in order for this bug to trigger on my 3440x1440 display). * in order for this bug to trigger on my 3440x1440 display).

View File

@ -1,6 +1,6 @@
import Debug from './conf/Debug'; import Debug from './conf/Debug';
import BrowserDetect from './conf/BrowserDetect'; import BrowserDetect from './conf/BrowserDetect';
import ExtensionMode from '../common/enums/extension-mode.enum'; import ExtensionMode from '../common/enums/ExtensionMode.enum';
import Settings from './lib/Settings'; import Settings from './lib/Settings';
import ActionHandler from './lib/ActionHandler'; import ActionHandler from './lib/ActionHandler';
import Comms from './lib/comms/Comms'; import Comms from './lib/comms/Comms';

View File

@ -57,16 +57,16 @@
</div> </div>
<div class="flex flex-row button-box"> <div class="flex flex-row button-box">
<Button label="Left" <Button label="Left"
:selected="settings.active.sites['@global'].videoAlignment === VideoAlignment.Left" :selected="settings.active.sites['@global'].videoAlignment === VideoAlignmentType.Left"
@click.native="setDefaultvideoAlignment(VideoAlignment.Left)"> @click.native="setDefaultvideoAlignment(VideoAlignmentType.Left)">
</Button> </Button>
<Button label="Center" <Button label="Center"
:selected="settings.active.sites['@global'].videoAlignment === VideoAlignment.Center" :selected="settings.active.sites['@global'].videoAlignment === VideoAlignmentType.Center"
@click.native="setDefaultvideoAlignment(VideoAlignment.Center)"> @click.native="setDefaultvideoAlignment(VideoAlignmentType.Center)">
</Button> </Button>
<Button label="Right" <Button label="Right"
:selected="settings.active.sites['@global'].videoAlignment === VideoAlignment.Right" :selected="settings.active.sites['@global'].videoAlignment === VideoAlignmentType.Right"
@click.native="setDefaultvideoAlignment(VideoAlignment.Right)"> @click.native="setDefaultvideoAlignment(VideoAlignmentType.Right)">
</Button> </Button>
</div> </div>
@ -75,20 +75,20 @@
</div> </div>
<div class="flex flex-row button-box"> <div class="flex flex-row button-box">
<Button label="Don't stretch" <Button label="Don't stretch"
:selected="settings.active.sites['@global'].stretch === Stretch.NoStretch" :selected="settings.active.sites['@global'].stretch === StretchType.NoStretch"
@click.native="setDefaultStretchingMode(Stretch.NoStretch)"> @click.native="setDefaultStretchingMode(StretchType.NoStretch)">
</Button> </Button>
<Button label="Basic stretch" <Button label="Basic stretch"
:selected="settings.active.sites['@global'].stretch === Stretch.Basic" :selected="settings.active.sites['@global'].stretch === StretchType.Basic"
@click.native="setDefaultStretchingMode(Stretch.Basic)"> @click.native="setDefaultStretchingMode(StretchType.Basic)">
</Button> </Button>
<Button label="Hybrid stretch" <Button label="Hybrid stretch"
:selected="settings.active.sites['@global'].stretch === Stretch.Hybrid" :selected="settings.active.sites['@global'].stretch === StretchType.Hybrid"
@click.native="setDefaultStretchingMode(Stretch.Hybrid)"> @click.native="setDefaultStretchingMode(StretchType.Hybrid)">
</Button> </Button>
<Button label="Thin borders only" <Button label="Thin borders only"
:selected="settings.active.sites['@global'].stretch === Stretch.Conditional" :selected="settings.active.sites['@global'].stretch === StretchType.Conditional"
@click.native="setDefaultStretchingMode(Stretch.Conditional)" @click.native="setDefaultStretchingMode(StretchType.Conditional)"
> >
</Button> </Button>
</div> </div>
@ -108,7 +108,7 @@
<div class="flex flex-input"> <div class="flex flex-input">
<input type="number" <input type="number"
step="any" step="any"
:value="settings.active.stretch.conditionalDifferencePercent" :value="settings.active.StretchType.conditionalDifferencePercent"
@input="updateStretchThreshold($event.target.value)" @input="updateStretchThreshold($event.target.value)"
> >
</div> </div>
@ -152,9 +152,9 @@
<script> <script>
import Button from '../common/components/Button'; import Button from '../common/components/Button';
import Stretch from '../common/enums/stretch.enum'; import StretchType from '../common/enums/StretchType.enum';
import ExtensionMode from '../common/enums/extension-mode.enum'; import ExtensionMode from '../common/enums/ExtensionMode.enum';
import VideoAlignment from '../common/enums/video-alignment.enum'; import VideoAlignmentType from '../common/enums/VideoAlignmentType.enum';
import BrowserDetect from '../ext/conf/BrowserDetect'; import BrowserDetect from '../ext/conf/BrowserDetect';
export default { export default {
@ -198,7 +198,7 @@ export default {
if (!newThreshold || isNaN(newThreshold)) { if (!newThreshold || isNaN(newThreshold)) {
return; return;
} }
this.settings.active.stretch.conditionalDifferencePercent = newThreshold; this.settings.active.StretchType.conditionalDifferencePercent = newThreshold;
this.settings.save(); this.settings.save();
}, },
resetSettings() { resetSettings() {

View File

@ -102,7 +102,7 @@
<script> <script>
import ShortcutButton from '../../common/components/ShortcutButton.vue' import ShortcutButton from '../../common/components/ShortcutButton.vue'
import Stretch from '../../common/enums/stretch.enum'; import StretchType from '../../common/enums/StretchType.enum';
import KeyboardShortcutParser from '../../common/js/KeyboardShortcutParser'; import KeyboardShortcutParser from '../../common/js/KeyboardShortcutParser';
import CommandChain from './command-builder/CommandChain'; import CommandChain from './command-builder/CommandChain';
import CommandAddEdit from './command-builder/CommandAddEdit'; import CommandAddEdit from './command-builder/CommandAddEdit';

View File

@ -111,7 +111,7 @@
<script> <script>
import Button from '../../common/components/Button'; import Button from '../../common/components/Button';
import Stretch from '../../common/enums/stretch.enum'; import StretchType from '../../common/enums/StretchType.enum';
import ActionAlt from '../../common/components/ActionAlt'; import ActionAlt from '../../common/components/ActionAlt';
export default { export default {

View File

@ -89,7 +89,7 @@
<script> <script>
import ActionList from '../../../ext/conf/ActionList'; import ActionList from '../../../ext/conf/ActionList';
import Stretch from '../../../common/enums/stretch.enum'; import StretchType from '../../../common/enums/StretchType.enum';
export default { export default {
data () { data () {

View File

@ -219,7 +219,7 @@ import Settings from '../ext/lib/Settings';
import ExecAction from './js/ExecAction.js'; import ExecAction from './js/ExecAction.js';
import DefaultSettingsPanel from './panels/DefaultSettingsPanel'; import DefaultSettingsPanel from './panels/DefaultSettingsPanel';
import AboutPanel from './panels/AboutPanel'; import AboutPanel from './panels/AboutPanel';
import ExtensionMode from '../common/enums/extension-mode.enum'; import ExtensionMode from '../common/enums/ExtensionMode.enum';
import Logger from '../ext/lib/Logger'; import Logger from '../ext/lib/Logger';
import {ChromeShittinessMitigations as CSM} from '../common/js/ChromeShittinessMitigations'; import {ChromeShittinessMitigations as CSM} from '../common/js/ChromeShittinessMitigations';

View File

@ -59,7 +59,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-extension-mode") { } else if (cmd.action === "set-ExtensionMode") {
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

@ -130,9 +130,9 @@
import ShortcutButton from '../../common/components/ShortcutButton.vue'; import ShortcutButton from '../../common/components/ShortcutButton.vue';
import QsElement from '../../common/components/QsElement.vue'; import QsElement from '../../common/components/QsElement.vue';
import QuerySelectorSetting from '../../common/components/QuerySelectorSetting.vue'; import QuerySelectorSetting from '../../common/components/QuerySelectorSetting.vue';
import ExtensionMode from '../../common/enums/extension-mode.enum'; import ExtensionMode from '../../common/enums/ExtensionMode.enum';
import VideoAlignment from '../../common/enums/video-alignment.enum'; import VideoAlignmentType from '../../common/enums/VideoAlignmentType.enum';
import Stretch from '../../common/enums/stretch.enum'; import StretchType from '../../common/enums/StretchType.enum';
export default { export default {
components: { components: {
QuerySelectorSetting, QuerySelectorSetting,
@ -186,8 +186,8 @@ export default {
mode: ExtensionMode.Default, mode: ExtensionMode.Default,
autoar: ExtensionMode.Default, autoar: ExtensionMode.Default,
type: 'user-added', type: 'user-added',
stretch: Stretch.Default, stretch: StretchType.Default,
videoAlignment: VideoAlignment.Default, videoAlignment: VideoAlignmentType.Default,
keyboardShortcutsEnabled: ExtensionMode.Default, keyboardShortcutsEnabled: ExtensionMode.Default,
} }
} }

View File

@ -125,7 +125,7 @@ import ExecAction from '../js/ExecAction';
import KeyboardShortcutParser from '../../common/js/KeyboardShortcutParser'; import KeyboardShortcutParser from '../../common/js/KeyboardShortcutParser';
import ShortcutButton from '../../common/components/ShortcutButton'; import ShortcutButton from '../../common/components/ShortcutButton';
import ComputeActionsMixin from '../../common/mixins/ComputeActionsMixin'; import ComputeActionsMixin from '../../common/mixins/ComputeActionsMixin';
import CropModePersistence from '../../common/enums/crop-mode-persistence.enum'; import CropModePersistence from '../../common/enums/CropModePersistence.enum';
export default { export default {
data() { data() {