From 977b52639ec478c0d172aa104e8c436466f72904 Mon Sep 17 00:00:00 2001 From: JasonMillward Date: Fri, 8 Feb 2013 10:01:57 +1030 Subject: [PATCH 1/3] Removed duplicate spaces --- code/utils_misc.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index 006741ea..6d57656b 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -86,8 +86,6 @@ window.unixTimeToHHmm = function(time) { return h + ':' + s; } - - window.rangeLinkClick = function() { if(window.portalRangeIndicator) window.map.fitBounds(window.portalRangeIndicator.getBounds()); @@ -100,7 +98,6 @@ window.reportPortalIssue = function(info) { location.href = 'https://support.google.com/ingress?hl=en'; } - window._storedPaddedBounds = undefined; window.getPaddedBounds = function() { if(_storedPaddedBounds === undefined) { @@ -129,7 +126,6 @@ window.getMinPortalLevel = function() { return conv[z]; } - // returns number of pixels left to scroll down before reaching the // bottom. Works similar to the native scrollTop function. window.scrollBottom = function(elm) { From f0d2dcd7de20457afa0eca9e2332874a0b9aa33b Mon Sep 17 00:00:00 2001 From: JasonMillward Date: Fri, 8 Feb 2013 10:02:37 +1030 Subject: [PATCH 2/3] Added capitalize for strings --- code/utils_misc.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index 6d57656b..103c1a7a 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -133,8 +133,11 @@ window.scrollBottom = function(elm) { return elm.get(0).scrollHeight - elm.innerHeight() - elm.scrollTop(); } - window.zoomToAndShowPortal = function(guid, latlng) { renderPortalDetails(guid); map.setView(latlng, 17); } + +String.prototype.capitalize = function() { + return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase(); +} From f98e0845a34e2d606b4e993267f5fdffd8604304 Mon Sep 17 00:00:00 2001 From: JasonMillward Date: Fri, 8 Feb 2013 10:09:47 +1030 Subject: [PATCH 3/3] Added portal mod stats to span tooltip --- code/portal_detail_display_tools.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js index ad1d73d5..a894e3a4 100644 --- a/code/portal_detail_display_tools.js +++ b/code/portal_detail_display_tools.js @@ -34,8 +34,19 @@ window.getModDetails = function(d) { mods.push(''); modsTitle.push(''); } else if(mod.type === 'RES_SHIELD') { - mods.push(mod.rarity + ' ' + mod.displayName); - modsTitle.push(mod.rarity + ' ' + mod.displayName + '\ninstalled by: '+getPlayerName(mod.installingUser)); + + var title = mod.rarity.capitalize() + ' ' + mod.displayName + '\n'; + title += 'Installed by: '+ getPlayerName(mod.installingUser); + + title += '\nStats:'; + for (var key in mod.stats) { + if (mod.stats.hasOwnProperty(key)) { + title += '\n+' + mod.stats[key] + ' ' + key.capitalize(); + } + } + + mods.push(mod.rarity.capitalize() + ' ' + mod.displayName); + modsTitle.push(title); } else { mods.push(mod.type); modsTitle.push('Unknown mod. No further details available.');