From c90e2481a4377bc0cc4c95583116a618d521c81b Mon Sep 17 00:00:00 2001 From: simonpipe Date: Thu, 18 Dec 2025 22:19:35 +0100 Subject: [PATCH] Update ui-helper.js --- ui-helper.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ui-helper.js b/ui-helper.js index b16ad76..be0ff81 100644 --- a/ui-helper.js +++ b/ui-helper.js @@ -1,6 +1,21 @@ -// ui-helper.js - Verwaltet allgemeine UI-Elemente und Modals +// ui-helper.js - Zentrale Steuerung für Modals und allgemeine UI-Elemente window.UI = { - // Zeigt ein einfaches Informations-Fenster + openModal(modalId) { + const modal = document.getElementById(modalId); + if (modal) { + modal.classList.remove('hidden'); + modal.style.display = 'block'; + } + }, + + closeModal(modalId) { + const modal = document.getElementById(modalId); + if (modal) { + modal.classList.add('hidden'); + modal.style.display = 'none'; + } + }, + showAlert(title, message) { const modal = document.getElementById("custom-modal"); document.getElementById("custom-modal-title").textContent = title; @@ -10,7 +25,6 @@ window.UI = { document.getElementById("custom-modal-ok").onclick = () => modal.classList.add("hidden"); }, - // Zeigt ein Bestätigungs-Fenster mit Ja/Nein showConfirm(title, message, callback) { const modal = document.getElementById("custom-modal"); document.getElementById("custom-modal-title").textContent = title; @@ -29,12 +43,10 @@ window.UI = { }; }, - // Aktualisiert den Titel im Browser-Tab updateDocumentTitle(stationName) { document.title = stationName ? `${stationName} - Radioplayer` : "Radioplayer"; }, - // Füllt die Informationen im Footer aus initializeFooter() { const yearEl = document.getElementById('current-year'); const serverEl = document.getElementById('server-name');