Update ui-helper.js
This commit is contained in:
parent
bb7069f23a
commit
c90e2481a4
1 changed files with 17 additions and 5 deletions
22
ui-helper.js
22
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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue