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();
|
2015-05-11 13:56:37 +00:00
|
|
|
request.open("GET", OC.webroot+'/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
|
|
|
}
|