Test d'optimisayion de la file d'attente
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d1a5989845
commit
3aa57e274a
@ -1,3 +1,21 @@
|
|||||||
function displayWaiting(){
|
function displayWaiting(){
|
||||||
document.getElementById("waiting").innerHTML = "Waiting for Coders...";
|
document.getElementById("waiting").innerHTML = "Waiting for Coders...";
|
||||||
|
document.getElementsByClassName("btn").style.display = "none"
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkIsReady() {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=waiting', true);
|
||||||
|
xhr.responseType = 'text';
|
||||||
|
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||||
|
xhr.onload = function () {
|
||||||
|
if (xhr.responseText == "1") {
|
||||||
|
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=goToGame&idPartie=" . $idPartie . "&index=1"'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xhr.send(null);
|
||||||
|
}
|
||||||
|
function waiting(){
|
||||||
|
displayWaiting();
|
||||||
|
var countdownTimer = setInterval('checkIsReady()', 1000);
|
||||||
}
|
}
|
Loading…
Reference in new issue