Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squawk filter on URL #67

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions html/planeObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ PlaneObject.prototype.isFiltered = function() {
return true;
}

if (onlySquawk && !this.squawk == "7500" || this.squawk == "7600" || this.squawk == "7700") {
return true;
}

if (onlyADSB && this.dataSource != "adsb" && this.dataSource != "uat") {
return true;
}
Expand Down
18 changes: 18 additions & 0 deletions html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ let tableInView = false;
let historyOutdated = false;
let onlyMLAT = false;
let onlyMilitary = false;
let onlySquawk = false;
let onlyADSB = false;
let onlySelected = false;
let onlyDataSource = null;
Expand Down Expand Up @@ -569,6 +570,11 @@ function initialize() {
largeMode = tmp;
}

if (search.has('squawk')) {
onlySquawk = search.get('squawk');
onlySquawkMode();
}

if (search.has('mobile'))
onMobile = true;
if (search.has('desktop'))
Expand Down Expand Up @@ -3237,6 +3243,18 @@ function updateCallsignFilter(e) {
refreshTableInfo();
}

function onlySquawkMode(e) {
if (e)
e.preventDefault();

$("#callsign_filter").blur();

PlaneFilter.callsign = onlySquawk;

refreshSelected();
refreshHighlighted();
refreshTableInfo();
}

function onResetTypeFilter(e) {
$("#type_filter").val("");
Expand Down