Small bugs and cleaned squawkdisplay

modified:   public_html/script.js
	modified:   public_html/style.css
This commit is contained in:
terribl 2013-05-25 14:06:31 +03:00
parent 9c465c174b
commit e22cff4bd2
2 changed files with 28 additions and 10 deletions

View file

@ -198,7 +198,12 @@ function refreshSelected() {
if (selected.squawk == 7700) { if (selected.squawk == 7700) {
html += '<tr><td colspan="2" id="selectedinfotitle">Squawking: Emergancy</td>' html += '<tr><td colspan="2" id="selectedinfotitle">Squawking: Emergancy</td>'
} }
html += '<tr><td>Altitude: ' + selected.altitude + '</td><td>Squawk: ' + selected.squawk + '</td></tr>'; html += '<tr><td>Altitude: ' + selected.altitude + '</td>';
if (selected.squawk != '0000') {
html += '<td>Squawk: ' + selected.squawk + '</td></tr>';
} else {
html += '<td>Squawk: n/a</td></tr>';
}
html += '<tr><td>Track: ' + selected.track + ' (' + normalizeTrack(selected.track, selected.vTrack)[1] +')</td><td>ICAO (hex): ' + selected.icao + '</td></tr>'; html += '<tr><td>Track: ' + selected.track + ' (' + normalizeTrack(selected.track, selected.vTrack)[1] +')</td><td>ICAO (hex): ' + selected.icao + '</td></tr>';
html += '<tr><td colspan="2" align="center">Lat/Long: ' + selected.latitude + ', ' + selected.longitude + '</td></tr>'; html += '<tr><td colspan="2" align="center">Lat/Long: ' + selected.latitude + ', ' + selected.longitude + '</td></tr>';
html += '</table>'; html += '</table>';
@ -284,13 +289,20 @@ function refreshTableInfo() {
if (tableplane.squawk == 7700) { if (tableplane.squawk == 7700) {
specialStyle += " squawk7700"; specialStyle += " squawk7700";
} }
if (tableplane.vPosition == true)
if (tableplane.vPosition == true) {
html += '<tr class="plane_table_row vPosition' + specialStyle + '">'; html += '<tr class="plane_table_row vPosition' + specialStyle + '">';
else } else {
html += '<tr class="plane_table_row ' + specialStyle + '">'; html += '<tr class="plane_table_row ' + specialStyle + '">';
}
html += '<td>' + tableplane.icao + '</td>'; html += '<td>' + tableplane.icao + '</td>';
html += '<td>' + tableplane.flight + '</td>'; html += '<td>' + tableplane.flight + '</td>';
if (tableplane.squawk != '0000' ) {
html += '<td align="right">' + tableplane.squawk + '</td>'; html += '<td align="right">' + tableplane.squawk + '</td>';
} else {
html += '<td align="right">&nbsp;</td>';
}
html += '<td align="right">' + tableplane.altitude + '</td>'; html += '<td align="right">' + tableplane.altitude + '</td>';
html += '<td align="right">' + tableplane.speed + '</td>'; html += '<td align="right">' + tableplane.speed + '</td>';
html += '<td align="right">' + normalizeTrack(tableplane.track, tableplane.vTrack)[2] + ' (' + normalizeTrack(tableplane.track, tableplane.vTrack)[1] + ')</td>'; html += '<td align="right">' + normalizeTrack(tableplane.track, tableplane.vTrack)[2] + ' (' + normalizeTrack(tableplane.track, tableplane.vTrack)[1] + ')</td>';
@ -341,14 +353,20 @@ function sortTable(szTableID,iCol) {
var aStore=[]; var aStore=[];
//If supplied col # is greater than the actual number of cols, set sel col = to last col //If supplied col # is greater than the actual number of cols, set sel col = to last col
if (oTbl.rows[0].cells.length<=iCol) if (typeof oTbl.rows[0] !== 'undefined' && oTbl.rows[0].cells.length <= iCol) {
iCol=(oTbl.rows[0].cells.length-1); iCol=(oTbl.rows[0].cells.length-1);
}
//store the col # //store the col #
iSortCol=iCol; iSortCol=iCol;
//determine if we are delaing with numerical, or alphanumeric content //determine if we are delaing with numerical, or alphanumeric content
bNumeric=!isNaN(parseFloat(oTbl.rows[0].cells[iSortCol].textContent||oTbl.rows[0].cells[iSortCol].innerText))?true:false; var bNumeric = false;
if ((typeof oTbl.rows[0] !== 'undefined') &&
(!isNaN(parseFloat(oTbl.rows[0].cells[iSortCol].textContent ||
oTbl.rows[0].cells[iSortCol].innerText)))) {
bNumeric = true;
}
//loop through the rows, storing each one inro aStore //loop through the rows, storing each one inro aStore
for (var i=0,iLen=oTbl.rows.length;i<iLen;i++){ for (var i=0,iLen=oTbl.rows.length;i<iLen;i++){
@ -362,9 +380,10 @@ function sortTable(szTableID,iCol) {
aStore.sort(function(x,y){return bSortASC?x[0]-y[0]:y[0]-x[0];}); aStore.sort(function(x,y){return bSortASC?x[0]-y[0]:y[0]-x[0];});
} else { //alpha sort } else { //alpha sort
aStore.sort(); aStore.sort();
if(!bSortASC) if(!bSortASC) {
aStore.reverse(); aStore.reverse();
} }
}
//rewrite the table rows to the passed table element //rewrite the table rows to the passed table element
for(var i=0,iLen=aStore.length;i<iLen;i++){ for(var i=0,iLen=aStore.length;i<iLen;i++){

View file

@ -16,4 +16,3 @@ div#sidebar_container { float: left; width: 410px; margin-left: -410px; height:
#selectedinfotitle { font-size: larger; } #selectedinfotitle { font-size: larger; }
#selectedinfo { font-size: small; } #selectedinfo { font-size: small; }
.notvisable { visable: none; }