modified: templates/quiz.html
This commit is contained in:
@@ -297,6 +297,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function switchGameMode(mode) {
|
function switchGameMode(mode) {
|
||||||
|
// Beim Moduswechsel Multiplayer-Daten löschen
|
||||||
|
localStorage.removeItem('quizify_multiplayer_names');
|
||||||
|
localStorage.removeItem('quizify_multiplayer_scores');
|
||||||
|
localStorage.removeItem('quizify_multiplayer_current');
|
||||||
window.location.href = `/reset_quiz/{{ playlist_id }}?next_mode=${mode}`;
|
window.location.href = `/reset_quiz/{{ playlist_id }}?next_mode=${mode}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,6 +327,10 @@ window.onload = function() {
|
|||||||
}
|
}
|
||||||
document.getElementById('startPosition').value = getOption('startPosition', 'start');
|
document.getElementById('startPosition').value = getOption('startPosition', 'start');
|
||||||
updateMultiplayerUI();
|
updateMultiplayerUI();
|
||||||
|
// Starte Quiz nur, wenn KEIN Multiplayer-Popup offen ist
|
||||||
|
if (!document.getElementById('multiplayerPopup') || document.getElementById('multiplayerPopup').style.display === 'none') {
|
||||||
|
quizifyReady();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function onPlayDurationChange() {
|
function onPlayDurationChange() {
|
||||||
@@ -426,6 +434,18 @@ checkAnswer = function() {
|
|||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
// ...dein bisheriger onload code...
|
// ...dein bisheriger onload code...
|
||||||
updateMultiplayerUI();
|
updateMultiplayerUI();
|
||||||
|
// Starte Quiz nur, wenn KEIN Multiplayer-Popup offen ist
|
||||||
|
if (!document.getElementById('multiplayerPopup') || document.getElementById('multiplayerPopup').style.display === 'none') {
|
||||||
|
quizifyReady();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function quizifyReady() {
|
||||||
|
// Hier alles, was nach dem Schließen des Popups passieren soll
|
||||||
|
if (window.onSpotifyWebPlaybackSDKReady) {
|
||||||
|
window.onSpotifyWebPlaybackSDKReady();
|
||||||
|
}
|
||||||
|
setCorrectAnswer();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
@@ -533,6 +553,7 @@ function startMultiplayer(e) {
|
|||||||
localStorage.setItem('quizify_multiplayer_current', 0);
|
localStorage.setItem('quizify_multiplayer_current', 0);
|
||||||
document.getElementById('multiplayerPopup').style.display = 'none';
|
document.getElementById('multiplayerPopup').style.display = 'none';
|
||||||
updateMultiplayerUI();
|
updateMultiplayerUI();
|
||||||
|
quizifyReady(); // <-- Musik und Quiz jetzt starten!
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user