Added portal counter

This commit is contained in:
Riccardo Binetti 2013-05-09 02:31:58 +02:00
parent 41510dffcd
commit 0b42c52dfd

View File

@ -36,6 +36,7 @@ window.plugin.playersResonators.findReso = function(playername) {
var s = ""; var s = "";
var portalSet = {}; var portalSet = {};
var effectiveNick = ""; var effectiveNick = "";
var counter = 0;
// Assuming there can be no agents with same nick with different lower/uppercase // Assuming there can be no agents with same nick with different lower/uppercase
var nickToFind = playername.toLowerCase(); var nickToFind = playername.toLowerCase();
$.each(window.portals, function(ind, portal){ $.each(window.portals, function(ind, portal){
@ -61,6 +62,7 @@ window.plugin.playersResonators.findReso = function(playername) {
href: perma, href: perma,
onClick: zoomPortal onClick: zoomPortal
})[0].outerHTML; })[0].outerHTML;
counter += 1;
s += a + "\n"; s += a + "\n";
} }
} }
@ -69,7 +71,7 @@ window.plugin.playersResonators.findReso = function(playername) {
if (s) { if (s) {
// Showing the playername as a "fake" link to avoid the auto-mouseover effect on the first portal // Showing the playername as a "fake" link to avoid the auto-mouseover effect on the first portal
fakeLinkPlayer = '<a href="#" onClick="return false;">' + effectiveNick + '</a>' fakeLinkPlayer = '<a href="#" onClick="return false;">' + effectiveNick + '</a>'
s = fakeLinkPlayer + " has resonators on these portals:\n\n" + s; s = fakeLinkPlayer + " has resonators on " + counter + " portals:\n\n" + s;
} else { } else {
s = playername + " has no resonators in this range\n"; s = playername + " has no resonators in this range\n";
} }