Portals-list code cleanup, change four to two space line indent

This commit is contained in:
Kevin
2013-04-16 21:11:34 -07:00
parent bec7ae8c95
commit f38c04f13a

View File

@ -45,7 +45,7 @@ window.plugin.portalslist.resP = 0;
window.plugin.portalslist.filter=0; window.plugin.portalslist.filter=0;
//fill the listPortals array with portals avalaible on the map (level filtered portals will not appear in the table) //fill the listPortals array with portals avalaible on the map (level filtered portals will not appear in the table)
window.plugin.portalslist.getPortals = function(){ window.plugin.portalslist.getPortals = function() {
//filter : 0 = All, 1 = Res, 2 = Enl //filter : 0 = All, 1 = Res, 2 = Enl
//console.log('** getPortals'); //console.log('** getPortals');
var retval=false; var retval=false;
@ -89,11 +89,12 @@ window.plugin.portalslist.getPortals = function(){
//get shield informations //get shield informations
var shields = []; var shields = [];
$.each(d.portalV2.linkedModArray, function(ind, mod) { $.each(d.portalV2.linkedModArray, function(ind, mod) {
if (mod) if (mod) {
//shields[ind] = mod.rarity.capitalize().replace('_', ' '); //shields[ind] = mod.rarity.capitalize().replace('_', ' ');
shields[ind] = [mod.rarity.substr(0,1).capitalize(), getPlayerName(mod.installingUser)] ; shields[ind] = [mod.rarity.substr(0,1).capitalize(), getPlayerName(mod.installingUser)] ;
else } else {
shields[ind] = ['', '']; shields[ind] = ['', ''];
}
}); });
var APgain= getAttackApGain(d).enemyAp; var APgain= getAttackApGain(d).enemyAp;
@ -193,7 +194,7 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) {
retVal = b[sortBy] - a[sortBy]; retVal = b[sortBy] - a[sortBy];
break; break;
} }
if (sortOrder > 0) { retVal = -retVal} //thx @jonatkins if (sortOrder > 0) retVal = -retVal; //thx @jonatkins
return retVal; return retVal;
}); });
@ -273,7 +274,7 @@ window.plugin.portalslist.stats = function(sortBy) {
} }
//return Html generated to export links //return Html generated to export links
window.plugin.portalslist.exportLinks = function(){ window.plugin.portalslist.exportLinks = function() {
var html=''; var html='';
var stamp = new Date().getTime(); var stamp = new Date().getTime();
@ -283,7 +284,7 @@ window.plugin.portalslist.exportLinks = function(){
return html; return html;
} }
window.plugin.portalslist.export = function(fileformat){ window.plugin.portalslist.export = function(fileformat) {
//alert('format :' + fileformat); //alert('format :' + fileformat);
var file = ''; var file = '';
var uri = ''; var uri = '';
@ -304,7 +305,7 @@ window.plugin.portalslist.export = function(fileformat){
} }
return uri; return uri;
} }
window.plugin.portalslist.exportCSV = function(){ window.plugin.portalslist.exportCSV = function() {
var csv = ''; var csv = '';
var filter = window.plugin.portalslist.filter; var filter = window.plugin.portalslist.filter;
var portals = window.plugin.portalslist.listPortals; var portals = window.plugin.portalslist.listPortals;
@ -314,7 +315,7 @@ window.plugin.portalslist.exportCSV = function(){
$.each(portals, function(ind, portal) { $.each(portals, function(ind, portal) {
if (filter === 0 || filter === portal.team){ if (filter === 0 || filter === portal.team) {
csv += portal.name + '\t' csv += portal.name + '\t'
+ portal.level + '\t' + portal.level + '\t'
+ portal.team + '\t'; + portal.team + '\t';
@ -332,7 +333,7 @@ window.plugin.portalslist.exportCSV = function(){
return csv; return csv;
} }
window.plugin.portalslist.exportKML = function(){ window.plugin.portalslist.exportKML = function() {
var kml = ''; var kml = '';
var filter = window.plugin.portalslist.filter; var filter = window.plugin.portalslist.filter;
// all portals informations are avalaible in the listPortals array // all portals informations are avalaible in the listPortals array