// STATUS BAR /////////////////////////////////////// // gives user feedback about pending operations. Draws current status // to website. Updates info in layer chooser. window.renderUpdateStatus = function() { var progress = 1; // portal level display var t = ''; if(!window.isSmartphone()) // space is valuable t += 'portals: '; var minlvl = getMinPortalLevel(); if(minlvl === 0) t+= 'all'; else t+= 'L'+minlvl+(minlvl<8?'+':'') + ''; t +=''; // map status display t += ' map: '; if (window.mapDataRequest) { var status = window.mapDataRequest.getStatus(); // status.short - short description of status // status.long - longer description, for tooltip (optional) // status.progress - fractional progress (from 0 to 1; -1 for indeterminate) of current state (optional) if (status.long) t += ''+status.short+''; else t += ''+status.short+''; if (status.progress !== undefined) { if(status.progress !== -1) t += ' '+Math.floor(status.progress*100)+'%'; progress = status.progress; } } else { // no mapDataRequest object - no status known t += '...unknown...'; } /* if(mapRunsUserAction) t += 'paused 0) t += window.activeRequests.length + ' requests'; else { // tooltip with detailed tile counts t += ''; // basic error/out of date/up to date message if (window.statusErrorMapTiles) t += 'Errors'; else if (window.statusStaleMapTiles) t += 'Out of date'; else t += 'Up to date'; t += ''; } */ t += ''; //request status if (window.activeRequests.length > 0) t += ' ' + window.activeRequests.length + ' requests'; if (window.failedRequestCount > 0) t += ' ' + window.failedRequestCount + ' failed' $('#innerstatus').html(t); //$('#updatestatus').click(function() { startRefreshTimeout(10); }); //. '; if(progress == 1 && window.activeRequests.length > 0) { // we don't know the exact progress, but we have requests (e.g. chat) running, so show it as indeterminate. progress = -1; } if (typeof android !== 'undefined' && android && android.setProgress) android.setProgress(progress); }