From 3bad502a8da0f548ff8af288978aca35a3c068e1 Mon Sep 17 00:00:00 2001
From: Luke Prior <22492406+LukePrior@users.noreply.github.com>
Date: Mon, 28 Jun 2021 20:42:20 +1000
Subject: [PATCH 1/2] Maybe enable GZIP?
---
.htaccess | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/.htaccess b/.htaccess
index 6fcc26d..3d763d3 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,5 +1,32 @@
- SetOutputFilter DEFLATE
+ # Compress HTML, CSS, JavaScript, Text, XML and fonts
+ AddOutputFilterByType DEFLATE application/javascript
+ AddOutputFilterByType DEFLATE application/rss+xml
+ AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
+ AddOutputFilterByType DEFLATE application/x-font
+ AddOutputFilterByType DEFLATE application/x-font-opentype
+ AddOutputFilterByType DEFLATE application/x-font-otf
+ AddOutputFilterByType DEFLATE application/x-font-truetype
+ AddOutputFilterByType DEFLATE application/x-font-ttf
+ AddOutputFilterByType DEFLATE application/x-javascript
+ AddOutputFilterByType DEFLATE application/xhtml+xml
+ AddOutputFilterByType DEFLATE application/xml
+ AddOutputFilterByType DEFLATE font/opentype
+ AddOutputFilterByType DEFLATE font/otf
+ AddOutputFilterByType DEFLATE font/ttf
+ AddOutputFilterByType DEFLATE image/svg+xml
+ AddOutputFilterByType DEFLATE image/x-icon
+ AddOutputFilterByType DEFLATE text/css
+ AddOutputFilterByType DEFLATE text/html
+ AddOutputFilterByType DEFLATE text/javascript
+ AddOutputFilterByType DEFLATE text/plain
+ AddOutputFilterByType DEFLATE text/xml
+
+ # Remove browser bugs (only needed for ancient browsers)
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
+ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
+ Header append Vary User-Agent
AddType text/cache-manifest .manifest
From 99336f003c65c961a0b99f98faad80a6c129c5c1 Mon Sep 17 00:00:00 2001
From: Uskompuf <22492406+Uskompuf@users.noreply.github.com>
Date: Mon, 28 Jun 2021 21:56:46 +1000
Subject: [PATCH 2/2] use detailed API on select
---
index.html | 24 ++++++++++++------------
js/tracker.js | 26 +++++++++++++++++---------
2 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/index.html b/index.html
index 7ab384a..49a79a7 100644
--- a/index.html
+++ b/index.html
@@ -4,10 +4,10 @@
SondeHub Tracker
-
+
-
+
@@ -71,11 +71,11 @@ Welcome
Under Beta!
- This site uses data from the SondeHub v2 database, which will remove the radiosonde
+ This site uses data from the SondeHub v2 database, which will remove the radiosonde
load from the Habitat tracking database. We are still working to being this tracker up to feature-parity with the previous
tracker, so some features like filtering by type are still in-progress.
Chase Cars can show up on the map using this tracker's chase-car features (look for the car icon at top-right)
- or upload their position from Chasemapper or rdzTTGOsonde .
+ or upload their position from Chasemapper or rdzTTGOsonde .
Contribute
Did you know the tracker is open-source? Check it out on
- github/sondehub-tracker .
+ github/sondehub-tracker .
Bug reports, suggestions and pull requests are welcome.
A huge thanks to RGP for developing the mobile tracker that this site is based on.
- You can also find us on IRC in #highaltitude at libera.chat .
+ You can also find us on IRC in #highaltitude at libera.chat .
diff --git a/js/tracker.js b/js/tracker.js
index 9eaa382..43714bb 100644
--- a/js/tracker.js
+++ b/js/tracker.js
@@ -455,7 +455,7 @@ function load() {
} else {
map.addLayer(vehicles[key]["subhorizon_circle_title"]);
}
- } catch(e){console.log(e);};
+ } catch(e){};
}
}
}
@@ -543,7 +543,7 @@ function load() {
function showLaunchSites() {
if (!launches) {
- launches = new L.layerGroup([], {attribution: "© rs1729 "});
+ launches = new L.layerGroup([], {attribution: "© rs1729 "});
$.getJSON("launchSites.json", function(json) {
for (var key in json) {
if (json.hasOwnProperty(key)) {
@@ -915,6 +915,7 @@ function followVehicle(vcallsign, noPan, force) {
}
if(follow_vehicle != vcallsign || force) {
+ refresh(vcallsign);
focusVehicle(vcallsign);
follow_vehicle = vcallsign;
@@ -1844,6 +1845,7 @@ function addPosition(position) {
listScroll.refresh();
listScroll.scrollToElement(_vehicle_idname);
followVehicle($(_vehicle_idname).attr('data-vcallsign'));
+ refresh(_vehicle_id);
};
marker.shadow = marker_shadow;
@@ -2502,11 +2504,13 @@ function graphAddPosition(vcallsign, new_data) {
var ajax_positions = null;
var ajax_inprogress = false;
-function refresh() {
+function refresh(serial) {
if(ajax_inprogress) {
- clearTimeout(periodical);
- periodical = setTimeout(refresh, 2000);
- return;
+ if (serial === undefined) {
+ clearTimeout(periodical);
+ periodical = setTimeout(refresh, 2000);
+ return;
+ }
}
ajax_inprogress = true;
@@ -2521,7 +2525,11 @@ function refresh() {
var mode = wvar.mode.toLowerCase();
mode = (mode == "position") ? "latest" : mode.replace(/ /g,"");
- var data_str = "mode="+mode+"&type=positions&format=json&max_positions=" + max_positions + "&position_id=" + position_id + "&vehicles=" + encodeURIComponent(wvar.query);
+ if (serial === undefined) {
+ var data_str = "mode="+mode+"&type=positions&format=json&max_positions=" + max_positions + "&position_id=" + position_id + "&vehicles=" + encodeURIComponent(wvar.query);
+ } else {
+ var data_str = "mode="+mode+"&type=positions&format=json&max_positions=" + max_positions + "&position_id=0&vehicles=" + encodeURIComponent(serial);
+ }
ajax_positions = $.ajax({
type: "GET",
@@ -2994,7 +3002,7 @@ function updateRecoveryMarker(recovery) {
html += "Time: "+formatDate(stringToDateUTC(recovery.datetime))+"
";
html += "Reported by: "+recovery.recovered_by+"
";
html += "Notes: "+$('
').text(recovery.description).html()+"
";
- html += "
";
+ html += "
";
html += "
";
@@ -3096,7 +3104,7 @@ function updateRecoveryPane(r){
html += "Time: "+formatDate(stringToDateUTC(r[i].datetime))+"
";
html += "Reported by: "+r[i].recovered_by+"
";
html += "Notes: "+$('
').text(r[i].description).html()+"
";
- html += "
";
+ html += "
";
html += "
";
html += "
";
}