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.'); diff --git a/code/utils_misc.js b/code/utils_misc.js index 006741ea..103c1a7a 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) { @@ -137,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(); +}