diff --git a/truthinquiry/static/js/game.js b/truthinquiry/static/js/game.js index 906170d..820be8d 100644 --- a/truthinquiry/static/js/game.js +++ b/truthinquiry/static/js/game.js @@ -279,10 +279,9 @@ function renderAnswerSelectionPanel() { button.appendChild(document.createTextNode("Couplable")); - button.addEventListener("click", (event) => { + button.addEventListener("click", event => { disableCulpritButtons(culpritChoices, suspect); - if (gameData["solo"] === true) event.target.textContent = "envoie des réponses..."; - else event.target.textContent = "attente des autres joueurs..."; + event.target.textContent = gameData["solo"] === true ? "Envoi des réponses\u00A0..." : "En attente des autres joueurs\u00A0..."; sendAnswers(); }); @@ -397,7 +396,6 @@ function initSock() { console.log("Connected to the server!"); }); - //TODO Send and receive userprogress when they have sent their responses socket.on("gameprogress", username => { console.log(username); }); @@ -410,7 +408,6 @@ function initSock() { }); socket.on("gamefinished", finalResults => { - console.log(finalResults); hideFirstClassElement("emotion_and_culprit_choices"); const revealScoreElement = document.createElement("h2"); revealScoreElement.classList.add("reveal_score"); diff --git a/truthinquiry/static/js/game_start_page.js b/truthinquiry/static/js/game_start_page.js index 6f1d7c1..8a68508 100644 --- a/truthinquiry/static/js/game_start_page.js +++ b/truthinquiry/static/js/game_start_page.js @@ -188,19 +188,11 @@ async function startGame() { async function joinGame(event) { username = document.getElementById("game_username").value; gameid = document.getElementById("game_room_code").value; - console.log(username); - data = {} + const data = {}; data["username"] = username; data["game_id"] = gameid; - response = makeAPIRequest("joinGame",data); - response.then((value)=>{ - console.log(value); - if (value["error"] != 0){ - //alert(value["msg"]); - } - else{ - window.location.href = "/lobby/" + gameid; - } + makeAPIRequest("joinGame", data).then(() => { + window.location.href = "/lobby/" + gameid; }, () => { event.target.textContent = "Jouer"; });