Add functionality to ground vehicle and blocked MLAT filter

Add box shadow to header
This commit is contained in:
James Wilson 2017-01-26 13:38:47 -06:00
parent 6b699bffc3
commit bee850061e
4 changed files with 72 additions and 4 deletions

View file

@ -222,11 +222,11 @@
<div class="settingsColumn">
<div class="infoBlockTitleText">View Toggles</div>
<div class="settingsOptionContainer">
<div class="settingsCheckbox"></div>
<div class="settingsCheckbox" id="blockedmlat_filter"></div>
<div class="settingsText">Blocked MLAT Flights</div>
</div>
<div class="settingsOptionContainer">
<div class="settingsCheckbox"></div>
<div class="settingsCheckbox" id="groundvehicle_filter"></div>
<div class="settingsText">Ground Vehicles</div>
</div>
<div class="settingsOptionContainer">

View file

@ -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;
}

View file

@ -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("");

View file

@ -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 {