From 2245aab7d1f5c18a7df9559bfc539a12d5b15a8c Mon Sep 17 00:00:00 2001 From: Carlos Salaverria Date: Mon, 12 Sep 2016 18:10:36 -0500 Subject: [PATCH] Update FlightAware mode S link --- public_html/script.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index 0571aee..f6d5db0 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -749,11 +749,10 @@ function refreshSelected() { if (selected.flight !== null && selected.flight !== "") { $('#selected_callsign').text(selected.flight); - $('#selected_flightaware_link').html(getFlightAwareIdentLink(selected.flight, "[FlightAware]")); } else { $('#selected_callsign').text('n/a'); - $('#selected_flightaware_link').html(getFlightAwareModeSLink(selected.icao, "[FlightAware]")); } + $('#selected_flightaware_link').html(getFlightAwareModeSLink(selected.icao, selected.flight, "[FlightAware]")); if (selected.registration !== null) { $('#selected_registration').text(selected.registration); @@ -883,7 +882,7 @@ function refreshTableInfo() { tableplane.tr.cells[15].textContent = (tableplane.position !== null ? tableplane.position[0].toFixed(4) : ""); tableplane.tr.cells[16].textContent = format_data_source(tableplane.getDataSource()); tableplane.tr.cells[17].innerHTML = getAirframesModeSLink(tableplane.icao); - tableplane.tr.cells[18].innerHTML = getFlightAwareModeSLink(tableplane.icao); + tableplane.tr.cells[18].innerHTML = getFlightAwareModeSLink(tableplane.icao, tableplane.flight); tableplane.tr.cells[19].innerHTML = getFlightAwarePhotoLink(tableplane.registration); tableplane.tr.className = classes; } @@ -1345,12 +1344,18 @@ function getFlightAwareIdentLink(ident, linkText) { return ""; } -function getFlightAwareModeSLink(code, linkText) { +function getFlightAwareModeSLink(code, ident, linkText) { if (code !== null && code.length > 0 && code[0] !== '~' && code !== "000000") { if (!linkText) { linkText = "FlightAware: " + code.toUpperCase(); } - return "" + linkText + ""; + + var linkHtml = "" + linkText + ""; + return linkHtml; } return "";