diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index e98e60e1..931fbf5a 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-portals-list@teo96 // @name IITC plugin: show list of portals // @category Info -// @version 0.0.19.@@DATETIMEVERSION@@ +// @version 0.1.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -19,7 +19,7 @@ // PLUGIN START //////////////////////////////////////////////////////// /* whatsnew - * 0.0.19: Using the new data format + * 0.1.0 : Using the new data format * 0.0.15: Add 'age' column to display how long each portal has been controlled by its current owner. * 0.0.14: Add support to new mods (S:Shield - T:Turret - LA:Link Amp - H:Heat-sink - M:Multi-hack - FA:Force Amp) * 0.0.12: Use dialog() instead of alert so the user can drag the box around @@ -64,30 +64,36 @@ window.plugin.portalslist.getPortals = function() { retval=true; var d = portal.options.data; - var teamN = 0; + var teamN = window.TEAM_NONE; switch (d.team){ case 'RESISTANCE' : window.plugin.portalslist.resP++; - teamN = 1 + teamN = window.TEAM_RES break; case 'ENLIGHTENED' : window.plugin.portalslist.enlP++; - teamN = 2; + teamN = window.TEAM_ENL; break; } + var l = window.getPortalLinks(i); + var f = window.getPortalFields(i); var thisPortal = { + 'portal': portal, 'guid': i, 'teamN': teamN, 'name': d.title, 'team': d.team, - 'level': d.level, + 'level': portal.options.level, 'health': d.health, 'resCount': d.resCount, - 'lat': d.latE6, - 'lng': d.lngE6, - 'img': d.img}; + 'img': d.img, + 'linkCount': l.in.length + l.out.length, + 'link' : l, + 'fieldCount': f.length, + 'field' : f + }; window.plugin.portalslist.listPortals.push(thisPortal); }); @@ -126,7 +132,7 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { //Array sort window.plugin.portalslist.listPortals.sort(function(a, b) { var retVal = 0; - switch (sortBy) { + switch (sortBy) { win case 'names': retVal = a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1; break; @@ -146,17 +152,21 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { + '