Merge branch 'statusbar' of https://github.com/hastarin/ingress-intel-total-conversion into hastarin-statusbar

This commit is contained in:
Jon Atkins 2013-05-13 00:06:18 +01:00
commit 43254bb31c
3 changed files with 26 additions and 26 deletions

View File

@ -232,13 +232,10 @@ window.setupMap = function() {
localStorage['ingress.intelmap.type']=selInd;
});
// map update status handling
map.on('movestart zoomstart', function() { window.mapRunsUserAction = true });
map.on('moveend zoomend', function() { window.mapRunsUserAction = false });
// update map hooks
map.on('movestart zoomstart', function() { window.requests.abort(); window.startRefreshTimeout(-1); });
map.on('moveend zoomend', function() { window.startRefreshTimeout(ON_MOVE_REFRESH*1000) });
// map update status handling & update map hooks
// ensures order of calls
map.on('movestart zoomstart', function() { window.mapRunsUserAction = true; window.requests.abort(); window.startRefreshTimeout(-1); });
map.on('moveend zoomend', function() { window.mapRunsUserAction = false; window.startRefreshTimeout(ON_MOVE_REFRESH*1000); });
window.addResumeFunction(window.requestData);
window.requests.addRefreshFunction(window.requestData);

View File

@ -39,17 +39,25 @@ window.requests.abort = function() {
// to website. Updates info in layer chooser.
window.renderUpdateStatus = function() {
var t = '<b>map status:</b> ';
if(mapRunsUserAction)
t += 'paused during interaction';
else if(isIdle())
t += '<span style="color:#888">Idle, not updating.</span>';
else if(window.activeRequests.length > 0)
t += window.activeRequests.length + ' requests running.';
else if(window.requests._quickRefreshPending)
t += 'refreshing...';
var t = '<div><span class="help" title="Indicates portal levels displayed. Zoom in to display lower level portals."><b>portals:</b> ';
var minlvl = getMinPortalLevel();
if(minlvl === 0)
t += 'all';
else
t += 'Up to date. <a style="cursor: pointer" onclick="startRefreshTimeout(10)" title="Refresh">⟳</a>';
t+= 'L'+minlvl+'+';
t +='</span>';
t += ' <b>map:</b> ';
if(mapRunsUserAction)
t += '<span class="help" title="Paused due to user interaction">paused</span';
else if(isIdle())
t += '<span style="color:#888">Idle</span>';
else if(window.activeRequests.length > 0)
t += window.activeRequests.length + ' requests';
else if(window.requests._quickRefreshPending)
t += 'refreshing';
else
t += 'Up to date';
if(renderLimitReached())
t += ' <span style="color:#f66" class="help" title="Can only render so much before it gets unbearably slow. Not all entities are shown. Zoom in or increase the limit (search for MAX_DRAWN_*).">RENDER LIMIT</span> '
@ -57,20 +65,15 @@ window.renderUpdateStatus = function() {
if(window.failedRequestCount > 0)
t += ' <span style="color:#f66">' + window.failedRequestCount + ' failed</span>.'
t += '<br/>(';
var minlvl = getMinPortalLevel();
if(minlvl === 0)
t += 'loading all portals';
else
t+= 'only loading portals with level '+minlvl+' and up';
t += ')';
t += '</div>';
var portalSelection = $('.leaflet-control-layers-overlays label');
portalSelection.slice(0, minlvl+1).addClass('disabled').attr('title', 'Zoom in to show those.');
portalSelection.slice(minlvl, 8).removeClass('disabled').attr('title', '');
$('#updatestatus').html(t);
//$('#updatestatus').click(function() { startRefreshTimeout(10); });
//. <a style="cursor: pointer" onclick="startRefreshTimeout(10)" title="Refresh">⟳</a>';
}

View File

@ -28,7 +28,7 @@ window.plugin.scaleBar.setup = function() {
// are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric
// system already.
if (window.isSmartphone()) {
$('head').append('<style>.leaflet-control-scale { position: absolute; bottom: 15px; left: 0px; } </style>');
$('head').append('<style>.leaflet-control-scale { position: absolute; bottom: 15px; left: 0px; margin-bottom: 20px !important; } </style>');
window.map.addControl(new L.Control.Scale({position: 'bottomleft', imperial: false, maxWidth: 200}));
} else {
$('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>');