From da5782c2ab028695ccb702824dfaeb8d76895533 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij Date: Wed, 25 Mar 2026 19:07:17 +0100 Subject: [PATCH 1/4] Use module type script instead of DOMContentLoaded wrapping in elfinder common styles --- resources/views/common_styles.blade.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/resources/views/common_styles.blade.php b/resources/views/common_styles.blade.php index 3ce5513..aa17f86 100644 --- a/resources/views/common_styles.blade.php +++ b/resources/views/common_styles.blade.php @@ -34,8 +34,7 @@ @endBassetBlock @bassetBlock('elfinderThemeSwitcherScript.js') - @endBassetBlock + @if($styleBodyElement ?? false) - @endif From 2d7e2002036f2f076e042db09d847697f03b71d6 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij Date: Wed, 25 Mar 2026 19:07:49 +0100 Subject: [PATCH 2/4] Reference document.body directly in elfinder common_styles --- resources/views/common_styles.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/common_styles.blade.php b/resources/views/common_styles.blade.php index aa17f86..5bfd732 100644 --- a/resources/views/common_styles.blade.php +++ b/resources/views/common_styles.blade.php @@ -99,7 +99,7 @@ function addElfinderLightStylesheet() { // we dont want to style the body when elfinder is loaded as a component in a backpack view // we pass true when loading elfinder inside an iframe to style the iframe body. // use the topbar and footbar darker color as the background to ease transitions - document.getElementsByTagName('body')[0].style.background = '#061325'; - document.getElementsByTagName('body')[0].style.opacity = 1; + document.body.style.background = '#061325'; + document.body.style.opacity = 1; @endif From a4f476ef95f68b5ab76f285909d29c1f64041695 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij Date: Wed, 25 Mar 2026 19:09:40 +0100 Subject: [PATCH 3/4] Simplify dark/light mode toggling for elfinder by using and toggling prefetch link elements --- resources/views/common_styles.blade.php | 85 +++++++++---------------- 1 file changed, 30 insertions(+), 55 deletions(-) diff --git a/resources/views/common_styles.blade.php b/resources/views/common_styles.blade.php index 5bfd732..9d94386 100644 --- a/resources/views/common_styles.blade.php +++ b/resources/views/common_styles.blade.php @@ -8,7 +8,20 @@ 'integrity' => 'sha384-e4Bm/JKXqLbEnnDNLZIbB0u9VBy3H9D+TNdLb22ybxTLsmtWgRhQ3/BKEgJ13zU2', 'crossorigin' => 'anonymous', ]) -@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/css/theme.min.css') +@php($elFinderLightTheme = 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/css/theme-gray.min.css') +@basset($elFinderLightTheme, false) + +@php($elFinderDarkTheme = 'https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/css/theme.min.css') +@basset($elFinderDarkTheme, false) + @basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/images/loading.svg', false) @basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/font/material.eot', false) @basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/font/material.svg', false) @@ -17,7 +30,7 @@ @basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/font/material.woff', false) @basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/font/material.ttf', false) @basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/font/material.woff2', false) -@basset('https://cdn.jsdelivr.net/gh/RobiNN1/elFinder-Material-Theme@3.0.0/Material/css/theme-gray.min.css', false) + @bassetBlock('elfinderCommonStyles.css') @endBassetBlock - + @bassetBlock('elfinderThemeSwitcherScript.js') @endBassetBlock From 838cd548fc67812c33be78ec67ae12cb3bc008a8 Mon Sep 17 00:00:00 2001 From: jnoordsij Date: Mon, 30 Mar 2026 12:17:36 +0200 Subject: [PATCH 4/4] Revert elfinderThemeSwitcherScript to be a 'classic' script again @bassetBlock does not support any way of passing/preserving the type=module attribute yet, so we should probably be safe here --- resources/views/common_styles.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/views/common_styles.blade.php b/resources/views/common_styles.blade.php index 9d94386..b5da55e 100644 --- a/resources/views/common_styles.blade.php +++ b/resources/views/common_styles.blade.php @@ -47,7 +47,8 @@ @endBassetBlock @bassetBlock('elfinderThemeSwitcherScript.js') - @endBassetBlock