From cc0ae60c8354e0ec603c79785d9d668c2ed9f5ff Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 15 Jan 2023 22:11:47 +0100 Subject: [PATCH] Update settings object, finalize-ish site settings panel --- src/common/interfaces/SettingsInterface.ts | 7 +- src/common/js/utils.ts | 4 +- .../PlayerUiPanels/BaseExtensionSettings.vue | 58 +-- .../SiteExtensionSettings.vue | 410 ++++++++++++++---- .../VideoSettings/StretchOptionsPanel.vue | 18 - src/ext/conf/ExtConfPatches.ts | 10 + src/ext/conf/ExtensionConf.ts | 12 +- src/ext/lib/settings/SiteSettings.ts | 53 ++- src/manifest.json | 2 +- 9 files changed, 392 insertions(+), 182 deletions(-) diff --git a/src/common/interfaces/SettingsInterface.ts b/src/common/interfaces/SettingsInterface.ts index 804cd94..3e8946f 100644 --- a/src/common/interfaces/SettingsInterface.ts +++ b/src/common/interfaces/SettingsInterface.ts @@ -357,11 +357,8 @@ export interface SiteSettingsInterface { type?: 'official' | 'community' | 'user-defined' | 'testing' | 'officially-disabled'; - persistOption?: { // must be defined in @global and @empty - crop?: CropModePersistence, - stretch?: CropModePersistence, - alignment?: CropModePersistence - }, + // must be defined in @global and @empty + persistCSA?: CropModePersistence, // CSA - crop, stretch, alignment defaults?: { // must be defined in @global and @empty crop?: {type: AspectRatioType, [x: string]: any}, diff --git a/src/common/js/utils.ts b/src/common/js/utils.ts index 0631ba4..5a7a223 100644 --- a/src/common/js/utils.ts +++ b/src/common/js/utils.ts @@ -11,8 +11,8 @@ export function _cp(obj) { try { 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); + // 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; } } diff --git a/src/csui/src/PlayerUiPanels/BaseExtensionSettings.vue b/src/csui/src/PlayerUiPanels/BaseExtensionSettings.vue index 97c0824..7780268 100644 --- a/src/csui/src/PlayerUiPanels/BaseExtensionSettings.vue +++ b/src/csui/src/PlayerUiPanels/BaseExtensionSettings.vue @@ -1,57 +1,13 @@