get UI to somewhat work. TODO: get scripts to work
This commit is contained in:
parent
9503003a4a
commit
a30a70c6b5
@ -8,5 +8,11 @@ export async function sleep(timeout) {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function _cp(obj) {
|
export function _cp(obj) {
|
||||||
|
try {
|
||||||
return JSON.parse(JSON.stringify(obj));
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Failed to parse json. This probably means that the data we received was not an object. Will return data as-is');
|
||||||
|
console.error('data in:', obj, 'error:', e);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,12 +87,14 @@
|
|||||||
<VideoSettings
|
<VideoSettings
|
||||||
v-if="selectedTab === 'videoSettings'"
|
v-if="selectedTab === 'videoSettings'"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
|
:siteSettings="siteSettings"
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:site="site"
|
:site="site"
|
||||||
></VideoSettings>
|
></VideoSettings>
|
||||||
<PlayerDetectionPanel
|
<PlayerDetectionPanel
|
||||||
v-if="selectedTab === 'playerDetection'"
|
v-if="selectedTab === 'playerDetection'"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
|
:siteSettings="siteSettings"
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:site="site"
|
:site="site"
|
||||||
>
|
>
|
||||||
@ -100,11 +102,13 @@
|
|||||||
<BaseExtensionSettings
|
<BaseExtensionSettings
|
||||||
v-if="selectedTab === 'extensionSettings'"
|
v-if="selectedTab === 'extensionSettings'"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
|
:siteSettings="siteSettings"
|
||||||
:site="site"
|
:site="site"
|
||||||
></BaseExtensionSettings>
|
></BaseExtensionSettings>
|
||||||
<AutodetectionSettingsPanel
|
<AutodetectionSettingsPanel
|
||||||
v-if="selectedTab === 'autodetectionSettings'"
|
v-if="selectedTab === 'autodetectionSettings'"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
|
:siteSettings="siteSettings"
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:site="site"
|
:site="site"
|
||||||
>
|
>
|
||||||
|
@ -131,8 +131,7 @@ export default {
|
|||||||
|
|
||||||
],
|
],
|
||||||
props: [
|
props: [
|
||||||
'settings',
|
'siteSettings',
|
||||||
'site',
|
|
||||||
'isDefaultConfiguration'
|
'isDefaultConfiguration'
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
@ -141,12 +140,12 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
siteDefaultCrop() {
|
siteDefaultCrop() {
|
||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
this.settings?.getDefaultCrop(this.site) ?? {type: this.site === '@global' ? AspectRatioType.Automatic : AspectRatioType.Default}
|
this.siteSettings.data.defaults.crop
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
siteDefaultStretch() {
|
siteDefaultStretch() {
|
||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
this.settings?.getDefaultStretch(this.site) ?? {type: this.site === '@global' ? StretchMode.NoStretch : StretchMode.Default}
|
this.siteSettings.data.defaults.stretch
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
siteDefaultCropPersistence() {
|
siteDefaultCropPersistence() {
|
||||||
|
@ -165,10 +165,9 @@ export default {
|
|||||||
CommsMixin
|
CommsMixin
|
||||||
],
|
],
|
||||||
props: [
|
props: [
|
||||||
'settings',
|
'settings', // required for buttons and actions, which are global
|
||||||
'frame',
|
'siteSettings',
|
||||||
'eventBus',
|
'eventBus',
|
||||||
'site',
|
|
||||||
'isEditing'
|
'isEditing'
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
@ -176,14 +175,9 @@ export default {
|
|||||||
EditShortcutButton,
|
EditShortcutButton,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
extensionDefaultCrop() {
|
|
||||||
return JSON.stringify(
|
|
||||||
this.settings?.active.crop?.default ?? {type: AspectRatioType.Automatic}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
siteDefaultCrop() {
|
siteDefaultCrop() {
|
||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
this.settings?.getDefaultCrop(this.site) ?? {type: AspectRatioType.Automatic}
|
this.siteSettings.data.defaults.crop
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -215,7 +209,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultCrop = this.settings.getDefaultCrop(this.site);
|
const defaultCrop = this.siteSettings.data.defaults.crop;
|
||||||
|
|
||||||
if (cropCommand.arguments.type === AspectRatioType.Automatic) {
|
if (cropCommand.arguments.type === AspectRatioType.Automatic) {
|
||||||
return this.resizerConfig.crop.type === AspectRatioType.Automatic
|
return this.resizerConfig.crop.type === AspectRatioType.Automatic
|
||||||
|
@ -198,10 +198,9 @@ export default {
|
|||||||
CommsMixin
|
CommsMixin
|
||||||
],
|
],
|
||||||
props: [
|
props: [
|
||||||
'settings',
|
'settings', // required for buttons and actions, which are global
|
||||||
'frame',
|
'siteSettings',
|
||||||
'eventBus',
|
'eventBus',
|
||||||
'site',
|
|
||||||
'isEditing'
|
'isEditing'
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
@ -209,14 +208,9 @@ export default {
|
|||||||
EditShortcutButton,
|
EditShortcutButton,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
extensionDefaultStretch() {
|
|
||||||
return JSON.stringify(
|
|
||||||
this.settings?.active.stretch?.default ?? {type: StretchMode.NoStretch}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
siteDefaultStretch() {
|
siteDefaultStretch() {
|
||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
this.settings?.getDefaultStretch(this.site) ?? {type: StretchMode.NoStretch}
|
this.siteSettings.data.defaults.stretch
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -100,10 +100,9 @@ export default {
|
|||||||
|
|
||||||
],
|
],
|
||||||
props: [
|
props: [
|
||||||
'settings',
|
'settings', // required for buttons and actions, which are global
|
||||||
'frame',
|
'siteSettings',
|
||||||
'eventBus',
|
'eventBus',
|
||||||
'site',
|
|
||||||
'isEditing'
|
'isEditing'
|
||||||
],
|
],
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -39,10 +39,8 @@
|
|||||||
|
|
||||||
<CropOptionsPanel
|
<CropOptionsPanel
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
:frame="frame"
|
:siteSettings="siteSettings"
|
||||||
:exec="exec"
|
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:site="site"
|
|
||||||
:isEditing="editMode"
|
:isEditing="editMode"
|
||||||
>
|
>
|
||||||
</CropOptionsPanel>
|
</CropOptionsPanel>
|
||||||
@ -57,10 +55,8 @@
|
|||||||
|
|
||||||
<StretchOptionsPanel
|
<StretchOptionsPanel
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
:frame="frame"
|
:siteSettings="siteSettings"
|
||||||
:exec="exec"
|
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:site="site"
|
|
||||||
:isEditing="editMode"
|
:isEditing="editMode"
|
||||||
></StretchOptionsPanel>
|
></StretchOptionsPanel>
|
||||||
</div>
|
</div>
|
||||||
@ -75,10 +71,9 @@
|
|||||||
|
|
||||||
<ZoomOptionsPanel
|
<ZoomOptionsPanel
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
:frame="frame"
|
:siteSettings="siteSettings"
|
||||||
:exec="exec"
|
|
||||||
:eventBus="eventBus"
|
:eventBus="eventBus"
|
||||||
:site="site"
|
:isEditing="editMode"
|
||||||
></ZoomOptionsPanel>
|
></ZoomOptionsPanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -142,7 +137,8 @@ export default {
|
|||||||
CommsMixin,
|
CommsMixin,
|
||||||
],
|
],
|
||||||
props: [
|
props: [
|
||||||
'settings',
|
'settings', // required for buttons and actions, which are global
|
||||||
|
'siteSettings',
|
||||||
'frame',
|
'frame',
|
||||||
'eventBus',
|
'eventBus',
|
||||||
'site'
|
'site'
|
||||||
|
@ -48,6 +48,9 @@ export class SiteSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!this.data.defaults) {
|
||||||
|
this.data.defaults = _cp(this.defaultSettings.defaults);
|
||||||
|
} else {
|
||||||
// 'undefined' default here means use default
|
// 'undefined' default here means use default
|
||||||
this.data.defaults.crop = this.data.defaults.crop ?? _cp(this.defaultSettings.defaults.crop);
|
this.data.defaults.crop = this.data.defaults.crop ?? _cp(this.defaultSettings.defaults.crop);
|
||||||
|
|
||||||
@ -65,6 +68,7 @@ export class SiteSettings {
|
|||||||
this.data.defaults.alignment.y = _cp(this.defaultSettings.defaults.alignment.y);
|
this.data.defaults.alignment.y = _cp(this.defaultSettings.defaults.alignment.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (const enableSegment of ['enable', 'enableAard', 'enableKeyboard']) {
|
for (const enableSegment of ['enable', 'enableAard', 'enableKeyboard']) {
|
||||||
|
Loading…
Reference in New Issue
Block a user