Add a loading progress bar, as it can be slow with internal webserver (100ms/request)

plus large history (120 requests).

(cherry picked from commit e1b0b7a5b6759bb7a59536efcc4d6652d92dda16)
This commit is contained in:
Oliver Jowett 2015-01-15 22:23:15 +00:00
parent 870233977c
commit dd734debc3
3 changed files with 7 additions and 2 deletions
public_html

View file

@ -165,6 +165,8 @@ function initialize() {
// disable ticking on the receiver clock, we will update it ourselves
ReceiverClock.tick = (function(){})
}
$("#loader").removeClass("hidden");
// Get receiver metadata, reconfigure using it, then continue
// with initialization
@ -192,8 +194,8 @@ var CurrentHistoryFetch = null;
var PositionHistoryBuffer = []
function start_load_history() {
if (PositionHistorySize > 0) {
console.log("Starting to load history");
$("#loader").removeClass("hidden");
$("#loader_progress").attr('max',PositionHistorySize);
console.log("Starting to load history (" + PositionHistorySize + " items)");
load_history_item(0);
} else {
endLoadHistory();
@ -207,6 +209,7 @@ function load_history_item(i) {
}
console.log("Loading history #" + i);
$("#loader_progress").attr('value',i);
$.ajax({ url: 'data/history_' + i + '.json',
timeout: 5000,