|
|
@@ -231,6 +231,7 @@ function updateHeaderFromInit() {
|
|
|
}
|
|
|
|
|
|
applyStyleMods()
|
|
|
+ loadCustomJsIfEnabled()
|
|
|
|
|
|
renderNavigation()
|
|
|
applyTheme()
|
|
|
@@ -369,6 +370,17 @@ function applyTheme() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function loadCustomJsIfEnabled() {
|
|
|
+ if (!window.initResponse?.enableCustomJs || document.getElementById('olivetin-custom-js')) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const script = document.createElement('script')
|
|
|
+ script.src = '/custom-webui/custom.js'
|
|
|
+ script.async = true
|
|
|
+ script.id = 'olivetin-custom-js'
|
|
|
+ document.head.appendChild(script)
|
|
|
+}
|
|
|
+
|
|
|
function applyStyleMods() {
|
|
|
if (!window.initResponse || !window.initResponse.styleMods) {
|
|
|
return
|