mirror of
https://github.com/pi-hole/web.git
synced 2026-06-09 01:06:29 +01:00
Fixed codacy issue.
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
function eventsourcetest() {
|
||||
var alInfo = $("#alInfo");
|
||||
var alSuccess = $("#alSuccess");
|
||||
var ta = document.getElementById('output');
|
||||
var source = new EventSource('php/gravity.sh.php');
|
||||
var ta = document.getElementById("output");
|
||||
var source = new EventSource("php/gravity.sh.php");
|
||||
|
||||
alInfo.show();
|
||||
alInfo.hide();
|
||||
alSuccess.hide();
|
||||
|
||||
source.addEventListener('message', function(e) {
|
||||
if(e.data == "START"){
|
||||
source.addEventListener("message", function(e) {
|
||||
if(e.data === "START"){
|
||||
alInfo.show();
|
||||
}
|
||||
else if(e.data == "SUCCESS"){
|
||||
else if(e.data === "SUCCESS"){
|
||||
alSuccess.show();
|
||||
alInfo.delay(1000).fadeOut(2000, function() { alInfo.hide(); });
|
||||
}
|
||||
else if (e.data !== '')
|
||||
else if (e.data !== "")
|
||||
{
|
||||
ta.innerHTML += e.data;
|
||||
}
|
||||
}, false);
|
||||
|
||||
// Will be called when script has finished
|
||||
source.addEventListener('error', function(e) {
|
||||
source.addEventListener("error", function(e) {
|
||||
source.close();
|
||||
}, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user