From e91b0a6be13a0d0684c4447d8acf6b0f3a8e9c3e Mon Sep 17 00:00:00 2001 From: terribl Date: Sun, 2 Jun 2013 16:51:38 +0300 Subject: [PATCH] Added warning label when 7x00 squawk is shown. "Please don't call authorities"-warning label is show on map if any special squawk is show. modified: public_html/gmap.html modified: public_html/script.js modified: public_html/style.css --- public_html/gmap.html | 5 +++++ public_html/script.js | 21 ++++++++++++++++++--- public_html/style.css | 7 ++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/public_html/gmap.html b/public_html/gmap.html index c524bad..7f311ed 100644 --- a/public_html/gmap.html +++ b/public_html/gmap.html @@ -55,5 +55,10 @@
+
+ Squak 7x00 is reported and shown.
+ This is most likely an error in reciving or decoding.
+ Please do not call the local authorities, they already know about it if it is valid squak. +
diff --git a/public_html/script.js b/public_html/script.js index 3f31e20..69016d2 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -5,6 +5,7 @@ var PlanesOnMap = 0; var PlanesOnTable = 0; var PlanesToReap = 0; var SelectedPlane = null; +var SpecialSqawk = false; var iSortCol=-1; var bSortASC=true; @@ -19,6 +20,7 @@ ZoomLvl = Number(localStorage['ZoomLvl']) || CONST_ZOOMLVL; function fetchData() { $.getJSON('/dump1090/data.json', function(data) { PlanesOnMap = 0 + SpecialSquawk = false; // Loop through all the planes in the data packet for (var j=0; j < data.length; j++) { @@ -29,6 +31,16 @@ function fetchData() { } else { var plane = jQuery.extend(true, {}, planeObject); } + + /* For special squawk tests + if (data[j].hex == '48413x') { + data[j].squawk = '7700'; + } //*/ + + // Set SpecialSquawk-value + if (data[j].squawk == '7500' || data[j].squawk == '7600' || data[j].squawk == '7700') { + SpecialSquawk = true; + } // Call the function update plane.funcUpdateData(data[j]); @@ -38,9 +50,6 @@ function fetchData() { } PlanesOnTable = data.length; - - /* For special squawk tests */ - //Planes['867840'].squawk = '7700'; }); } @@ -455,6 +464,12 @@ function refreshTableInfo() { document.getElementById('planes_table').innerHTML = html; + if (SpecialSquawk) { + $('#SpecialSquawkWarning').css('display', 'inline'); + } else { + $('#SpecialSquawkWarning').css('display', 'none'); + } + // Click event for table $('#planes_table').find('tr').click( function(){ var hex = $(this).find('td:first').text(); diff --git a/public_html/style.css b/public_html/style.css index 9251b27..63d0a45 100644 --- a/public_html/style.css +++ b/public_html/style.css @@ -7,7 +7,12 @@ div#map_canvas { height: 100%; margin-right: 420px; } div#sidebar_container { float: left; width: 410px; margin-left: -410px; height: 100%; overflow: auto; } -table#optionsTabs { width: 100%; font-size: small; font-family: monospace; background-color: #ddd; border: 1px; border-color: #000000;} +div#SpecialSquawkWarning { position: absolute; bottom: 25px; right: 430px; border: 2px solid red; + background-color: #FFFFA3; opacity: 0.75; filter:alpha(opacity=75); padding: 5px; + display: none; text-align: center; } + +table#optionsTabs { width: 100%; font-size: small; font-family: monospace; background-color: #ddd; + border: 1px; border-color: #000000;} #tableinfo { font-size: x-small; font-family: monospace; } #sudo_buttons { font-size: x-small; font-family: monospace; }