From ae04771bcc565704fab262a496c715f81ba72bde Mon Sep 17 00:00:00 2001 From: M_Viper Date: Fri, 18 Oct 2024 23:53:46 +0000 Subject: [PATCH] public/js/admin.js aktualisiert --- public/js/admin.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/js/admin.js b/public/js/admin.js index 935dd14..448c0a1 100644 --- a/public/js/admin.js +++ b/public/js/admin.js @@ -1107,4 +1107,17 @@ toggle.addEventListener('change', () => { document.body.classList.toggle('dark-mode', isChecked); // Speichere den Zustand in localStorage localStorage.setItem('darkMode', isChecked); +}); + +// Funktion, um die WEB_NAME-Variable abzurufen und einzufügen +document.addEventListener('DOMContentLoaded', () => { + fetch('/api/web-name') + .then(response => response.json()) + .then(data => { + const webName = data.name; + // Ersetze den Text im h1- und title-Tag + document.getElementById('welcome-title').textContent = `Willkommen bei ${webName}`; + document.getElementById('web-title').textContent = webName; + }) + .catch(error => console.error('Fehler beim Abrufen des Web-Namens:', error)); }); \ No newline at end of file