diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index 63a149e3..70e4a62c 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -48,7 +48,7 @@ window.plugin.portalslist.listPortals = []; window.plugin.portalslist.sortOrder=-1; window.plugin.portalslist.enlP = 0; window.plugin.portalslist.resP = 0; -window.plugin.portalslist.filter=0; +window.plugin.portalslist.filter = 0; //fill the listPortals array with portals avaliable on the map (level filtered portals will not appear in the table) window.plugin.portalslist.getPortals = function() { @@ -121,9 +121,6 @@ window.plugin.portalslist.displayPL = function() { width: 700 }); } - - //run the name resolving process - //resolvePlayerNames(); } window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { @@ -142,26 +139,35 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { retVal = b[sortBy] - a[sortBy]; break; } + + // break sort ties by comparing guids - ensures consistant sort order + if (retVal == 0) retVal = a.guid < b.guid ? -1 : 1; + if (sortOrder > 0) retVal = -retVal; //thx @jonatkins return retVal; }); - var sort = window.plugin.portalslist.portalTableSort; + var sortAttr = window.plugin.portalslist.portalTableHeaderSortAttr; var html = window.plugin.portalslist.stats(); html += '
Portal | ' - + 'Level | ' - + 'Team | ' - + 'Health | ' - + 'Resonators | ' - + 'Links | ' - + 'Fields | ' + + '|
---|---|---|---|---|---|---|---|
# | ' + + 'Portal | ' + + 'Level | ' + + 'Team | ' + + 'Health | ' + + 'Resonators | ' + + 'Links | ' + + 'Fields | ' + var rowNum = 1; $.each(portals, function(ind, portal) { if (filter === TEAM_NONE || filter === portal.teamN) { + html += '
' + window.plugin.portalslist.getPortalLink(portal, portal.guid) + ' | ' + + ''+rowNum+' | ' + + '' + window.plugin.portalslist.getPortalLink(portal, portal.guid) + ' | ' + '' + portal.level + ' | ' + '' + portal.team.substr(0,3) + ' | '; @@ -171,6 +177,8 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { + '' + portal.fieldCount + ' | '; html+= '