// ==UserScript== // @id iitc-plugin-ap-list@xelio // @name IITC plugin: AP List // @version 0.4.2.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ // @description [@@BUILDNAME@@-@@BUILDDATE@@] List top 10 portals by AP of either faction. Other functions and controls please refer to the Userguide. // @include https://www.ingress.com/intel* // @include http://www.ingress.com/intel* // @match https://www.ingress.com/intel* // @match http://www.ingress.com/intel* // ==/UserScript== function wrapper() { // ensure plugin framework is there, even if iitc is not yet loaded if(typeof window.plugin !== 'function') window.plugin = function() {}; // PLUGIN START //////////////////////////////////////////////////////// // use own namespace for plugin window.plugin.apList = function() { }; window.plugin.apList.cachedPortals = {}; window.plugin.apList.SIDE_FRIENDLY = 0; window.plugin.apList.SIDE_ENEMY = 1; window.plugin.apList.displaySide = window.plugin.apList.SIDE_ENEMY; window.plugin.apList.sides = new Array(2); window.plugin.apList.sortedPortals = new Array(2); window.plugin.apList.playerApGainFunc = new Array(2); window.plugin.apList.topMaxCount = 10; window.plugin.apList.sideLabelClass = {}; window.plugin.apList.useCachedPortals = false; window.plugin.apList.cacheBounds; window.plugin.apList.cacheActiveZoomLevel; window.plugin.apList.destroyPortalsGuid = new Array(); window.plugin.apList.handleUpdate = function() { if(!requests.isLastRequest('getThinnedEntitiesV2')) return; plugin.apList.updateSortedPortals(); plugin.apList.updatePortalTable(plugin.apList.displaySide); } // Generate html table from top portals window.plugin.apList.updatePortalTable = function(side) { var displayEnemy = (plugin.apList.displaySide === window.plugin.apList.SIDE_ENEMY); var content = '
' + (portal ? plugin.apList.getPortalDestroyCheckbox(portal) : ' ') + ' | '; } content += ' ' + '' + (portal ? plugin.apList.getPortalApText(portal) : ' ') + ' | ' + '