2026-03-13 22:21:37 +01:00
|
|
|
/**
|
|
|
|
|
* Render-blocking boot script — runs synchronously before first paint.
|
|
|
|
|
*
|
|
|
|
|
* Intentionally a classic IIFE (not an ES module) so the browser executes it
|
|
|
|
|
* immediately while parsing <head>. This prevents layout flicker by applying
|
|
|
|
|
* persisted UI state (sidebar collapsed, contrast mode) before any content
|
|
|
|
|
* is rendered. Uses `var` for broadest compatibility in the sync path.
|
|
|
|
|
*/
|
2026-02-11 19:28:12 +01:00
|
|
|
(function () {
|
|
|
|
|
var root = document.documentElement;
|
|
|
|
|
root.classList.remove('no-js');
|
|
|
|
|
root.classList.add('js');
|
|
|
|
|
root.classList.add('aside-pending');
|
|
|
|
|
|
|
|
|
|
var assetBase = root.dataset.assetBase || '';
|
|
|
|
|
if (assetBase) {
|
|
|
|
|
window.APP_ASSET_BASE = assetBase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (window.localStorage.getItem('app-sidebar-collapsed') === '1') {
|
|
|
|
|
root.classList.add('sidebar-collapsed');
|
|
|
|
|
}
|
|
|
|
|
if (window.localStorage.getItem('app-sidebar-hidden') === '1') {
|
|
|
|
|
root.classList.add('sidebar-hidden');
|
|
|
|
|
}
|
|
|
|
|
var contrastValue = window.localStorage.getItem('app-contrast');
|
|
|
|
|
if (contrastValue === 'high') {
|
|
|
|
|
root.dataset.contrast = 'high';
|
|
|
|
|
} else {
|
|
|
|
|
root.dataset.contrast = 'normal';
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// ignore storage errors
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (typeof window.requestFsLightboxRefresh !== 'function') {
|
|
|
|
|
window.requestFsLightboxRefresh = function () {
|
|
|
|
|
if (typeof window.refreshFsLightbox === 'function') {
|
|
|
|
|
window.refreshFsLightbox();
|
|
|
|
|
window.__fsLightboxRefreshPending = false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
window.__fsLightboxRefreshPending = true;
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
})();
|