fixed table display column problem

This is the final version for this project. (I hope!)
This commit is contained in:
Dynomity 2015-08-30 10:16:40 -06:00
parent 95f90fe799
commit 402e40fc36
3 changed files with 36 additions and 28 deletions

View file

@ -101,3 +101,5 @@ PageName = "DUMP1090";
// Path to country flags subfolder // Path to country flags subfolder
flag_dir = "flags-tiny"; flag_dir = "flags-tiny";

View file

@ -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>
@ -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,7 +155,8 @@
<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>Country</td>
<td id="flight" onclick="sortByFlight();">Flight</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>
@ -168,6 +169,7 @@
<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>COUNTRY</td>
<td>FLIGHT</td> <td>FLIGHT</td>
<td align="right">SQUAWK</td> <td align="right">SQUAWK</td>
<td align="right">ALTITUDE</td> <td align="right">ALTITUDE</td>

View file

@ -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
@ -80,15 +81,14 @@ function processReceiverUpdate(data) {
} }
// 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();
} }
@ -466,7 +466,7 @@ function initialize_map() {
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,12 +608,17 @@ 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('<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); $('#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');
$('#selected_follow').addClass('hidden'); $('#selected_follow').addClass('hidden');
@ -678,7 +683,6 @@ function refreshTableInfo() {
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;
} }