2013-07-04 12:28:12 +00:00
|
|
|
// Check every 20 seconds via status.php if maintenance is over
|
|
|
|
window.setInterval(checkStatus, 20000);
|
|
|
|
|
|
|
|
function checkStatus() {
|
|
|
|
var request = new XMLHttpRequest();
|
2018-10-09 05:44:26 +00:00
|
|
|
request.open("GET", OC.getRootPath()+'/status.php', true);
|
2013-07-04 12:28:12 +00:00
|
|
|
request.onreadystatechange = function() {
|
|
|
|
if (request.readyState === 4) {
|
|
|
|
var response = request.responseText;
|
|
|
|
var responseobj = JSON.parse(response);
|
2015-04-08 16:02:00 +00:00
|
|
|
if (responseobj.maintenance === false) {
|
2013-07-04 12:28:12 +00:00
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2015-04-08 16:02:00 +00:00
|
|
|
request.send();
|
2013-07-04 12:28:12 +00:00
|
|
|
}
|