remove some duplication & faster loading page

duplication fix in css files is not started
removed some enter
This commit is contained in:
MrS-1302
2025-03-17 20:03:46 +01:00
parent dfc0c362c7
commit f990e2e899
20 changed files with 379 additions and 1168 deletions

View File

@@ -1,21 +1,4 @@
(() => {
function getCookie(name) {
const cookieName = `${name}=`;
const decodedCookie = decodeURIComponent(document.cookie);
const cookieArray = decodedCookie.split(';');
for(let i = 0; i < cookieArray.length; i++) {
let cookie = cookieArray[i];
while (cookie.charAt(0) === ' ') {
cookie = cookie.substring(1);
}
if (cookie.indexOf(cookieName) === 0) {
return cookie.substring(cookieName.length, cookie.length);
}
}
return null;
}
function loadFonts() {
// Create a new style element
const style = document.createElement('style');
@@ -27,8 +10,8 @@
}
function transformLogoutPage() {
// Get current theme and school ID from cookies
const theme = getCookie('themePreference') || localStorage.getItem('themePreference') || 'light-blue';
const instituteCode = getCookie('schoolSubdomain');
const theme = cookieManager.get('themePreference') || localStorage.getItem('themePreference') || 'light-blue';
const instituteCode = cookieManager.get('schoolSubdomain');
document.documentElement.setAttribute('data-theme', theme);
// Create new HTML structure