Adding filtering by aircraft ident
This commit is contained in:
parent
0fddde5126
commit
d3459b1697
|
|
@ -223,12 +223,20 @@
|
||||||
<button type="submit">Filter</button>
|
<button type="submit">Filter</button>
|
||||||
<button id="altitude_filter_reset_button">Reset</button>
|
<button id="altitude_filter_reset_button">Reset</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form id="aircraft_type_filter_form">
|
<form id="aircraft_type_filter_form">
|
||||||
<label><span class="infoBlockTitleText">Filter by Aircraft Type:</span></label>
|
<label><span class="infoBlockTitleText">Filter by Aircraft Type:</span></label>
|
||||||
<input id="aircraft_type_filter" name="aircraftTypeFilter" type="text" class="aircraftTypeFilterInput" maxlength="5">
|
<input id="aircraft_type_filter" name="aircraftTypeFilter" type="text" class="aircraftFilterInput" maxlength="5">
|
||||||
<button type="submit">Filter by Aircraft Type</button>
|
<button type="submit">Filter by Aircraft Type</button>
|
||||||
<button id="aircraft_type_filter_reset_button">Reset</button>
|
<button id="aircraft_type_filter_reset_button">Reset</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<form id="aircraft_ident_filter_form">
|
||||||
|
<label><span class="infoBlockTitleText">Filter by Aircraft Ident:</span></label>
|
||||||
|
<input id="aircraft_ident_filter" name="aircraftIdentFilter" type="text" class="aircraftFilterInput" maxlength="10">
|
||||||
|
<button type="submit">Filter by Aircraft Ident</button>
|
||||||
|
<button id="aircraft_ident_filter_reset_button">Reset</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button id="column_select">Select Columns</button>
|
<button id="column_select">Select Columns</button>
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,12 @@ PlaneObject.prototype.isFiltered = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.filter.aircraftIdent) {
|
||||||
|
if (this.flight === null || (typeof this.flight === 'string' && this.flight.toUpperCase().trim() !== this.filter.aircraftIdent.toUpperCase())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.filter.minAltitude !== undefined && this.filter.maxAltitude !== undefined) {
|
if (this.filter.minAltitude !== undefined && this.filter.maxAltitude !== undefined) {
|
||||||
if (this.altitude === null || this.altitude === undefined) {
|
if (this.altitude === null || this.altitude === undefined) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -327,6 +327,10 @@ function initialize() {
|
||||||
$("#aircraft_type_filter_reset_button").click(onResetAircraftTypeFilter);
|
$("#aircraft_type_filter_reset_button").click(onResetAircraftTypeFilter);
|
||||||
|
|
||||||
|
|
||||||
|
$("#aircraft_ident_filter_form").submit(onFilterByAircraftIdent);
|
||||||
|
$("#aircraft_ident_filter_reset_button").click(onResetAircraftIdentFilter);
|
||||||
|
|
||||||
|
|
||||||
$('#settingsCog').on('click', function() {
|
$('#settingsCog').on('click', function() {
|
||||||
$('#settings_infoblock').toggle();
|
$('#settings_infoblock').toggle();
|
||||||
});
|
});
|
||||||
|
|
@ -1993,6 +1997,19 @@ function onResetAircraftTypeFilter(e) {
|
||||||
refreshTableInfo();
|
refreshTableInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function onFilterByAircraftIdent(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
updatePlaneFilter();
|
||||||
|
refreshTableInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onResetAircraftIdentFilter(e) {
|
||||||
|
$("#aircraft_ident_filter").val("");
|
||||||
|
updatePlaneFilter();
|
||||||
|
refreshTableInfo();
|
||||||
|
}
|
||||||
|
|
||||||
function filterGroundVehicles(switchFilter) {
|
function filterGroundVehicles(switchFilter) {
|
||||||
if (typeof localStorage['groundVehicleFilter'] === 'undefined') {
|
if (typeof localStorage['groundVehicleFilter'] === 'undefined') {
|
||||||
localStorage.setItem('groundVehicleFilter' , 'not_filtered');
|
localStorage.setItem('groundVehicleFilter' , 'not_filtered');
|
||||||
|
|
@ -2087,7 +2104,13 @@ function updatePlaneFilter() {
|
||||||
aircraftTypeCode = undefined
|
aircraftTypeCode = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var aircraftIdent = $("#aircraft_ident_filter").val().trim()
|
||||||
|
if (aircraftIdent === "") {
|
||||||
|
aircraftIdent = undefined
|
||||||
|
}
|
||||||
|
|
||||||
PlaneFilter.aircraftTypeCode = aircraftTypeCode;
|
PlaneFilter.aircraftTypeCode = aircraftTypeCode;
|
||||||
|
PlaneFilter.aircraftIdent = aircraftIdent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFlightAwareIdentLink(ident, linkText) {
|
function getFlightAwareIdentLink(ident, linkText) {
|
||||||
|
|
|
||||||
|
|
@ -329,10 +329,14 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
|
||||||
background-color: #3c6ea3;
|
background-color: #3c6ea3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.altitudeFilterInput, .aircraftTypeFilterInput {
|
.altitudeFilterInput {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aircraftFilterInput {
|
||||||
|
width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
.rangeRingsInput {
|
.rangeRingsInput {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue