Merge latest for clean apply in pull

This commit is contained in:
Kevin
2013-03-27 16:55:01 -07:00
25 changed files with 1092 additions and 139 deletions

View File

@ -219,7 +219,14 @@ window.plugin.playerTracker.getLatLngFromEvent = function(ev) {
}
window.plugin.playerTracker.ago = function(time, now) {
return parseInt((now-time)/(1000*60));
var s = (now-time) / 1000;
var h = Math.floor(s / 3600);
var m = Math.floor((s % 3600) / 60);
var returnVal = m + 'm';
if(h > 0) {
returnVal = h + 'h' + returnVal;
}
return returnVal;
}
window.plugin.playerTracker.drawData = function() {
@ -252,10 +259,10 @@ window.plugin.playerTracker.drawData = function() {
var cssClass = playerData.team === 'ALIENS' ? 'enl' : 'res';
var title =
'<span class="nickname '+ cssClass+'" style="font-weight:bold;">' + playerData.nick + '</span>\n'
+ ago(last.time, now) + ' minutes ago\n'
+ ago(last.time, now) + ' ago\n'
+ last.name;
// show previous data in tooltip
var minsAgo = '\t<span style="white-space: nowrap;">mins ago</span>\t';
var minsAgo = '\t<span style="white-space: nowrap;"> ago</span>\t';
if(evtsLength >= 2)
title += '\n&nbsp;\nprevious locations:\n';
for(var i = evtsLength - 2; i >= 0 && i >= evtsLength - 10; i--) {