Changes

m
remove empty fleets
Line 1: Line 1:  
(function($){
 
(function($){
 
"use strict";
 
"use strict";
console.log("Fleet Reporting v0.13");
+
console.log("Fleet Reporting v0.14");
 
 
 
var routes = {};
 
var routes = {};
Line 15: Line 15:  
$(".FleetReport").each(function(){
 
$(".FleetReport").each(function(){
 
thisRoute = $(this).data("route").replace(/\W+/g, "");
 
thisRoute = $(this).data("route").replace(/\W+/g, "");
 +
 
thisFleet = [];
 
thisFleet = [];
 
if($(this).data("ship1").length < 4 && $(this).data("ship1").length > 0){ thisFleet.push($(this).data("ship1")); }
 
if($(this).data("ship1").length < 4 && $(this).data("ship1").length > 0){ thisFleet.push($(this).data("ship1")); }
Line 22: Line 23:  
if($(this).data("ship5").length < 4 && $(this).data("ship5").length > 0){ thisFleet.push($(this).data("ship5")); }
 
if($(this).data("ship5").length < 4 && $(this).data("ship5").length > 0){ thisFleet.push($(this).data("ship5")); }
 
if($(this).data("ship6").length < 4 && $(this).data("ship6").length > 0){ thisFleet.push($(this).data("ship6")); }
 
if($(this).data("ship6").length < 4 && $(this).data("ship6").length > 0){ thisFleet.push($(this).data("ship6")); }
 +
if(thisFleet.length==0) return true;
 +
 
thisFleet.sort();
 
thisFleet.sort();
 +
 
fleetIndexer = thisFleet.join("-");
 
fleetIndexer = thisFleet.join("-");
 
if(typeof routes[thisRoute] == "undefined"){
 
if(typeof routes[thisRoute] == "undefined"){
15

edits