0

Update JSObserver (reliability, features, config)

* Should now hide/show the div reliably
* Message can now be customised by supplying a dict in the config file
This commit is contained in:
Thomas Lake
2012-05-25 19:05:20 +01:00
parent 942cf8d995
commit 9e8f933956
2 changed files with 53 additions and 13 deletions

View File

@@ -142,17 +142,25 @@ overviewer.views.ProgressView = Backbone.View.extend({
this.el.id = 'progressDiv';
this.el.innerHTML = 'Current Render Progress';
overviewer.map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(this.el);
this.hidden = true;
this.el.hidden = true;
$.ajaxSetup({cache: false});
},
updateProgress: function() {
e = this;
$.getJSON('progress.js', null, function(d){
e.el.hidden = false;
e.el.innerHTML = d['message'];
if (d.update > 0) {
setTimeout("e.updateProgress()", d.update);
$.getJSON('progress.json', null, function(d){
console.log(d);
if (!(d == null||d=='')) {
e.el.hidden = false;
e.el.innerHTML = d['message'];
if (d.update > 0) {
setTimeout("e.updateProgress()", d.update);
} else {
setTimeout("e.updateProgress()", 60000);
e.el.innerHTML="Hidden - d.update < 0";
e.el.hidden = true;
}
} else {
e.el.innerHTML="Hidden - !!d==false";
e.el.hidden = true;
}
});