diff --git a/jstrr.css b/jstrr.css index f7a4ad2..7aa2268 100644 --- a/jstrr.css +++ b/jstrr.css @@ -63,3 +63,4 @@ background: #eee; } #ranking-table tr.me {background: #fee;} +.warn {background: #f99;} diff --git a/jstrr.js b/jstrr.js index 8ecbb68..a8d5aa9 100644 --- a/jstrr.js +++ b/jstrr.js @@ -358,6 +358,7 @@ }); } function prepareStage(textfiles) { + if (textlist.length > 1) return; // Maybe 2nd time textlist = textfiles; createStage(); if ("scoreinfo" in mystate) { @@ -611,13 +612,16 @@ function wsInit() { ws = new WebSocket(wsURL); infoBox.removeEventListener("click", wsInit); + var typing = document.getElementById("typing"); ws.onopen = function () { console.log("WS-OK"); + infoBox.classList.remove("warn"); initLogin(); }; ws.onmessage = getServerMessage; ws.onclose = function () { setElementIDText("info", "No Server Connection. Click to reconnect"); + infoBox.classList.add("warn"); infoBox.addEventListener("click", wsInit); }; }