public/js/admin.js aktualisiert
This commit is contained in:
parent
c78e246496
commit
ae04771bcc
|
@ -1107,4 +1107,17 @@ toggle.addEventListener('change', () => {
|
||||||
document.body.classList.toggle('dark-mode', isChecked);
|
document.body.classList.toggle('dark-mode', isChecked);
|
||||||
// Speichere den Zustand in localStorage
|
// Speichere den Zustand in localStorage
|
||||||
localStorage.setItem('darkMode', isChecked);
|
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));
|
||||||
});
|
});
|
Loading…
Reference in New Issue