From bee850061e8e453e3f62e78506f281eb522e4ad0 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 26 Jan 2017 13:38:47 -0600 Subject: [PATCH] Add functionality to ground vehicle and blocked MLAT filter Add box shadow to header --- public_html/index.html | 4 +-- public_html/planeObject.js | 14 ++++++++++ public_html/script.js | 55 ++++++++++++++++++++++++++++++++++++-- public_html/style.css | 3 +++ 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/public_html/index.html b/public_html/index.html index f1cc030..ec8f57d 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -222,11 +222,11 @@
View Toggles
-
+
Blocked MLAT Flights
-
+
Ground Vehicles
diff --git a/public_html/planeObject.js b/public_html/planeObject.js index 0d51d51..7442a94 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -86,6 +86,20 @@ PlaneObject.prototype.isFiltered = function() { return planeAltitude < this.filter.minAltitude || planeAltitude > this.filter.maxAltitude; } + // filter out ground vehicles + if (typeof this.filter.groundVehicles !== 'undefined' && this.filter.groundVehicles === 'filtered') { + if (typeof this.category === 'string' && this.category.startsWith('C')) { + return true; + } + } + + // filter out blocked MLAT flights + if (typeof this.filter.blockedMLAT !== 'undefined' && this.filter.blockedMLAT === 'filtered') { + if (typeof this.icao === 'string' && this.icao.startsWith('~')) { + return true; + } + } + return false; } diff --git a/public_html/script.js b/public_html/script.js index 5c9c592..ae33428 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -236,9 +236,23 @@ function initialize() { $('#settings_infoblock').toggle(); }); + $('#groundvehicle_filter').on('click', function() { + filterGroundVehicles(true); + refreshSelected(); + refreshHighlighted(); + refreshTableInfo(); + }); + + $('#blockedmlat_filter').on('click', function() { + filterBlockedMLAT(true); + refreshSelected(); + refreshHighlighted(); + refreshTableInfo(); + }); + $('#grouptype_checkbox').on('click', function() { if ($('#grouptype_checkbox').hasClass('settingsCheckboxChecked')) { - sortByICAO(); + sortByDistance(); } else { sortByDataSource(); } @@ -260,6 +274,9 @@ function initialize() { mapResizeTimeout = setTimeout(updateMapSize, 10); }); + filterGroundVehicles(false); + filterBlockedMLAT(false); + // Get receiver metadata, reconfigure using it, then continue // with initialization $.ajax({ url: 'data/receiver.json', @@ -955,7 +972,7 @@ function refreshTableInfo() { if (tableplane.getDataSource() === "adsb_icao") { classes += " vPosition"; - } else if (tableplane.getDataSource() === "tisb") { + } else if (tableplane.getDataSource() === "tisb_trackfile") { classes += " tisb"; } else if (tableplane.getDataSource() === "mlat") { classes += " mlat"; @@ -1444,6 +1461,40 @@ function onFilterByAltitude(e) { } } +function filterGroundVehicles(switchFilter) { + if (typeof localStorage['groundVehicleFilter'] === 'undefined') { + localStorage['groundVehicleFilter'] = 'not_filtered'; + } + var groundFilter = localStorage['groundVehicleFilter']; + if (switchFilter === true) { + groundFilter = (groundFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + } + if (groundFilter === 'not_filtered') { + $('#groundvehicle_filter').addClass('settingsCheckboxChecked'); + } else { + $('#groundvehicle_filter').removeClass('settingsCheckboxChecked'); + } + localStorage['groundVehicleFilter'] = groundFilter; + PlaneFilter.groundVehicles = groundFilter; +} + +function filterBlockedMLAT(switchFilter) { + if (typeof localStorage['blockedMLATFilter'] === 'undefined') { + localStorage['blockedMLATFilter'] = 'not_filtered'; + } + var blockedMLATFilter = localStorage['blockedMLATFilter']; + if (switchFilter === true) { + blockedMLATFilter = (blockedMLATFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + } + if (blockedMLATFilter === 'not_filtered') { + $('#blockedmlat_filter').addClass('settingsCheckboxChecked'); + } else { + $('#blockedmlat_filter').removeClass('settingsCheckboxChecked'); + } + localStorage['blockedMLATFilter'] = blockedMLATFilter; + PlaneFilter.blockedMLAT = blockedMLATFilter; +} + function onResetAltitudeFilter(e) { $("#altitude_filter_min").val(""); $("#altitude_filter_max").val(""); diff --git a/public_html/style.css b/public_html/style.css index aa92c9d..c80ba48 100644 --- a/public_html/style.css +++ b/public_html/style.css @@ -337,6 +337,8 @@ select.error, textarea.error, input.error { background: -ms-linear-gradient(#002F5D, #002F5D 60%, #021624); background: linear-gradient(#002F5D, #002F5D 60%, #021624); display: flex; + box-shadow: -6px 0px 8px #999999; + z-index: 99999; } .flightawareLogo { @@ -347,6 +349,7 @@ select.error, textarea.error, input.error { padding-right: 20px; width: 121px; height: 46px; + box-shadow:inset -12px 0 12px -12px #000000; } .adsbLogo {