web - refactor core modules, harden authorization, simplify endpoints

This commit is contained in:
2026-08-29 11:15:54 +02:00
parent e1109a07ef
commit 79d857d686
71 changed files with 8269 additions and 9119 deletions
@@ -0,0 +1,47 @@
(function () {
function switchTab(tabName, updateHash) {
const tab = document.querySelector('.content-tab-bar__item[data-tab="' + tabName + '"]');
const content = document.getElementById('tab-' + tabName);
if (!tab || !content) return;
document.querySelectorAll('.content-tab-bar__item').forEach(function (item) {
item.classList.toggle('active', item === tab);
});
document.querySelectorAll('.sb-tab-content').forEach(function (item) {
item.classList.toggle('active', item === content);
});
if (updateHash) {
history.replaceState(null, '', '#' + tabName);
}
}
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.content-tab-bar__item[data-tab]').forEach(function (tab) {
tab.addEventListener('click', function () {
switchTab(tab.dataset.tab, true);
});
});
const hash = window.location.hash.slice(1);
if (hash) {
switchTab(hash, false);
}
document.querySelectorAll('[data-confirm]').forEach(function (button) {
button.addEventListener('click', function (event) {
if (!window.confirm(button.dataset.confirm || 'Wirklich fortfahren?')) {
event.preventDefault();
}
});
});
document.querySelectorAll('[data-upload-form]').forEach(function (form) {
form.addEventListener('submit', function () {
form.classList.add('sb-uploading');
const button = form.querySelector('.sb-upload-button');
if (button) button.disabled = true;
});
});
});
})();