Merge pull request #22 from JasonMillward/gh-pages
Added portal mod information to span tool tips
This commit is contained in:
@ -34,8 +34,19 @@ window.getModDetails = function(d) {
|
|||||||
mods.push('');
|
mods.push('');
|
||||||
modsTitle.push('');
|
modsTitle.push('');
|
||||||
} else if(mod.type === 'RES_SHIELD') {
|
} 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 {
|
} else {
|
||||||
mods.push(mod.type);
|
mods.push(mod.type);
|
||||||
modsTitle.push('Unknown mod. No further details available.');
|
modsTitle.push('Unknown mod. No further details available.');
|
||||||
|
@ -86,8 +86,6 @@ window.unixTimeToHHmm = function(time) {
|
|||||||
return h + ':' + s;
|
return h + ':' + s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
window.rangeLinkClick = function() {
|
window.rangeLinkClick = function() {
|
||||||
if(window.portalRangeIndicator)
|
if(window.portalRangeIndicator)
|
||||||
window.map.fitBounds(window.portalRangeIndicator.getBounds());
|
window.map.fitBounds(window.portalRangeIndicator.getBounds());
|
||||||
@ -100,7 +98,6 @@ window.reportPortalIssue = function(info) {
|
|||||||
location.href = 'https://support.google.com/ingress?hl=en';
|
location.href = 'https://support.google.com/ingress?hl=en';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window._storedPaddedBounds = undefined;
|
window._storedPaddedBounds = undefined;
|
||||||
window.getPaddedBounds = function() {
|
window.getPaddedBounds = function() {
|
||||||
if(_storedPaddedBounds === undefined) {
|
if(_storedPaddedBounds === undefined) {
|
||||||
@ -129,7 +126,6 @@ window.getMinPortalLevel = function() {
|
|||||||
return conv[z];
|
return conv[z];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// returns number of pixels left to scroll down before reaching the
|
// returns number of pixels left to scroll down before reaching the
|
||||||
// bottom. Works similar to the native scrollTop function.
|
// bottom. Works similar to the native scrollTop function.
|
||||||
window.scrollBottom = function(elm) {
|
window.scrollBottom = function(elm) {
|
||||||
@ -137,8 +133,11 @@ window.scrollBottom = function(elm) {
|
|||||||
return elm.get(0).scrollHeight - elm.innerHeight() - elm.scrollTop();
|
return elm.get(0).scrollHeight - elm.innerHeight() - elm.scrollTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window.zoomToAndShowPortal = function(guid, latlng) {
|
window.zoomToAndShowPortal = function(guid, latlng) {
|
||||||
renderPortalDetails(guid);
|
renderPortalDetails(guid);
|
||||||
map.setView(latlng, 17);
|
map.setView(latlng, 17);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String.prototype.capitalize = function() {
|
||||||
|
return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user