mirror of https://notabug.org/acetone/ircabot.git
js creative testing
parent
308cadd9b0
commit
4b91d372c2
|
@ -55,7 +55,7 @@ function toAJAX()
|
|||
xhttp.onload = function() {
|
||||
if (reqIsFailed) {
|
||||
reqIsFailed = false;
|
||||
appendMessage("", "<b style=\"color: green\">Fine: you are online again</b>")
|
||||
objPath.removeAttribute("style", "color: red");
|
||||
}
|
||||
|
||||
const answer = JSON.parse(xhttp.responseText);
|
||||
|
@ -65,10 +65,10 @@ function toAJAX()
|
|||
}
|
||||
if (answer.serverStatusChanged) {
|
||||
if (answer.serverStatus) {
|
||||
appendMessage("***", "Connected to server. Ready to handle new messages!")
|
||||
objPath.removeAttribute("style", "color: red");
|
||||
objCurrentServerStatus.innerText = HTML_SERVER_ONLINE_MARKER;
|
||||
} else {
|
||||
appendMessage("***", "Disconnected from server. Reconnecting...")
|
||||
objPath.setAttribute("style", "color: red");
|
||||
objCurrentServerStatus.innerText = HTML_SERVER_OFFLINE_MARKER;
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ function toAJAX()
|
|||
xhttp.onerror = function() {
|
||||
if (!reqIsFailed) {
|
||||
reqIsFailed = true;
|
||||
appendMessage("", "<b style=\"color: red\">Request is failed: no response from server</b>")
|
||||
objPath.setAttribute("style", "color: red");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue