From f4f2f3ddad3cecb4d59a26c6eef5c2db040ac537 Mon Sep 17 00:00:00 2001 From: eric1tran Date: Wed, 2 Dec 2020 21:26:45 +0000 Subject: [PATCH 01/13] Add filtering by aircraft type --- public_html/index.html | 6 ++++++ public_html/planeObject.js | 7 +++++++ public_html/script.js | 23 +++++++++++++++++++++++ public_html/style.css | 2 +- 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/public_html/index.html b/public_html/index.html index 1e54d3a..66d584b 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -223,6 +223,12 @@ +
+ + + + +
diff --git a/public_html/planeObject.js b/public_html/planeObject.js index c55677c..dd7b6d2 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -109,6 +109,13 @@ function PlaneObject(icao) { } PlaneObject.prototype.isFiltered = function() { + // aircraft type filter + if (this.filter.aircraftTypeCode && this.icaotype !== null) { + if (typeof this.icaotype === 'string' && this.icaotype !== this.filter.aircraftTypeCode) { + return true; + } + } + if (this.filter.minAltitude !== undefined && this.filter.maxAltitude !== undefined) { if (this.altitude === null || this.altitude === undefined) { return true; diff --git a/public_html/script.js b/public_html/script.js index 99ed274..8c5010e 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -323,6 +323,10 @@ function initialize() { $("#altitude_filter_reset_button").click(onResetAltitudeFilter); + $("#aircraft_type_filter_form").submit(onFilterByAircraftType); + $("#aircraft_type_filter_reset_button").click(onResetAircraftTypeFilter); + + $('#settingsCog').on('click', function() { $('#settings_infoblock').toggle(); }); @@ -1977,6 +1981,18 @@ function onFilterByAltitude(e) { } } +function onFilterByAircraftType(e) { + e.preventDefault(); + updatePlaneFilter(); + refreshTableInfo(); +} + +function onResetAircraftTypeFilter(e) { + $("#aircraft_type_filter").val(""); + updatePlaneFilter(); + refreshTableInfo(); +} + function filterGroundVehicles(switchFilter) { if (typeof localStorage['groundVehicleFilter'] === 'undefined') { localStorage.setItem('groundVehicleFilter' , 'not_filtered'); @@ -2065,6 +2081,13 @@ function updatePlaneFilter() { PlaneFilter.minAltitude = minAltitude; PlaneFilter.maxAltitude = maxAltitude; PlaneFilter.altitudeUnits = DisplayUnits; + + var aircraftTypeCode = $("#aircraft_type_filter").val().trim() + if (aircraftTypeCode === "") { + aircraftTypeCode = undefined + } + + PlaneFilter.aircraftTypeCode = aircraftTypeCode; } function getFlightAwareIdentLink(ident, linkText) { diff --git a/public_html/style.css b/public_html/style.css index 9b2c66f..53aee08 100644 --- a/public_html/style.css +++ b/public_html/style.css @@ -329,7 +329,7 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right: background-color: #3c6ea3; } -.altitudeFilterInput { +.altitudeFilterInput, .aircraftTypeFilterInput { width: 50px; } From 0fddde5126fc32b83ae2fef3c5eca71478103001 Mon Sep 17 00:00:00 2001 From: eric1tran Date: Mon, 7 Dec 2020 15:22:42 +0000 Subject: [PATCH 02/13] Make aircraft type filter case insensitive --- public_html/planeObject.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/planeObject.js b/public_html/planeObject.js index dd7b6d2..4456600 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -110,8 +110,8 @@ function PlaneObject(icao) { PlaneObject.prototype.isFiltered = function() { // aircraft type filter - if (this.filter.aircraftTypeCode && this.icaotype !== null) { - if (typeof this.icaotype === 'string' && this.icaotype !== this.filter.aircraftTypeCode) { + if (this.filter.aircraftTypeCode) { + if (this.icaotype === null || (typeof this.icaotype === 'string' && this.icaotype.toUpperCase() !== this.filter.aircraftTypeCode.toUpperCase())) { return true; } } From d3459b1697970d385e32062875ab325acbd5349c Mon Sep 17 00:00:00 2001 From: eric1tran Date: Mon, 7 Dec 2020 16:26:56 +0000 Subject: [PATCH 03/13] Adding filtering by aircraft ident --- public_html/index.html | 10 +++++++++- public_html/planeObject.js | 6 ++++++ public_html/script.js | 23 +++++++++++++++++++++++ public_html/style.css | 6 +++++- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/public_html/index.html b/public_html/index.html index 66d584b..b3e7912 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -223,12 +223,20 @@ +
- +
+ +
+ + + + +
diff --git a/public_html/planeObject.js b/public_html/planeObject.js index 4456600..41ff0ef 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -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.altitude === null || this.altitude === undefined) { return true; diff --git a/public_html/script.js b/public_html/script.js index 8c5010e..0585967 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -327,6 +327,10 @@ function initialize() { $("#aircraft_type_filter_reset_button").click(onResetAircraftTypeFilter); + $("#aircraft_ident_filter_form").submit(onFilterByAircraftIdent); + $("#aircraft_ident_filter_reset_button").click(onResetAircraftIdentFilter); + + $('#settingsCog').on('click', function() { $('#settings_infoblock').toggle(); }); @@ -1993,6 +1997,19 @@ function onResetAircraftTypeFilter(e) { refreshTableInfo(); } + +function onFilterByAircraftIdent(e) { + e.preventDefault(); + updatePlaneFilter(); + refreshTableInfo(); +} + +function onResetAircraftIdentFilter(e) { + $("#aircraft_ident_filter").val(""); + updatePlaneFilter(); + refreshTableInfo(); +} + function filterGroundVehicles(switchFilter) { if (typeof localStorage['groundVehicleFilter'] === 'undefined') { localStorage.setItem('groundVehicleFilter' , 'not_filtered'); @@ -2087,7 +2104,13 @@ function updatePlaneFilter() { aircraftTypeCode = undefined } + var aircraftIdent = $("#aircraft_ident_filter").val().trim() + if (aircraftIdent === "") { + aircraftIdent = undefined + } + PlaneFilter.aircraftTypeCode = aircraftTypeCode; + PlaneFilter.aircraftIdent = aircraftIdent; } function getFlightAwareIdentLink(ident, linkText) { diff --git a/public_html/style.css b/public_html/style.css index 53aee08..dd8cda6 100644 --- a/public_html/style.css +++ b/public_html/style.css @@ -329,10 +329,14 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right: background-color: #3c6ea3; } -.altitudeFilterInput, .aircraftTypeFilterInput { +.altitudeFilterInput { width: 50px; } +.aircraftFilterInput { + width: 80px; +} + .rangeRingsInput { width: 30px; float: right; From e2b2ce3f63331d694dbcf2bec48177639dbb3853 Mon Sep 17 00:00:00 2001 From: eric1tran Date: Mon, 7 Dec 2020 19:37:04 +0000 Subject: [PATCH 04/13] Add checkboxes next to data source legend and css styling --- public_html/index.html | 16 ++++---- public_html/script.js | 88 ++++++++++++++++++++++++++++++++++++++++++ public_html/style.css | 24 +++++++++++- 3 files changed, 118 insertions(+), 10 deletions(-) diff --git a/public_html/index.html b/public_html/index.html index b3e7912..7c03c37 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -386,14 +386,14 @@
-
-
ADS-B
-
-
MLAT
-
-
Other
-
-
TIS-B
+
+
ADS-B
+
+
MLAT
+
+
Other
+
+
TIS-B
diff --git a/public_html/script.js b/public_html/script.js index 0585967..384261c 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -377,6 +377,22 @@ function initialize() { toggleAllColumns(true); }) + $('#adsb_datasource_checkbox').on('click', function() { + toggleADSBAircraft(true); + }) + + $('#mlat_datasource_checkbox').on('click', function() { + toggleMLATAircraft(true); + }) + + $('#other_datasource_checkbox').on('click', function() { + toggleOtherAircraft(true); + }) + + $('#tisb_datasource_checkbox').on('click', function() { + toggleTISBAircraft(true); + }) + // Event handlers for to column checkboxes checkbox_div_map.forEach(function (checkbox, div) { $(div).on('click', function() { @@ -397,6 +413,10 @@ function initialize() { toggleAllPlanes(false); toggleGroupByDataType(false); toggleAllColumns(false); + toggleADSBAircraft(false); + toggleMLATAircraft(false); + toggleOtherAircraft(false); + toggleTISBAircraft(false); // Get receiver metadata, reconfigure using it, then continue // with initialization @@ -2403,3 +2423,71 @@ function toggleAllColumns(switchToggle) { localStorage.setItem('selectAllColumnsCheckbox', selectAllColumnsCheckbox); } + +function toggleADSBAircraft(switchFilter) { + if (typeof localStorage['sourceADSBFilter'] === 'undefined') { + localStorage.setItem('sourceADSBFilter','not_filtered'); + } + + var sourceADSBFilter = localStorage.getItem('sourceADSBFilter'); + if (switchFilter === true) { + sourceADSBFilter = (sourceADSBFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + } + if (sourceADSBFilter === 'not_filtered') { + $('#adsb_datasource_checkbox').removeClass('sourceCheckboxChecked'); + } else { + $('#adsb_datasource_checkbox').addClass('sourceCheckboxChecked'); + } + localStorage.setItem('sourceADSBFilter', sourceADSBFilter); +} + +function toggleMLATAircraft(switchFilter) { + if (typeof localStorage['sourceMLATFilter'] === 'undefined') { + localStorage.setItem('sourceMLATFilter','not_filtered'); + } + + var sourceMLATFilter = localStorage.getItem('sourceMLATFilter'); + if (switchFilter === true) { + sourceMLATFilter = (sourceMLATFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + } + if (sourceMLATFilter === 'not_filtered') { + $('#mlat_datasource_checkbox').removeClass('sourceCheckboxChecked'); + } else { + $('#mlat_datasource_checkbox').addClass('sourceCheckboxChecked'); + } + localStorage.setItem('sourceMLATFilter', sourceMLATFilter); +} + +function toggleOtherAircraft(switchFilter) { + if (typeof localStorage['sourceOtherFilter'] === 'undefined') { + localStorage.setItem('sourceOtherFilter','not_filtered'); + } + + var sourceOtherFilter = localStorage.getItem('sourceOtherFilter'); + if (switchFilter === true) { + sourceOtherFilter = (sourceOtherFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + } + if (sourceOtherFilter === 'not_filtered') { + $('#other_datasource_checkbox').removeClass('sourceCheckboxChecked'); + } else { + $('#other_datasource_checkbox').addClass('sourceCheckboxChecked'); + } + localStorage.setItem('sourceOtherFilter', sourceOtherFilter); +} + +function toggleTISBAircraft(switchFilter) { + if (typeof localStorage['sourceTISBFilter'] === 'undefined') { + localStorage.setItem('sourceTISBFilter','not_filtered'); + } + + var sourceTISBFilter = localStorage.getItem('sourceTISBFilter'); + if (switchFilter === true) { + sourceTISBFilter = (sourceTISBFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + } + if (sourceTISBFilter === 'not_filtered') { + $('#tisb_datasource_checkbox').removeClass('sourceCheckboxChecked'); + } else { + $('#tisb_datasource_checkbox').addClass('sourceCheckboxChecked'); + } + localStorage.setItem('sourceTISBFilter', sourceTISBFilter); +} diff --git a/public_html/style.css b/public_html/style.css index dd8cda6..98254f1 100644 --- a/public_html/style.css +++ b/public_html/style.css @@ -271,7 +271,9 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right: } #units_container, -#altitude_filter_form { +#altitude_filter_form, +#aircraft_type_filter_form, +#aircraft_ident_filter_form { font-size: small; margin: 10px 0 10px 0; } @@ -687,8 +689,10 @@ select.error, textarea.error, input.error { .legendTitle { line-height: 19px; display: inline-block; - padding-right: 20px; + padding-right: 5px; padding-left: 5px; + border-radius: 5px; + margin-right: 20px; } #settings_infoblock { @@ -727,6 +731,22 @@ select.error, textarea.error, input.error { background-image: url('images/box-checked.png') !important; } +.sourceCheckbox { + width: 13px; + height: 13px; + background-image: url('images/box-empty.png'); + background-repeat: no-repeat; + background-position: center; + background-size: contain; + cursor: pointer; + margin-top: 3px; + margin-right: 3px; +} + +.sourceCheckboxChecked { + background-image: url('images/box-checked.png') !important; +} + .settingsCloseBox { position: absolute; right: 8px; From c466a4724f8f078c2bb84e512a5d2fb52db89853 Mon Sep 17 00:00:00 2001 From: eric1tran Date: Mon, 7 Dec 2020 22:18:16 +0000 Subject: [PATCH 05/13] Add filtering on data source --- public_html/planeObject.js | 12 ++++++++++++ public_html/script.js | 38 +++++++++++++++++++++++++------------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/public_html/planeObject.js b/public_html/planeObject.js index 41ff0ef..a5847ce 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -116,12 +116,24 @@ PlaneObject.prototype.isFiltered = function() { } } + // aircraft ident filter if (this.filter.aircraftIdent) { if (this.flight === null || (typeof this.flight === 'string' && this.flight.toUpperCase().trim() !== this.filter.aircraftIdent.toUpperCase())) { return true; } } + var dataSource = this.getDataSource(); + if (dataSource === 'adsb_icao') { + if (!this.filter.ADSB) return true; + } else if (dataSource === 'mlat') { + if (!this.filter.MLAT) return true; + } else if (dataSource === 'tisb_trackfile' || dataSource === 'tisb_icao' || dataSource === 'tisb_other') { + if (!this.filter.TISB) return true; + } else { + if (!this.filter.Other) return true; + } + if (this.filter.minAltitude !== undefined && this.filter.maxAltitude !== undefined) { if (this.altitude === null || this.altitude === undefined) { return true; diff --git a/public_html/script.js b/public_html/script.js index 384261c..ca9b51e 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -379,18 +379,22 @@ function initialize() { $('#adsb_datasource_checkbox').on('click', function() { toggleADSBAircraft(true); + refreshDataSourceFilters(); }) $('#mlat_datasource_checkbox').on('click', function() { toggleMLATAircraft(true); + refreshDataSourceFilters(); }) $('#other_datasource_checkbox').on('click', function() { toggleOtherAircraft(true); + refreshDataSourceFilters(); }) $('#tisb_datasource_checkbox').on('click', function() { toggleTISBAircraft(true); + refreshDataSourceFilters(); }) // Event handlers for to column checkboxes @@ -417,6 +421,7 @@ function initialize() { toggleMLATAircraft(false); toggleOtherAircraft(false); toggleTISBAircraft(false); + refreshDataSourceFilters(); // Get receiver metadata, reconfigure using it, then continue // with initialization @@ -2121,7 +2126,7 @@ function updatePlaneFilter() { var aircraftTypeCode = $("#aircraft_type_filter").val().trim() if (aircraftTypeCode === "") { - aircraftTypeCode = undefined + aircraftTypeCode = undefined } var aircraftIdent = $("#aircraft_ident_filter").val().trim() @@ -2133,6 +2138,13 @@ function updatePlaneFilter() { PlaneFilter.aircraftIdent = aircraftIdent; } +function refreshDataSourceFilters () { + PlaneFilter.ADSB = (localStorage.getItem('sourceADSBFilter') === 'selected') ? true : false; + PlaneFilter.MLAT = (localStorage.getItem('sourceMLATFilter') === 'selected') ? true : false; + PlaneFilter.Other = (localStorage.getItem('sourceOtherFilter') === 'selected') ? true : false; + PlaneFilter.TISB = (localStorage.getItem('sourceTISBFilter') === 'selected') ? true : false; +} + function getFlightAwareIdentLink(ident, linkText) { if (ident !== null && ident !== "") { if (!linkText) { @@ -2426,14 +2438,14 @@ function toggleAllColumns(switchToggle) { function toggleADSBAircraft(switchFilter) { if (typeof localStorage['sourceADSBFilter'] === 'undefined') { - localStorage.setItem('sourceADSBFilter','not_filtered'); + localStorage.setItem('sourceADSBFilter','deselected'); } var sourceADSBFilter = localStorage.getItem('sourceADSBFilter'); if (switchFilter === true) { - sourceADSBFilter = (sourceADSBFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + sourceADSBFilter = (sourceADSBFilter === 'deselected') ? 'selected' : 'deselected'; } - if (sourceADSBFilter === 'not_filtered') { + if (sourceADSBFilter === 'deselected') { $('#adsb_datasource_checkbox').removeClass('sourceCheckboxChecked'); } else { $('#adsb_datasource_checkbox').addClass('sourceCheckboxChecked'); @@ -2443,14 +2455,14 @@ function toggleADSBAircraft(switchFilter) { function toggleMLATAircraft(switchFilter) { if (typeof localStorage['sourceMLATFilter'] === 'undefined') { - localStorage.setItem('sourceMLATFilter','not_filtered'); + localStorage.setItem('sourceMLATFilter','deselected'); } var sourceMLATFilter = localStorage.getItem('sourceMLATFilter'); if (switchFilter === true) { - sourceMLATFilter = (sourceMLATFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + sourceMLATFilter = (sourceMLATFilter === 'deselected') ? 'selected' : 'deselected'; } - if (sourceMLATFilter === 'not_filtered') { + if (sourceMLATFilter === 'deselected') { $('#mlat_datasource_checkbox').removeClass('sourceCheckboxChecked'); } else { $('#mlat_datasource_checkbox').addClass('sourceCheckboxChecked'); @@ -2460,14 +2472,14 @@ function toggleMLATAircraft(switchFilter) { function toggleOtherAircraft(switchFilter) { if (typeof localStorage['sourceOtherFilter'] === 'undefined') { - localStorage.setItem('sourceOtherFilter','not_filtered'); + localStorage.setItem('sourceOtherFilter','deselected'); } var sourceOtherFilter = localStorage.getItem('sourceOtherFilter'); if (switchFilter === true) { - sourceOtherFilter = (sourceOtherFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + sourceOtherFilter = (sourceOtherFilter === 'deselected') ? 'selected' : 'deselected'; } - if (sourceOtherFilter === 'not_filtered') { + if (sourceOtherFilter === 'deselected') { $('#other_datasource_checkbox').removeClass('sourceCheckboxChecked'); } else { $('#other_datasource_checkbox').addClass('sourceCheckboxChecked'); @@ -2477,14 +2489,14 @@ function toggleOtherAircraft(switchFilter) { function toggleTISBAircraft(switchFilter) { if (typeof localStorage['sourceTISBFilter'] === 'undefined') { - localStorage.setItem('sourceTISBFilter','not_filtered'); + localStorage.setItem('sourceTISBFilter','deselected'); } var sourceTISBFilter = localStorage.getItem('sourceTISBFilter'); if (switchFilter === true) { - sourceTISBFilter = (sourceTISBFilter === 'not_filtered') ? 'filtered' : 'not_filtered'; + sourceTISBFilter = (sourceTISBFilter === 'deselected') ? 'selected' : 'deselected'; } - if (sourceTISBFilter === 'not_filtered') { + if (sourceTISBFilter === 'deselected') { $('#tisb_datasource_checkbox').removeClass('sourceCheckboxChecked'); } else { $('#tisb_datasource_checkbox').addClass('sourceCheckboxChecked'); From cd6d3a373bce40fd0175762e711c19dd225474bd Mon Sep 17 00:00:00 2001 From: eric1tran Date: Tue, 8 Dec 2020 17:15:17 +0000 Subject: [PATCH 06/13] Comments and spacing --- public_html/script.js | 51 ++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index ca9b51e..5cd89c3 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -411,6 +411,7 @@ function initialize() { mapResizeTimeout = setTimeout(updateMapSize, 10); }); + // Initialize settings from local storage filterGroundVehicles(false); filterBlockedMLAT(false); toggleAltitudeChart(false); @@ -1151,24 +1152,23 @@ function refreshSelected() { // emerg.className = 'hidden'; // } - $("#selected_altitude").text(format_altitude_long(selected.altitude, selected.vert_rate, DisplayUnits)); - - $('#selected_onground').text(format_onground(selected.altitude)); + $("#selected_altitude").text(format_altitude_long(selected.altitude, selected.vert_rate, DisplayUnits)); + $('#selected_onground').text(format_onground(selected.altitude)); if (selected.squawk === null || selected.squawk === '0000') { $('#selected_squawk').text('n/a'); } else { $('#selected_squawk').text(selected.squawk); } - - $('#selected_speed').text(format_speed_long(selected.gs, DisplayUnits)); - $('#selected_ias').text(format_speed_long(selected.ias, DisplayUnits)); - $('#selected_tas').text(format_speed_long(selected.tas, DisplayUnits)); - $('#selected_vertical_rate').text(format_vert_rate_long(selected.baro_rate, DisplayUnits)); - $('#selected_vertical_rate_geo').text(format_vert_rate_long(selected.geom_rate, DisplayUnits)); + + $('#selected_speed').text(format_speed_long(selected.gs, DisplayUnits)); + $('#selected_ias').text(format_speed_long(selected.ias, DisplayUnits)); + $('#selected_tas').text(format_speed_long(selected.tas, DisplayUnits)); + $('#selected_vertical_rate').text(format_vert_rate_long(selected.baro_rate, DisplayUnits)); + $('#selected_vertical_rate_geo').text(format_vert_rate_long(selected.geom_rate, DisplayUnits)); $('#selected_icao').text(selected.icao.toUpperCase()); $('#airframes_post_icao').attr('value',selected.icao); - $('#selected_track').text(format_track_long(selected.track)); + $('#selected_track').text(format_track_long(selected.track)); if (selected.seen <= 1) { $('#selected_seen').text('now'); @@ -1191,7 +1191,7 @@ function refreshSelected() { $('#selected_flag').addClass('hidden'); } - if (selected.position === null) { + if (selected.position === null) { $('#selected_position').text('n/a'); $('#selected_follow').addClass('hidden'); } else { @@ -1204,23 +1204,24 @@ function refreshSelected() { } else { $('#selected_follow').css('font-weight', 'normal'); } - } - if (selected.getDataSource() === "adsb_icao") { - $('#selected_source').text("ADS-B"); - } else if (selected.getDataSource() === "tisb_trackfile" || selected.getDataSource() === "tisb_icao" || selected.getDataSource() === "tisb_other") { - $('#selected_source').text("TIS-B"); - } else if (selected.getDataSource() === "mlat") { - $('#selected_source').text("MLAT"); - } else { - $('#selected_source').text("Other"); - } - $('#selected_category').text(selected.category ? selected.category : "n/a"); + } + + if (selected.getDataSource() === "adsb_icao") { + $('#selected_source').text("ADS-B"); + } else if (selected.getDataSource() === "tisb_trackfile" || selected.getDataSource() === "tisb_icao" || selected.getDataSource() === "tisb_other") { + $('#selected_source').text("TIS-B"); + } else if (selected.getDataSource() === "mlat") { + $('#selected_source').text("MLAT"); + } else { + $('#selected_source').text("Other"); + } + + $('#selected_category').text(selected.category ? selected.category : "n/a"); $('#selected_sitedist').text(format_distance_long(selected.sitedist, DisplayUnits)); $('#selected_rssi').text(selected.rssi.toFixed(1) + ' dBFS'); $('#selected_message_count').text(selected.messages); - $('#selected_photo_link').html(getFlightAwarePhotoLink(selected.registration)); - - $('#selected_altitude_geom').text(format_altitude_long(selected.alt_geom, selected.geom_rate, DisplayUnits)); + $('#selected_photo_link').html(getFlightAwarePhotoLink(selected.registration)); + $('#selected_altitude_geom').text(format_altitude_long(selected.alt_geom, selected.geom_rate, DisplayUnits)); $('#selected_mag_heading').text(format_track_long(selected.mag_heading)); $('#selected_true_heading').text(format_track_long(selected.true_heading)); $('#selected_ias').text(format_speed_long(selected.ias, DisplayUnits)); From 9b85a30c9144b1ba68af00507c5afc0cee92b02d Mon Sep 17 00:00:00 2001 From: eric1tran Date: Tue, 8 Dec 2020 20:34:04 +0000 Subject: [PATCH 07/13] Enable all data source checkboxes by default --- public_html/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index 5cd89c3..e520b72 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -2439,7 +2439,7 @@ function toggleAllColumns(switchToggle) { function toggleADSBAircraft(switchFilter) { if (typeof localStorage['sourceADSBFilter'] === 'undefined') { - localStorage.setItem('sourceADSBFilter','deselected'); + localStorage.setItem('sourceADSBFilter','selected'); } var sourceADSBFilter = localStorage.getItem('sourceADSBFilter'); @@ -2456,7 +2456,7 @@ function toggleADSBAircraft(switchFilter) { function toggleMLATAircraft(switchFilter) { if (typeof localStorage['sourceMLATFilter'] === 'undefined') { - localStorage.setItem('sourceMLATFilter','deselected'); + localStorage.setItem('sourceMLATFilter','selected'); } var sourceMLATFilter = localStorage.getItem('sourceMLATFilter'); @@ -2473,7 +2473,7 @@ function toggleMLATAircraft(switchFilter) { function toggleOtherAircraft(switchFilter) { if (typeof localStorage['sourceOtherFilter'] === 'undefined') { - localStorage.setItem('sourceOtherFilter','deselected'); + localStorage.setItem('sourceOtherFilter','selected'); } var sourceOtherFilter = localStorage.getItem('sourceOtherFilter'); @@ -2490,7 +2490,7 @@ function toggleOtherAircraft(switchFilter) { function toggleTISBAircraft(switchFilter) { if (typeof localStorage['sourceTISBFilter'] === 'undefined') { - localStorage.setItem('sourceTISBFilter','deselected'); + localStorage.setItem('sourceTISBFilter','selected'); } var sourceTISBFilter = localStorage.getItem('sourceTISBFilter'); From 1916fc664811ddb9febb9c2761605993a2c784bc Mon Sep 17 00:00:00 2001 From: eric1tran Date: Wed, 9 Dec 2020 15:18:05 +0000 Subject: [PATCH 08/13] Use regex match for filter comparisons --- public_html/planeObject.js | 6 +++--- public_html/script.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public_html/planeObject.js b/public_html/planeObject.js index a5847ce..a02c2ac 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -111,15 +111,15 @@ function PlaneObject(icao) { PlaneObject.prototype.isFiltered = function() { // aircraft type filter if (this.filter.aircraftTypeCode) { - if (this.icaotype === null || (typeof this.icaotype === 'string' && this.icaotype.toUpperCase() !== this.filter.aircraftTypeCode.toUpperCase())) { + if (this.icaotype === null || (typeof this.icaotype === 'string' && !this.icaotype.toUpperCase().trim().match(this.filter.aircraftTypeCode))) { return true; } } // aircraft ident filter if (this.filter.aircraftIdent) { - if (this.flight === null || (typeof this.flight === 'string' && this.flight.toUpperCase().trim() !== this.filter.aircraftIdent.toUpperCase())) { - return true; + if (this.flight === null || (typeof this.flight === 'string' && !this.flight.toUpperCase().trim().match(this.filter.aircraftIdent))) { + return true; } } diff --git a/public_html/script.js b/public_html/script.js index e520b72..a0044c7 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -2125,12 +2125,12 @@ function updatePlaneFilter() { PlaneFilter.maxAltitude = maxAltitude; PlaneFilter.altitudeUnits = DisplayUnits; - var aircraftTypeCode = $("#aircraft_type_filter").val().trim() + var aircraftTypeCode = $("#aircraft_type_filter").val().trim().toUpperCase() if (aircraftTypeCode === "") { aircraftTypeCode = undefined } - var aircraftIdent = $("#aircraft_ident_filter").val().trim() + var aircraftIdent = $("#aircraft_ident_filter").val().trim().toUpperCase() if (aircraftIdent === "") { aircraftIdent = undefined } From 47e4df2b7bdbd46c9cb7c9d51b46212f99e2aa56 Mon Sep 17 00:00:00 2001 From: eric1tran Date: Wed, 9 Dec 2020 18:22:15 +0000 Subject: [PATCH 09/13] Put filters into an accordion style dropdown --- public_html/index.html | 51 +++++++++++++++++++++--------------------- public_html/script.js | 19 ++++++++++++++++ public_html/style.css | 27 ++++++++++++++++++++++ 3 files changed, 72 insertions(+), 25 deletions(-) diff --git a/public_html/index.html b/public_html/index.html index 7c03c37..17a2151 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -213,32 +213,33 @@ -
- - - - to - - - - -
- -
- - - - -
- -
- - - - -
+
+ +
+
+ + + + to + + + + +
+
+ + + + +
-
+
+ + + + +
+
diff --git a/public_html/script.js b/public_html/script.js index a0044c7..b8aec7d 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -320,6 +320,25 @@ function initialize() { customAltitudeColors = false; } + // Accordian display logic for additional config buttons + var acc = document.getElementsByClassName("accordion"); + var i; + + for (i = 0; i < acc.length; i++) { + acc[i].addEventListener("click", function() { + /* Toggle between adding and removing the "active" class, + to highlight the button that controls the panel */ + this.classList.toggle("active"); + + /* Toggle between hiding and showing the active panel */ + var panel = this.nextElementSibling; + if (panel.style.display === "block") { + panel.style.display = "none"; + } else { + panel.style.display = "block"; + } + }); + } $("#altitude_filter_reset_button").click(onResetAltitudeFilter); diff --git a/public_html/style.css b/public_html/style.css index 98254f1..472fc09 100644 --- a/public_html/style.css +++ b/public_html/style.css @@ -60,6 +60,7 @@ html, body { float: right; background-color: #002F5D; color: #FFFFFF; + width: 125px; } #column_select_window { @@ -885,3 +886,29 @@ select.error, textarea.error, input.error { background-image: url("images/map-icon@3x.png"); } } + +/* Style the buttons that are used to open and close the accordion panel */ +.accordion { + position: relative; + background-color: #002F5D; + color: #FFFFFF; + cursor: pointer; + text-align: center; + width: 125px; +} + +.active, .accordion:hover, #column_select:hover { + background-color: #abcad8; +} + + /* Style the accordion panel. Note: hidden by default */ +.panel { + padding: 0 2px; + background-color: #E5F6FC; + display: none; + overflow: hidden; +} + +.config_button_row { + margin-top: 5px; +} \ No newline at end of file From 829fe1b5e2996a9f5c10357b395077c94bdbd429 Mon Sep 17 00:00:00 2001 From: eric1tran Date: Wed, 9 Dec 2020 23:34:32 +0000 Subject: [PATCH 10/13] Filter and Column buttons to expand panels and styling cleanup --- public_html/index.html | 231 +++++++++++++++++++++-------------------- public_html/script.js | 35 ++----- public_html/style.css | 78 ++++---------- 3 files changed, 147 insertions(+), 197 deletions(-) diff --git a/public_html/index.html b/public_html/index.html index 17a2151..ad56ad2 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -212,124 +212,125 @@
- +
- -
-
- - - - to - - - - -
-
- - - - -
- -
- - - - -
-
- + +
-