fixed table display column problem
This is the final version for this project. (I hope!)
This commit is contained in:
parent
95f90fe799
commit
402e40fc36
|
@ -101,3 +101,5 @@ PageName = "DUMP1090";
|
||||||
|
|
||||||
// Path to country flags subfolder
|
// Path to country flags subfolder
|
||||||
flag_dir = "flags-tiny";
|
flag_dir = "flags-tiny";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
<script type="text/javascript" src="dbloader.js"></script>
|
<script type="text/javascript" src="dbloader.js"></script>
|
||||||
<script type="text/javascript" src="planeObject.js"></script>
|
<script type="text/javascript" src="planeObject.js"></script>
|
||||||
<script type="text/javascript" src="formatter.js"></script>
|
<script type="text/javascript" src="formatter.js"></script>
|
||||||
<script type="text/javascript" src="script.js"></script>
|
|
||||||
<script type="text/javascript" src="flags.js"></script>
|
<script type="text/javascript" src="flags.js"></script>
|
||||||
|
<script type="text/javascript" src="script.js"></script>
|
||||||
<script type="text/javascript" src="coolclock/excanvas.js"></script>
|
<script type="text/javascript" src="coolclock/excanvas.js"></script>
|
||||||
<script type="text/javascript" src="coolclock/coolclock.js"></script>
|
<script type="text/javascript" src="coolclock/coolclock.js"></script>
|
||||||
<script type="text/javascript" src="coolclock/moreskins.js"></script>
|
<script type="text/javascript" src="coolclock/moreskins.js"></script>
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
<a href="http://www.airframes.org/" onclick="document.getElementById('horrible_hack').submit.call(document.getElementById('airframes_post')); return false;">
|
<a href="http://www.airframes.org/" onclick="document.getElementById('horrible_hack').submit.call(document.getElementById('airframes_post')); return false;">
|
||||||
<span id="selected_icao"></span>
|
<span id="selected_icao"></span>
|
||||||
</a>
|
</a>
|
||||||
<span id="selected_flag"></span>
|
<span id="selected_flag"></span>
|
||||||
<span id="selected_registration"></span>
|
<span id="selected_registration"></span>
|
||||||
<span id="selected_icaotype"></span>
|
<span id="selected_icaotype"></span>
|
||||||
<span id="selected_emergency"></span>
|
<span id="selected_emergency"></span>
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="infoblock_body">
|
<tr class="infoblock_body">
|
||||||
<td colspan=1>Position: <span id="selected_position">n/a</span></td>
|
<td colspan=2>Position: <span id="selected_position">n/a</span></td>
|
||||||
<td>Country: <span id="selected_country">n/a</span></td>
|
<td>Country: <span id="selected_country">n/a</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
@ -155,8 +155,9 @@
|
||||||
<div id="planes_table">
|
<div id="planes_table">
|
||||||
<table id="tableinfo" width="100%">
|
<table id="tableinfo" width="100%">
|
||||||
<thead style="background-color: #BBBBBB; cursor: pointer;">
|
<thead style="background-color: #BBBBBB; cursor: pointer;">
|
||||||
<td colspan="2" id="icao" onclick="sortByICAO();">ICAO</td>
|
<td id="icao" onclick="sortByICAO();">ICAO</td>
|
||||||
<td id="flight" onclick="sortByFlight();">Flight</td>
|
<td>Country</td>
|
||||||
|
<td id="flight" onclick="sortByFlight();">Flight</td>
|
||||||
<td id="squawk" onclick="sortBySquawk();" align="right">Squawk</td>
|
<td id="squawk" onclick="sortBySquawk();" align="right">Squawk</td>
|
||||||
<td id="altitude" onclick="sortByAltitude();" align="right">Altitude</td>
|
<td id="altitude" onclick="sortByAltitude();" align="right">Altitude</td>
|
||||||
<td id="speed" onclick="sortBySpeed();" align="right">Speed</td>
|
<td id="speed" onclick="sortBySpeed();" align="right">Speed</td>
|
||||||
|
@ -168,7 +169,8 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr id="plane_row_template" class="plane_table_row hidden">
|
<tr id="plane_row_template" class="plane_table_row hidden">
|
||||||
<td>ICAO</td>
|
<td>ICAO</td>
|
||||||
<td>FLIGHT</td>
|
<td>COUNTRY</td>
|
||||||
|
<td>FLIGHT</td>
|
||||||
<td align="right">SQUAWK</td>
|
<td align="right">SQUAWK</td>
|
||||||
<td align="right">ALTITUDE</td>
|
<td align="right">ALTITUDE</td>
|
||||||
<td align="right">SPEED</td>
|
<td align="right">SPEED</td>
|
||||||
|
|
|
@ -46,7 +46,8 @@ function processReceiverUpdate(data) {
|
||||||
|
|
||||||
// Detect stats reset
|
// Detect stats reset
|
||||||
if (MessageCountHistory.length > 0 && MessageCountHistory[MessageCountHistory.length-1].messages > data.messages) {
|
if (MessageCountHistory.length > 0 && MessageCountHistory[MessageCountHistory.length-1].messages > data.messages) {
|
||||||
MessageCountHistory = [{'time' : MessageCountHistory[MessageCountHistory.length-1].time, 'messages' : 0}];
|
MessageCountHistory = [{'time' : MessageCountHistory[MessageCountHistory.length-1].time,
|
||||||
|
'messages' : 0}];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note the message count in the history
|
// Note the message count in the history
|
||||||
|
@ -68,27 +69,26 @@ function processReceiverUpdate(data) {
|
||||||
} else {
|
} else {
|
||||||
plane = new PlaneObject(hex);
|
plane = new PlaneObject(hex);
|
||||||
plane.tr = PlaneRowTemplate.cloneNode(true);
|
plane.tr = PlaneRowTemplate.cloneNode(true);
|
||||||
|
|
||||||
// Lookup ICAO country flag
|
// Lookup ICAO country flag
|
||||||
var hexa = +("0x" + hex);
|
var hexa = +("0x" + hex);
|
||||||
|
|
||||||
for (var i = 0; i < ICAO_Codes.length; i++) {
|
for (var i = 0; i < ICAO_Codes.length; i++) {
|
||||||
if ( hexa >= ICAO_Codes[i].start && hexa <= ICAO_Codes[i].end) {
|
if ( hexa >= ICAO_Codes[i].start && hexa <= ICAO_Codes[i].end) {
|
||||||
plane.Country = ICAO_Codes[i].Country;
|
plane.Country = ICAO_Codes[i].Country;
|
||||||
plane.Flag = '<img src="' + flag_dir + '/' + ICAO_Codes[i].icon_fn + '" title="' + ICAO_Codes[i].Country + '\">';
|
plane.Flag = '<img src="' + flag_dir + '/' + ICAO_Codes[i].icon_fn + '" title="' + ICAO_Codes[i].Country + '\">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// end of flag lookup
|
// end of flag lookup
|
||||||
|
|
||||||
|
|
||||||
if (hex[0] === '~') {
|
if (hex[0] === '~') {
|
||||||
// Non-ICAO address
|
// Non-ICAO address
|
||||||
plane.tr.cells[0].textContent = hex.substring(1);
|
plane.tr.cells[0].textContent = hex.substring(1);
|
||||||
$(plane.tr).css('font-style', 'italic');
|
$(plane.tr).css('font-style', 'italic');
|
||||||
plane.tr.cells[1].textContent = ("");
|
plane.tr.cells[1].textContent = null;
|
||||||
} else {
|
} else {
|
||||||
plane.tr.cells[0].textContent = (hex);
|
plane.tr.cells[0].textContent = hex;
|
||||||
plane.tr.cells[1].innerHTML = (plane.Flag);
|
plane.tr.cells[1].innerHTML = plane.Flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
plane.tr.addEventListener('click', selectPlaneByHex.bind(undefined,hex,false));
|
plane.tr.addEventListener('click', selectPlaneByHex.bind(undefined,hex,false));
|
||||||
|
@ -324,7 +324,7 @@ function initialize_map() {
|
||||||
sortByDistance();
|
sortByDistance();
|
||||||
} else {
|
} else {
|
||||||
SitePosition = null;
|
SitePosition = null;
|
||||||
PlaneRowTemplate.cells[5].style.display = 'none'; // hide distance column
|
PlaneRowTemplate.cells[6].style.display = 'none'; // hide distance column
|
||||||
document.getElementById("distance").style.display = 'none'; // hide distance header
|
document.getElementById("distance").style.display = 'none'; // hide distance header
|
||||||
sortByAltitude();
|
sortByAltitude();
|
||||||
}
|
}
|
||||||
|
@ -465,12 +465,12 @@ function initialize_map() {
|
||||||
title: SiteName,
|
title: SiteName,
|
||||||
zIndex: -99999
|
zIndex: -99999
|
||||||
});
|
});
|
||||||
|
|
||||||
if (SiteCircles) {
|
if (SiteCircles) {
|
||||||
for (var i=0;i<SiteCirclesDistances.length;i++) {
|
for (var i=0;i<SiteCirclesDistances.length;i++) {
|
||||||
drawCircle(marker, SiteCirclesDistances[i]); // in meters
|
drawCircle(marker, SiteCirclesDistances[i]); // in meters
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,11 +608,16 @@ function refreshSelected() {
|
||||||
$('#selected_seen').text(selected.seen.toFixed(1) + 's');
|
$('#selected_seen').text(selected.seen.toFixed(1) + 's');
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the country and flag to the selected section
|
// add the country and flag
|
||||||
$('#selected_country').text(selected.Country);
|
$('#selected_country').text(selected.Country);
|
||||||
if (selected.Flag !== null) {
|
if (selected.Flag !== null) {
|
||||||
$('#selected_flag').html(selected.Flag);
|
//$('#selected_flag').html('<img src="' + flag_dir + '/' + selected.flag.icon_fn + '" height=12 width=20 title="' + selected.flag.Country + '">' + NBSP + selected.flag.Country);
|
||||||
}
|
$('#selected_flag').html(selected.Flag);
|
||||||
|
} else {
|
||||||
|
$('#selected_flag').text('Unrecognized');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (selected.position === null) {
|
if (selected.position === null) {
|
||||||
$('#selected_position').text('n/a');
|
$('#selected_position').text('n/a');
|
||||||
|
@ -671,14 +676,13 @@ function refreshTableInfo() {
|
||||||
|
|
||||||
// ICAO doesn't change
|
// ICAO doesn't change
|
||||||
tableplane.tr.cells[2].textContent = (tableplane.flight !== null ? tableplane.flight : "");
|
tableplane.tr.cells[2].textContent = (tableplane.flight !== null ? tableplane.flight : "");
|
||||||
tableplane.tr.cells[3].textContent = (tableplane.squawk !== null ? tableplane.squawk : "");
|
tableplane.tr.cells[3].textContent = (tableplane.squawk !== null ? tableplane.squawk : "");
|
||||||
tableplane.tr.cells[4].textContent = format_altitude_brief(tableplane.altitude, tableplane.vert_rate);
|
tableplane.tr.cells[4].textContent = format_altitude_brief(tableplane.altitude, tableplane.vert_rate);
|
||||||
tableplane.tr.cells[5].textContent = format_speed_brief(tableplane.speed);
|
tableplane.tr.cells[5].textContent = format_speed_brief(tableplane.speed);
|
||||||
tableplane.tr.cells[6].textContent = format_distance_brief(tableplane.sitedist);
|
tableplane.tr.cells[6].textContent = format_distance_brief(tableplane.sitedist);
|
||||||
tableplane.tr.cells[7].textContent = format_track_brief(tableplane.track);
|
tableplane.tr.cells[7].textContent = format_track_brief(tableplane.track);
|
||||||
tableplane.tr.cells[8].textContent = tableplane.messages;
|
tableplane.tr.cells[8].textContent = tableplane.messages;
|
||||||
tableplane.tr.cells[9].textContent = tableplane.seen.toFixed(0);
|
tableplane.tr.cells[9].textContent = tableplane.seen.toFixed(0);
|
||||||
|
|
||||||
tableplane.tr.className = classes;
|
tableplane.tr.className = classes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue