From f370e23a2d4fd776d431d1a4f4488cdc0bf39da1 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 24 Apr 2013 14:59:18 -0700 Subject: [PATCH] Add number of links and another NaN fix --- plugins/portals-list.user.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index 899a1247..4b4bfbd5 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -13,7 +13,7 @@ // ==/UserScript== /* whatsnew -* 0.0.11: Add nominal energy column, fix sort bug when opened even amounts of times, nits +* 0.0.11: Add nominal energy column and # links, fix sort bug when opened even amounts of times, nits * 0.0.10: Fixed persistent css problem with alert * 0.0.9 : bugs hunt * 0.0.8 : Aborted to avoid problems with Niantic (export portals informations as csv or kml file) @@ -100,7 +100,7 @@ window.plugin.portalslist.getPortals = function() { }); var APgain= getAttackApGain(d).enemyAp; - var thisPortal = {'portal':d,'name':name,'team':team,'level':level,'guid':guid, 'resonators':resonators,'energyratio' : Math.floor(energy/maxenergy*100), 'shields':shields, 'APgain':APgain, 'EAP' : (energy/APgain).toFixed(2), 'energy': energy, 'maxenergy':maxenergy, 'lat':portal._latlng.lat, 'lng':portal._latlng.lng, 'address': address, 'img' : img}; + var thisPortal = {'portal': d, 'name': name, 'team': team, 'level': level, 'guid': guid, 'resonators': resonators, 'energyratio': maxenergy ? Math.floor(energy/maxenergy*100) : 0, 'shields': shields, 'APgain': APgain, 'EAP': (energy/APgain).toFixed(2), 'energy': energy, 'maxenergy': maxenergy, 'links': d.portalV2.linkedEdges.length, 'lat': portal._latlng.lat, 'lng': portal._latlng.lng, 'address': address, 'img': img}; window.plugin.portalslist.listPortals.push(thisPortal); }); @@ -219,6 +219,7 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { + 'R8' + 'Energy' + '%' + + 'Links' + 'S1' + 'S2' + 'S3' @@ -249,6 +250,7 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { html += '' + prettyEnergy(portal.energy) + '' + '' + portal.energyratio + '%' + + '' + portal.links + '' + '' + portal.shields[0][0] + '' + '' + portal.shields[1][0] + '' + '' + portal.shields[2][0] + ''