9a4c6863d1
- Add stages module with full CRUD API and admin overview island - Add mobility overview island (Liste, Kanban, Detail CRUD views) - Add contract PDF upload/download endpoints for mobilites - Add light/dark theme toggle in header - Add employeeOnly flag to hide entire modules from students (admin, students, stages) - Add read-only GET endpoints for modules/ues/ue-modules in notes module - Add [slug].tsx catch-all routes for direct URL navigation - Replace old mobility table with mobilites + stages schema (migration 0004) - Allow students to create mobilites and upload contracts - Redirect authenticated users from / to /apps catalog
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
(function () {
|
|
var t = localStorage.getItem("theme");
|
|
if (t) document.documentElement.style.colorScheme = t;
|
|
|
|
document.addEventListener("click", function (e) {
|
|
var btn = e.target.closest("#theme-toggle");
|
|
if (!btn) return;
|
|
var cs = getComputedStyle(document.documentElement).colorScheme;
|
|
var isDark = cs === "dark" ||
|
|
(!cs || cs === "light dark") &&
|
|
matchMedia("(prefers-color-scheme:dark)").matches;
|
|
var next = isDark ? "light" : "dark";
|
|
document.documentElement.style.colorScheme = next;
|
|
localStorage.setItem("theme", next);
|
|
btn.querySelector("span").textContent = next === "dark"
|
|
? "light_mode"
|
|
: "dark_mode";
|
|
});
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
var btn = document.getElementById("theme-toggle");
|
|
if (!btn) return;
|
|
var cs = getComputedStyle(document.documentElement).colorScheme;
|
|
var isDark = cs === "dark" ||
|
|
(!cs || cs === "light dark") &&
|
|
matchMedia("(prefers-color-scheme:dark)").matches;
|
|
btn.querySelector("span").textContent = isDark ? "light_mode" : "dark_mode";
|
|
});
|
|
})();
|