modified: templates/quiz_multiplayer.html
This commit is contained in:
@@ -57,12 +57,10 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extra_body %}
|
{% block extra_body %}
|
||||||
<script>
|
<script>
|
||||||
// Multiplayer-Daten NUR löschen, wenn keine Spielernamen gesetzt sind
|
// Multiplayer-Daten IMMER beim Laden löschen, damit Popup immer erscheint
|
||||||
if (!localStorage.getItem('quizify_multiplayer_names')) {
|
|
||||||
localStorage.removeItem('quizify_multiplayer_names');
|
localStorage.removeItem('quizify_multiplayer_names');
|
||||||
localStorage.removeItem('quizify_multiplayer_scores');
|
localStorage.removeItem('quizify_multiplayer_scores');
|
||||||
localStorage.removeItem('quizify_multiplayer_current');
|
localStorage.removeItem('quizify_multiplayer_current');
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
{% if local_multiplayer %}
|
{% if local_multiplayer %}
|
||||||
<div id="multiplayerPopup" style="position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.7);display:flex;align-items:center;justify-content:center;z-index:2000;">
|
<div id="multiplayerPopup" style="position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.7);display:flex;align-items:center;justify-content:center;z-index:2000;">
|
||||||
@@ -106,7 +104,6 @@ let correctAnswer = "";
|
|||||||
const i18n = {{ translations|tojson }};
|
const i18n = {{ translations|tojson }};
|
||||||
|
|
||||||
window.onSpotifyWebPlaybackSDKReady = () => {
|
window.onSpotifyWebPlaybackSDKReady = () => {
|
||||||
// Musik und Quiz werden erst nach quizifyReady() gestartet!
|
|
||||||
const token = '{{ access_token }}';
|
const token = '{{ access_token }}';
|
||||||
const player = new Spotify.Player({
|
const player = new Spotify.Player({
|
||||||
name: 'Musik Quiz Player',
|
name: 'Musik Quiz Player',
|
||||||
@@ -279,13 +276,9 @@ window.onload = function() {
|
|||||||
}
|
}
|
||||||
document.getElementById('startPosition').value = getOption('startPosition', 'start');
|
document.getElementById('startPosition').value = getOption('startPosition', 'start');
|
||||||
|
|
||||||
// Popup anzeigen, wenn keine Spielernamen gesetzt sind
|
// Popup immer anzeigen, weil LocalStorage oben geleert wurde
|
||||||
if (!localStorage.getItem('quizify_multiplayer_names') && document.getElementById('multiplayerPopup')) {
|
if (document.getElementById('multiplayerPopup')) {
|
||||||
document.getElementById('multiplayerPopup').style.display = 'flex';
|
document.getElementById('multiplayerPopup').style.display = 'flex';
|
||||||
} else {
|
|
||||||
// Wenn Namen schon gesetzt, direkt Quiz starten
|
|
||||||
updateMultiplayerUI();
|
|
||||||
quizifyReady();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user