diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index f87176a4..1d2b9855 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -261,8 +261,6 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { }); html += ''; - //html += window.plugin.portalslist.exportLinks(); - html += '
Click on portals table headers to sort by that column. ' + 'Click on All Portals, Resistant Portals, Enlightened Portals to filter
' + 'Thanks to @vita10gy & @xelio for their IITC plugins who inspired me. A @teo96 production. Vive la Résistance !
'; @@ -282,103 +280,6 @@ window.plugin.portalslist.stats = function(sortBy) { return html; } -//return Html generated to export links -window.plugin.portalslist.exportLinks = function() { - var html=''; - var stamp = new Date().getTime(); - - html+='
' - + '' - + '
'; - return html; -} - -window.plugin.portalslist.export = function(fileformat) { - //alert('format :' + fileformat); - var file = ''; - var uri = ''; - - switch (fileformat) { - case 'csv': - file = window.plugin.portalslist.exportCSV(); - break; - case 'kml': - file = window.plugin.portalslist.exportKML(); - break; - } - - if (file !== '') { - //http://stackoverflow.com/questions/4639372/export-to-csv-in-jquery - var uri = 'data:application/' + fileformat + 'csv;charset=UTF-8,' + encodeURIComponent(file); - //window.open(uri); - } - return uri; -} -window.plugin.portalslist.exportCSV = function() { - var csv = ''; - var filter = window.plugin.portalslist.filter; - var portals = window.plugin.portalslist.listPortals; - - //headers - csv += 'Portal\tLevel\tTeam\tR1\tR2\tR3\tR4\tR5\tR6\tR7\tR8\tEnergy\tS1\tS2\tS3\tS4\tAP Gain\tE/AP\tlat\tlong\n'; - - $.each(portals, function(ind, portal) { - - if (filter === 0 || filter === portal.team) { - csv += portal.name + '\t' - + portal.level + '\t' - + portal.team + '\t'; - - $.each([0, 1, 2, 3 ,4 ,5 ,6 ,7], function(ind, slot) { - csv += portal.resonators[slot][0] + '\t'; - }); - - csv += portal.energyratio + '\t' + portal.shields[0][0] + '\t' + portal.shields[1][0] + '\t' + portal.shields[2][0] + '\t' + portal.shields[3][0] + '\t' + portal.APgain + '\t' + portal.EAP + '\t'; - csv += portal.lat + '\t' + portal.lng; - csv += '\n'; - } - }); - - return csv; -} - -window.plugin.portalslist.exportKML = function() { - var kml = ''; - var filter = window.plugin.portalslist.filter; - // all portals informations are avalaible in the listPortals array - var portals = window.plugin.portalslist.listPortals; - - //headers - kml = '\n' - + 'Ingress Export'; - - // define colored markers as style0 (neutral), style1 (Resistance), style2 (Enlight) - kml += '' - + '' - + '\n'; - - $.each(portals, function(ind, portal) { - // add the portal in the kml file only if part of the filter choice - if (filter === 0 || filter === portal.team){ - // description contain picture of the portal, address and link to the Intel map - var description = '
' + portal.address - + '
Link to Intel Map
' - + ']]>'; - - kml += 'L' + Math.floor(portal.level) + ' - ' + portal.name + '' - + '' + description + '' - + '#style' + portal.team + ''; - - //coordinates - kml += '' + portal.lng + ',' + portal.lat + ',0'; - kml += '\n'; - } - }); - kml += '
'; - return kml; -} - // A little helper functon so the above isn't so messy window.plugin.portalslist.portalTableSort = function(name, by) { var retVal = 'data-sort="' + name + '"';