next fix for app.js

This commit is contained in:
oberon 2026-02-16 09:19:27 +01:00
parent 4f96b919be
commit b8b2aec67d
2 changed files with 9 additions and 11 deletions

View File

@ -21,12 +21,11 @@ document.addEventListener('DOMContentLoaded', () => {
} }
// ── Config & globale Sounds aus Template ────────────────────────────────── // ── Config & globale Sounds aus Template ──────────────────────────────────
const config = {{ config | tojson | safe }}; const config = window.mkConfig || {};
const globalSounds = {{ global_sounds | tojson | safe }}; const globalSounds = window.mkGlobalSounds || [];
window.mkConfig = config; // global verfügbar
console.log("Config im JS:", config); console.log("app.js verwendet config:", config);
console.log("Globale Sounds:", globalSounds); console.log("app.js verwendet globalSounds:", globalSounds);
// ── Status-Anzeige ───────────────────────────────────────────────────────── // ── Status-Anzeige ─────────────────────────────────────────────────────────
function updateStatus(connected, message = '') { function updateStatus(connected, message = '') {

View File

@ -167,12 +167,11 @@
{% block scripts %} {% block scripts %}
<script> <script>
// Config + globale Sounds direkt ins JS übergeben // Config + globale Sounds global verfügbar machen
const config = {{ config | tojson | safe }}; window.mkConfig = {{ config | tojson | safe }};
const globalSounds = {{ global_sounds | tojson | safe }}; window.mkGlobalSounds = {{ global_sounds | tojson | safe }};
window.mkConfig = config; // falls du es global brauchst
console.log("Config im JS:", config); console.log("window.mkConfig gesetzt:", window.mkConfig);
console.log("Globale Sounds:", globalSounds); console.log("window.mkGlobalSounds:", window.mkGlobalSounds);
</script> </script>
{% endblock %} {% endblock %}