Tweaks and Fixes
Tweaked selected planes display so it won't push plane-table around. Added link to FlightStats service and speed to selected plane table. modified: public_html/script.js modified: public_html/style.css
This commit is contained in:
parent
498b512894
commit
11d69cb54b
|
@ -38,6 +38,9 @@ function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
PlanesOnTable = data.length;
|
PlanesOnTable = data.length;
|
||||||
|
|
||||||
|
/* For special squawk tests */
|
||||||
|
//Planes['867840'].squawk = '7700';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +152,7 @@ function initialize() {
|
||||||
window.setInterval(function() {
|
window.setInterval(function() {
|
||||||
fetchData();
|
fetchData();
|
||||||
refreshTableInfo();
|
refreshTableInfo();
|
||||||
refreshSelected()
|
refreshSelected();
|
||||||
reaper();
|
reaper();
|
||||||
extendedPulse();
|
extendedPulse();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
@ -177,57 +180,86 @@ function reaper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh the detail window about the plane
|
// Refresh the detail window about the plane
|
||||||
// TODO: Find out why when deselecting it sticks
|
|
||||||
function refreshSelected() {
|
function refreshSelected() {
|
||||||
if (( SelectedPlane != "ICAO") && (SelectedPlane != null)) {
|
var selected = false;
|
||||||
var selected = Planes[SelectedPlane];
|
if (typeof SelectedPlane !== 'undefined' && SelectedPlane != "ICAO" && SelectedPlane != null) {
|
||||||
if (selected.flight == "") {
|
selected = Planes[SelectedPlane];
|
||||||
selected.flight="N/A (" + selected.icao + ")";
|
}
|
||||||
}
|
|
||||||
var html = '<table id="selectedinfo" width="100%">';
|
|
||||||
html += '<tr><td colspan="2" id="selectedinfotitle"><b>' + selected.flight + '</b><td></tr>';
|
|
||||||
// Lets hope we never see this... Aircraft Hijacking
|
|
||||||
if (selected.squawk == 7500) {
|
|
||||||
html += '<tr><td colspan="2"id="selectedinfotitle">Squawking: Aircraft Hijacking</td>'
|
|
||||||
}
|
|
||||||
// Radio Failure
|
|
||||||
if (selected.squawk == 7600) {
|
|
||||||
html += '<tr><td colspan="2" id="selectedinfotitle">Squawking: Communication Loss (Radio Failure)</td>'
|
|
||||||
}
|
|
||||||
// Emergancy
|
|
||||||
if (selected.squawk == 7700) {
|
|
||||||
html += '<tr><td colspan="2" id="selectedinfotitle">Squawking: Emergancy</td>'
|
|
||||||
}
|
|
||||||
html += '<tr><td>Altitude: ' + selected.altitude + '</td>';
|
|
||||||
|
|
||||||
if (selected.squawk != '0000') {
|
var columns = 2;
|
||||||
html += '<td>Squawk: ' + selected.squawk + '</td></tr>';
|
var html = '';
|
||||||
} else {
|
|
||||||
html += '<td>Squawk: n/a</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '<tr><td>Track: '
|
if (selected) {
|
||||||
if (selected.vTrack) {
|
html += '<table id="selectedinfo" width="100%">';
|
||||||
html += selected.track;
|
} else {
|
||||||
html += ' (' + normalizeTrack(selected.track, selected.vTrack)[1] +')</td>';
|
html += '<table id="selectedinfo" class="dim" width="100%">';
|
||||||
} else {
|
}
|
||||||
html += 'n/a';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '<td>ICAO (hex): ' + selected.icao + '</td></tr>';
|
// Flight header line including squawk if needed
|
||||||
|
if (selected && selected.flight == "") {
|
||||||
html += '<tr><td colspan="2" align="center">Lat/Long: ';
|
html += '<tr><td colspan="' + columns + '" id="selectedinfotitle"><b>N/A (' + selected.icao + ')</b>';
|
||||||
if (selected.vPosition) {
|
} else if (selected && selected.flight != "") {
|
||||||
html += selected.latitude + ', ' + selected.longitude;
|
html += '<tr><td colspan="' + columns + '" id="selectedinfotitle"><b>' + selected.flight + '</b>';
|
||||||
} else {
|
|
||||||
html += 'n/a';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '</td></tr>';
|
|
||||||
html += '</table>';
|
|
||||||
} else {
|
} else {
|
||||||
var html = '';
|
html += '<tr><td colspan="' + columns + '" id="selectedinfotitle"><b>DUMP1090</b>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selected && selected.squawk == 7500) { // Lets hope we never see this... Aircraft Hijacking
|
||||||
|
html += ' <span class="squawk7500"> Squawking: Aircraft Hijacking </span>';
|
||||||
|
} else if (selected && selected.squawk == 7600) { // Radio Failure
|
||||||
|
html += ' <span class="squawk7600"> Squawking: Radio Failure </span>';
|
||||||
|
} else if (selected && selected.squawk == 7700) { // General Emergency
|
||||||
|
html += ' <span class="squawk7700"> Squawking: General Emergency </span>';
|
||||||
|
} else if (selected && selected.flight != '') {
|
||||||
|
html += ' <a href="http://www.flightstats.com/go/FlightStatus/flightStatusByFlight.do?';
|
||||||
|
html += 'flightNumber='+selected.flight+'" target="_blank">[FlightStats]</a>';
|
||||||
|
}
|
||||||
|
html += '<td></tr>';
|
||||||
|
|
||||||
|
if (selected) {
|
||||||
|
html += '<tr><td>Altitude: ' + selected.altitude + '</td>';
|
||||||
|
} else {
|
||||||
|
html += '<tr><td>Altitude: n/a</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selected && selected.squawk != '0000') {
|
||||||
|
html += '<td>Squawk: ' + selected.squawk + '</td></tr>';
|
||||||
|
} else {
|
||||||
|
html += '<td>Squawk: n/a</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<tr><td>Speed: '
|
||||||
|
if (selected) {
|
||||||
|
html += selected.speed + ' kt';
|
||||||
|
} else {
|
||||||
|
html += 'n/a';
|
||||||
|
}
|
||||||
|
html += '</td>';
|
||||||
|
|
||||||
|
if (selected) {
|
||||||
|
html += '<td>ICAO (hex): ' + selected.icao + '</td></tr>';
|
||||||
|
} else {
|
||||||
|
html += '<td>ICAO (hex): n/a</td></tr>'; // Something is wrong if we are here
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<tr><td>Track: '
|
||||||
|
if (selected && selected.vTrack) {
|
||||||
|
html += selected.track + ' (' + normalizeTrack(selected.track, selected.vTrack)[1] +')';
|
||||||
|
} else {
|
||||||
|
html += 'n/a';
|
||||||
|
}
|
||||||
|
html += '</td><td> </td></tr>';
|
||||||
|
|
||||||
|
html += '<tr><td colspan="' + columns + '" align="center">Lat/Long: ';
|
||||||
|
if (selected && selected.vPosition) {
|
||||||
|
html += selected.latitude + ', ' + selected.longitude;
|
||||||
|
} else {
|
||||||
|
html += 'n/a';
|
||||||
|
}
|
||||||
|
html += '</td></tr>';
|
||||||
|
|
||||||
|
html += '</table>';
|
||||||
|
|
||||||
document.getElementById('plane_detail').innerHTML = html;
|
document.getElementById('plane_detail').innerHTML = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
html, body { margin: 0; padding: 0; background-color: #ffffff; font-family: Tahoma, Sans-Serif; font-size: 10pt; overflow: auto; }
|
html, body {
|
||||||
|
margin: 0; padding: 0; background-color: #ffffff; font-family: Tahoma, Sans-Serif;
|
||||||
|
font-size: 10pt; overflow: auto;
|
||||||
|
}
|
||||||
div#map_container { float: left; width: 100%; height: 100%; }
|
div#map_container { float: left; width: 100%; height: 100%; }
|
||||||
div#map_canvas { height: 100%; margin-right: 420px; }
|
div#map_canvas { height: 100%; margin-right: 420px; }
|
||||||
|
|
||||||
|
@ -6,13 +9,14 @@ div#sidebar_container { float: left; width: 410px; margin-left: -410px; height:
|
||||||
|
|
||||||
#tableinfo { font-size: x-small; font-family: monospace; }
|
#tableinfo { font-size: x-small; font-family: monospace; }
|
||||||
|
|
||||||
.vPosition { font-weight: bold; background-color: #f5fff5; }
|
.vPosition { font-weight: bold; background-color: #f5fff5; }
|
||||||
.squawk7500 { font-weight: bold; background-color: #ff5555; }
|
.squawk7500 { font-weight: bold; background-color: #ff5555; }
|
||||||
.squawk7600 { font-weight: bold; background-color: #00ffff; }
|
.squawk7600 { font-weight: bold; background-color: #00ffff; }
|
||||||
.squawk7700 { font-weight: bold; background-color: #ffff00; }
|
.squawk7700 { font-weight: bold; background-color: #ffff00; }
|
||||||
.selected { font-weight: bold; background-color: #dddddd; }
|
.selected { background-color: #dddddd; }
|
||||||
.plane_table_row { cursor: pointer; }
|
.plane_table_row { cursor: pointer; }
|
||||||
|
|
||||||
#selectedinfotitle { font-size: larger; }
|
#selectedinfotitle { font-size: larger; }
|
||||||
#selectedinfo { font-size: small; }
|
#selectedinfo { font-size: small; }
|
||||||
|
#selectedinfo a { text-decoration: none; color: blue;}
|
||||||
|
#selectedinfo.dim { opacity: 0.3; filter:alpha(opacity=30); /* For IE8 and earlier */ }
|
||||||
|
|
Loading…
Reference in a new issue