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();
|
|
|
|
var ocroot = location.pathname.substr(
|
|
|
|
0, location.pathname.indexOf('index.php')
|
|
|
|
);
|
|
|
|
request.open("GET", ocroot+'status.php', true);
|
|
|
|
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
|
|
|
}
|