Change styling for registration numbers that are used as idents. Hide UAT message rate if UAT is disabled.

This commit is contained in:
eric1tran 2021-02-25 15:42:16 +00:00
parent e23cd7e73b
commit e8fe48485e
3 changed files with 23 additions and 8 deletions

View File

@ -218,7 +218,7 @@
<tr class="infoblock_body">
<td><span class="infoBlockTitleText">With Positions:</span> <span id="dump1090_total_ac_positions">n/a</span></td>
<td><span class="infoBlockTitleText">UAT Message Rate:</span> <span id="uat_message_rate">n/a</span></td>
<td id="uat_message_rate_row"><span class="infoBlockTitleText">UAT Message Rate:</span> <span id="uat_message_rate">n/a</span></td>
</tr>
<tr class="infoblock_body">
<td><span class="infoBlockTitleText">Position History:</span> <span id="dump1090_total_history">n/a</span></td>

View File

@ -1307,8 +1307,13 @@ function refreshSelected() {
$('#dump1090_message_rate').text(MessageRate.toFixed(1) + '/sec');
}
if (UatMessageRate !== null) {
$('#uat_message_rate').text(UatMessageRate.toFixed(1) + '/sec');
if (UAT_Enabled) {
$('#uat_message_rate_row').show();
if (UatMessageRate !== null) {
$('#uat_message_rate').text(UatMessageRate.toFixed(1) + '/sec');
}
} else {
$('#uat_message_rate_row').hide();
}
setSelectedInfoBlockVisibility();
@ -1692,10 +1697,16 @@ function refreshTableInfo() {
// ICAO doesn't change
if (tableplane.flight) {
tableplane.tr.cells[2].innerHTML = getFlightAwareModeSLink(tableplane.icao, tableplane.flight, tableplane.flight);
tableplane.tr.cells[2].className = "ident_normal";
} else if (tableplane.registration !== null) {
// Show registration with special styling if ident is not present
tableplane.tr.cells[2].innerHTML = getFlightAwareIdentLink(tableplane.registration, tableplane.registration);
tableplane.tr.cells[2].className = "ident_fallback";
} else {
// Show _registration if ident is not present
tableplane.tr.cells[2].innerHTML = (tableplane.registration !== null ? getFlightAwareIdentLink(tableplane.registration, '_' + tableplane.registration) : "");
}
tableplane.tr.cells[2].innerHTML = "";
tableplane.tr.cells[2].className = "";
}
tableplane.tr.cells[3].textContent = (tableplane.registration !== null ? tableplane.registration : "");
tableplane.tr.cells[4].textContent = (tableplane.icaotype !== null ? tableplane.icaotype : "");
tableplane.tr.cells[5].textContent = (tableplane.squawk !== null ? tableplane.squawk : "");
@ -2424,7 +2435,7 @@ function getFlightAwareIdentLink(ident, linkText) {
if (!linkText) {
linkText = ident;
}
return "<a target=\"_blank\" href=\"https://flightaware.com/live/flight/" + ident.trim() + "\">" + linkText + "</a>";
return "<a target=\"_blank\" href=\"https://flightaware.com/live/flight/" + ident.trim() + "\"><span title=\"Bold ident indicates this is an aircraft registration number\"> " + linkText + "</span></a>";
}
return "";

View File

@ -239,6 +239,7 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
background-color: #002F5D;
color: #FFFFFF;
cursor: pointer;
white-space: nowrap;
}
.aircraft_table_header td {
font-size: smaller;
@ -271,6 +272,9 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
cursor: pointer;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.ident_normal { font-weight: normal; font-style: normal; }
.ident_fallback { font-weight: bold; font-style: italic; }
.hidden { display: none; }
.infoblock_heading { font-size: larger; }
@ -950,4 +954,4 @@ select.error, textarea.error, input.error {
.ui-resizable {
min-width: 400px;
}
}