From 2020861b8b8ce588ab1c220f49f1b5fd4e55ee68 Mon Sep 17 00:00:00 2001 From: Masterluke77 <163446896+Masterluke77@users.noreply.github.com> Date: Sun, 12 Jul 2026 21:49:23 +0200 Subject: [PATCH] =?UTF-8?q?fix(ux):=20Explizite=20Asset-Loader-Vertr=C3=A4?= =?UTF-8?q?ge=20wiederherstellen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/design-system/theme-runtime.js | 108 ++++++++++++++++++++++---- 1 file changed, 92 insertions(+), 16 deletions(-) diff --git a/public/design-system/theme-runtime.js b/public/design-system/theme-runtime.js index 5171e4e..dc29f72 100644 --- a/public/design-system/theme-runtime.js +++ b/public/design-system/theme-runtime.js @@ -92,19 +92,19 @@ function loadUxFoundation() { else window.addEventListener('load', loadBehavior, { once: true }); } -function loadAssetPair({ key, css, js }) { - if (!document.querySelector(`link[data-ux-${key}]`)) { +function loadFluxStudioAssets() { + if (!document.querySelector('link[data-ux-flux-studio]')) { const stylesheet = document.createElement('link'); stylesheet.rel = 'stylesheet'; - stylesheet.href = css; - stylesheet.setAttribute(`data-ux-${key}`, 'style'); + stylesheet.href = '/flux-studio-ux.css?v=1.44.0'; + stylesheet.setAttribute('data-ux-flux-studio', 'style'); document.head.append(stylesheet); } const loadBehavior = () => { - if (document.querySelector(`script[data-ux-${key}]`)) return; + if (document.querySelector('script[data-ux-flux-studio]')) return; const script = document.createElement('script'); - script.src = js; - script.setAttribute(`data-ux-${key}`, 'script'); + script.src = '/flux-studio-ux.js?v=1.44.0'; + script.setAttribute('data-ux-flux-studio', 'script'); script.async = false; document.body.append(script); }; @@ -112,28 +112,104 @@ function loadAssetPair({ key, css, js }) { else window.addEventListener('load', loadBehavior, { once: true }); } -function loadFluxStudioAssets() { - loadAssetPair({ key: 'flux-studio', css: '/flux-studio-ux.css?v=1.44.0', js: '/flux-studio-ux.js?v=1.44.0' }); -} - function loadQualityCenterAssets() { - loadAssetPair({ key: 'quality-center', css: '/quality-center-ux.css?v=1.44.0', js: '/quality-center-ux.js?v=1.44.0' }); + if (!document.querySelector('link[data-ux-quality-center]')) { + const stylesheet = document.createElement('link'); + stylesheet.rel = 'stylesheet'; + stylesheet.href = '/quality-center-ux.css?v=1.44.0'; + stylesheet.setAttribute('data-ux-quality-center', 'style'); + document.head.append(stylesheet); + } + const loadBehavior = () => { + if (document.querySelector('script[data-ux-quality-center]')) return; + const script = document.createElement('script'); + script.src = '/quality-center-ux.js?v=1.44.0'; + script.setAttribute('data-ux-quality-center', 'script'); + script.async = false; + document.body.append(script); + }; + if (document.readyState === 'complete') loadBehavior(); + else window.addEventListener('load', loadBehavior, { once: true }); } function loadInventoryWorkspaceAssets() { - loadAssetPair({ key: 'inventory-workspace', css: '/inventory-workspace.css?v=1.44.0', js: '/inventory-workspace.js?v=1.44.0' }); + if (!document.querySelector('link[data-ux-inventory-workspace]')) { + const stylesheet = document.createElement('link'); + stylesheet.rel = 'stylesheet'; + stylesheet.href = '/inventory-workspace.css?v=1.44.0'; + stylesheet.setAttribute('data-ux-inventory-workspace', 'style'); + document.head.append(stylesheet); + } + const loadBehavior = () => { + if (document.querySelector('script[data-ux-inventory-workspace]')) return; + const script = document.createElement('script'); + script.src = '/inventory-workspace.js?v=1.44.0'; + script.setAttribute('data-ux-inventory-workspace', 'script'); + script.async = false; + document.body.append(script); + }; + if (document.readyState === 'complete') loadBehavior(); + else window.addEventListener('load', loadBehavior, { once: true }); } function loadTemplateWorkspaceAssets() { - loadAssetPair({ key: 'template-workspace', css: '/template-workspace.css?v=1.44.0', js: '/template-workspace.js?v=1.44.0' }); + if (!document.querySelector('link[data-ux-template-workspace]')) { + const stylesheet = document.createElement('link'); + stylesheet.rel = 'stylesheet'; + stylesheet.href = '/template-workspace.css?v=1.44.0'; + stylesheet.setAttribute('data-ux-template-workspace', 'style'); + document.head.append(stylesheet); + } + const loadBehavior = () => { + if (document.querySelector('script[data-ux-template-workspace]')) return; + const script = document.createElement('script'); + script.src = '/template-workspace.js?v=1.44.0'; + script.setAttribute('data-ux-template-workspace', 'script'); + script.async = false; + document.body.append(script); + }; + if (document.readyState === 'complete') loadBehavior(); + else window.addEventListener('load', loadBehavior, { once: true }); } function loadTodayWorkspaceAssets() { - loadAssetPair({ key: 'today-workspace', css: '/today-workspace.css?v=1.44.0', js: '/today-workspace.js?v=1.44.0' }); + if (!document.querySelector('link[data-ux-today-workspace]')) { + const stylesheet = document.createElement('link'); + stylesheet.rel = 'stylesheet'; + stylesheet.href = '/today-workspace.css?v=1.44.0'; + stylesheet.setAttribute('data-ux-today-workspace', 'style'); + document.head.append(stylesheet); + } + const loadBehavior = () => { + if (document.querySelector('script[data-ux-today-workspace]')) return; + const script = document.createElement('script'); + script.src = '/today-workspace.js?v=1.44.0'; + script.setAttribute('data-ux-today-workspace', 'script'); + script.async = false; + document.body.append(script); + }; + if (document.readyState === 'complete') loadBehavior(); + else window.addEventListener('load', loadBehavior, { once: true }); } function loadSettingsControlCenterAssets() { - loadAssetPair({ key: 'settings-control-center', css: '/settings-control-center.css?v=1.44.0', js: '/settings-control-center.js?v=1.44.0' }); + if (!document.querySelector('link[data-ux-settings-control-center]')) { + const stylesheet = document.createElement('link'); + stylesheet.rel = 'stylesheet'; + stylesheet.href = '/settings-control-center.css?v=1.44.0'; + stylesheet.setAttribute('data-ux-settings-control-center', 'style'); + document.head.append(stylesheet); + } + const loadBehavior = () => { + if (document.querySelector('script[data-ux-settings-control-center]')) return; + const script = document.createElement('script'); + script.src = '/settings-control-center.js?v=1.44.0'; + script.setAttribute('data-ux-settings-control-center', 'script'); + script.async = false; + document.body.append(script); + }; + if (document.readyState === 'complete') loadBehavior(); + else window.addEventListener('load', loadBehavior, { once: true }); } applyState(readStoredState(), { persist: false, dispatch: false });