Skip to content

Commit 9d32363

Browse files
authored
Merge pull request projecthorus#21 from LukePrior/testing
Use detailed API on sonde select
2 parents ebe31b9 + fcabe66 commit 9d32363

File tree

3 files changed

+57
-22
lines changed

3 files changed

+57
-22
lines changed

.htaccess

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
<IfModule mod_deflate.c>
2-
SetOutputFilter DEFLATE
2+
# Compress HTML, CSS, JavaScript, Text, XML and fonts
3+
AddOutputFilterByType DEFLATE application/javascript
4+
AddOutputFilterByType DEFLATE application/rss+xml
5+
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
6+
AddOutputFilterByType DEFLATE application/x-font
7+
AddOutputFilterByType DEFLATE application/x-font-opentype
8+
AddOutputFilterByType DEFLATE application/x-font-otf
9+
AddOutputFilterByType DEFLATE application/x-font-truetype
10+
AddOutputFilterByType DEFLATE application/x-font-ttf
11+
AddOutputFilterByType DEFLATE application/x-javascript
12+
AddOutputFilterByType DEFLATE application/xhtml+xml
13+
AddOutputFilterByType DEFLATE application/xml
14+
AddOutputFilterByType DEFLATE font/opentype
15+
AddOutputFilterByType DEFLATE font/otf
16+
AddOutputFilterByType DEFLATE font/ttf
17+
AddOutputFilterByType DEFLATE image/svg+xml
18+
AddOutputFilterByType DEFLATE image/x-icon
19+
AddOutputFilterByType DEFLATE text/css
20+
AddOutputFilterByType DEFLATE text/html
21+
AddOutputFilterByType DEFLATE text/javascript
22+
AddOutputFilterByType DEFLATE text/plain
23+
AddOutputFilterByType DEFLATE text/xml
24+
25+
# Remove browser bugs (only needed for ancient browsers)
26+
BrowserMatch ^Mozilla/4 gzip-only-text/html
27+
BrowserMatch ^Mozilla/4\.0[678] no-gzip
28+
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
29+
Header append Vary User-Agent
330
</IfModule>
431

532
AddType text/cache-manifest .manifest

index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
55
<title>SondeHub Tracker</title>
66
<meta name="description" content="Live tracking of radiosonde flights. Data via SondeHub v2. Includes weather overlay, predictions, and access to historic radiosonde flights on sondehub." />
7-
<meta name="author" content="Rossen Georgiev / Mark Jessop / Michaela Wheeler" />
7+
<meta name="author" content="Rossen Georgiev / Mark Jessop / Michaela Wheeler / Luke Prior" />
88
<link rel="search" type="application/opensearchdescription+xml" href="opensearchspec.xml" title="Search on Sondebhub Tracker">
99
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"/>
10-
<meta name="apple-mobile-web-app-title" content="Habhub Tracker">
10+
<meta name="apple-mobile-web-app-title" content="SondeHub Tracker">
1111
<meta name="apple-mobile-web-app-capable" content="yes" />
1212
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
1313
<link rel="apple-touch-icon" sizes="57x57" href="img/apple-touch-icon.png" />
@@ -71,48 +71,48 @@ <h2><i class="icon-question rfloat"></i>Welcome</h2>
7171
<div id="motda">
7272
<h4>Radiosondes?</h4>
7373
To learn more check out our
74-
<a href="https://www.youtube.com/watch?v=YBy-bXEWZeM" target="_blank">LCA video</a>.
74+
<a href="https://www.youtube.com/watch?v=YBy-bXEWZeM" target="_blank" rel="noopener">LCA video</a>.
7575

7676
<h4>How do I receive?</h4>
7777
Set up a receiver station using
78-
<a href="https://github.com/projecthorus/radiosonde_auto_rx/wiki" target="_blank">auto_rx</a> or <a href="https://github.com/dl9rdz/rdz_ttgo_sonde" target="_blank">rdzTTGOsonde</a>.
78+
<a href="https://github.com/projecthorus/radiosonde_auto_rx/wiki" target="_blank" rel="noopener">auto_rx</a> or <a href="https://github.com/dl9rdz/rdz_ttgo_sonde" target="_blank" rel="noopener">rdzTTGOsonde</a>.
7979
<br/>
8080

8181
<h4>Recovered a Sonde?</h4>
8282
Click the 'car' icon on the top-right to submit a recovery notification.
8383

8484
<h4>Support Us!</h4>
8585
AWS hosting unfortunately does not come cheap.
86-
If you use SondeHub regularly, please consider <a href="https://www.patreon.com/sondehub" target="_blank">supporting us on Patreon</a>, or with a <a href="https://sondehub.org/go/donate" target="_blank">donation on Paypal</a>.
86+
If you use SondeHub regularly, please consider <a href="https://www.patreon.com/sondehub" target="_blank" rel="noopener">supporting us on Patreon</a>, or with a <a href="https://sondehub.org/go/donate" target="_blank" rel="noopener">donation on Paypal</a>.
8787

8888
<h4>Amateur HAB Launches?</h4>
89-
You can find Amateur High-Altitude Balloon launches on the <a href="https://tracker.habhub.org/" target="_blank">HabHub Tracker</a>.
89+
You can find Amateur High-Altitude Balloon launches on the <a href="https://tracker.habhub.org/" target="_blank" rel="noopener">HabHub Tracker</a>.
9090

9191
<h4>SondeHub Status Pages</h4>
92-
You can find the status of the SondeHub Database on the <a href="https://sondehub.org/go/status" target="_blank">SondeHub Dashboard</a>.<br/>
93-
You can view outages of the SondeHub Database at <a href="https://sondehub.statuspage.io/" target="_blank">SondeHub Status</a>.
92+
You can find the status of the SondeHub Database on the <a href="https://sondehub.org/go/status" target="_blank" rel="noopener">SondeHub Dashboard</a>.<br/>
93+
You can view outages of the SondeHub Database at <a href="https://sondehub.statuspage.io/" target="_blank" rel="noopener">SondeHub Status</a>.
9494

9595
</div>
9696
<br/>
9797
<h2>Under Beta!</h2>
9898
<hr/>
99-
This site uses data from the <a href="https://github.com/projecthorus/sondehub-infra/wiki" target="_blank">SondeHub v2</a> database, which will remove the radiosonde
99+
This site uses data from the <a href="https://github.com/projecthorus/sondehub-infra/wiki" target="_blank" rel="noopener">SondeHub v2</a> database, which will remove the radiosonde
100100
load from the Habitat tracking database. We are still working to being this tracker up to feature-parity with the previous
101101
tracker, so some features like filtering by type are still in-progress.
102102
<br/><br/>
103103
Chase Cars can show up on the map using this tracker's chase-car features (look for the car icon at top-right)
104-
or upload their position from <a href="https://github.com/projecthorus/chasemapper" target="_blank">Chasemapper</a> or <a href="https://github.com/dl9rdz/rdz_ttgo_sonde" target="_blank">rdzTTGOsonde</a>.
104+
or upload their position from <a href="https://github.com/projecthorus/chasemapper" target="_blank" rel="noopener">Chasemapper</a> or <a href="https://github.com/dl9rdz/rdz_ttgo_sonde" target="_blank" rel="noopener">rdzTTGOsonde</a>.
105105
<br/><br/>
106106
<h2>Contribute</h2>
107107
<hr/>
108108
<p>
109109
Did you know the tracker is open-source? Check it out on
110-
<a href="https://github.com/projecthorus/sondehub-tracker" target="_blank">github/sondehub-tracker</a>.
110+
<a href="https://github.com/projecthorus/sondehub-tracker" target="_blank" rel="noopener">github/sondehub-tracker</a>.
111111
Bug reports, suggestions and pull requests are welcome.
112112
<br/><br/>
113113
A huge thanks to RGP for developing the mobile tracker that this site is based on.
114114
<br/><br/>
115-
You can also find us on IRC in <a href="https://kiwiirc.com/nextclient/irc.libera.chat/highaltitude" target="_blank">#highaltitude</a> at <b>libera.chat</b>.
115+
You can also find us on IRC in <a href="https://kiwiirc.com/nextclient/irc.libera.chat/highaltitude" target="_blank" rel="noopener">#highaltitude</a> at <b>libera.chat</b>.
116116
</p>
117117
</div>
118118
</div>

js/tracker.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ function load() {
455455
} else {
456456
map.addLayer(vehicles[key]["subhorizon_circle_title"]);
457457
}
458-
} catch(e){console.log(e);};
458+
} catch(e){};
459459
}
460460
}
461461
}
@@ -543,7 +543,7 @@ function load() {
543543

544544
function showLaunchSites() {
545545
if (!launches) {
546-
launches = new L.layerGroup([], {attribution: "© <a href='https://github.com/rs1729/RS/issues/15' target='_blank'>rs1729</a>"});
546+
launches = new L.layerGroup([], {attribution: "© <a href='https://github.com/rs1729/RS/issues/15' target='_blank' rel='noopener'>rs1729</a>"});
547547
$.getJSON("launchSites.json", function(json) {
548548
for (var key in json) {
549549
if (json.hasOwnProperty(key)) {
@@ -915,6 +915,7 @@ function followVehicle(vcallsign, noPan, force) {
915915
}
916916

917917
if(follow_vehicle != vcallsign || force) {
918+
refresh(vcallsign);
918919
focusVehicle(vcallsign);
919920

920921
follow_vehicle = vcallsign;
@@ -1844,6 +1845,7 @@ function addPosition(position) {
18441845
listScroll.refresh();
18451846
listScroll.scrollToElement(_vehicle_idname);
18461847
followVehicle($(_vehicle_idname).attr('data-vcallsign'));
1848+
refresh(_vehicle_id);
18471849
};
18481850

18491851
marker.shadow = marker_shadow;
@@ -2502,11 +2504,13 @@ function graphAddPosition(vcallsign, new_data) {
25022504
var ajax_positions = null;
25032505
var ajax_inprogress = false;
25042506

2505-
function refresh() {
2507+
function refresh(serial) {
25062508
if(ajax_inprogress) {
2507-
clearTimeout(periodical);
2508-
periodical = setTimeout(refresh, 2000);
2509-
return;
2509+
if (serial === undefined) {
2510+
clearTimeout(periodical);
2511+
periodical = setTimeout(refresh, 2000);
2512+
return;
2513+
}
25102514
}
25112515

25122516
ajax_inprogress = true;
@@ -2521,7 +2525,11 @@ function refresh() {
25212525
var mode = wvar.mode.toLowerCase();
25222526
mode = (mode == "position") ? "latest" : mode.replace(/ /g,"");
25232527

2524-
var data_str = "mode="+mode+"&type=positions&format=json&max_positions=" + max_positions + "&position_id=" + position_id + "&vehicles=" + encodeURIComponent(wvar.query);
2528+
if (serial === undefined) {
2529+
var data_str = "mode="+mode+"&type=positions&format=json&max_positions=" + max_positions + "&position_id=" + position_id + "&vehicles=" + encodeURIComponent(wvar.query);
2530+
} else {
2531+
var data_str = "mode="+mode+"&type=positions&format=json&max_positions=" + max_positions + "&position_id=0&vehicles=" + encodeURIComponent(serial);
2532+
}
25252533

25262534
ajax_positions = $.ajax({
25272535
type: "GET",
@@ -2994,7 +3002,7 @@ function updateRecoveryMarker(recovery) {
29943002
html += "<div><b>Time:&nbsp;</b>"+formatDate(stringToDateUTC(recovery.datetime))+"</div>";
29953003
html += "<div><b>Reported by:&nbsp;</b>"+recovery.recovered_by+"</div>";
29963004
html += "<div><b>Notes:&nbsp;</b>"+$('<div>').text(recovery.description).html()+"</div>";
2997-
html += "<div><b>Flight Path:&nbsp;</b><a href='https://sondehub.org/card/"+recovery.serial+"' target='_blank'>"+recovery.serial+"</a></div>";
3005+
html += "<div><b>Flight Path:&nbsp;</b><a href='https://sondehub.org/card/"+recovery.serial+"' target='_blank' rel='noopener'>"+recovery.serial+"</a></div>";
29983006

29993007
html += "</div>";
30003008

@@ -3096,7 +3104,7 @@ function updateRecoveryPane(r){
30963104
html += "<div><b>Time:&nbsp;</b>"+formatDate(stringToDateUTC(r[i].datetime))+"</div>";
30973105
html += "<div><b>Reported by:&nbsp;</b>"+r[i].recovered_by+"</div>";
30983106
html += "<div><b>Notes:&nbsp;</b>"+$('<div>').text(r[i].description).html()+"</div>";
3099-
html += "<div><b>Flight Path:&nbsp;</b><a href='https://sondehub.org/card/"+r[i].serial+"' target='_blank'>"+r[i].serial+"</a></div>";
3107+
html += "<div><b>Flight Path:&nbsp;</b><a href='https://sondehub.org/card/"+r[i].serial+"' target='_blank' rel='noopener'>"+r[i].serial+"</a></div>";
31003108
html += "<hr style='margin:5px 0px'>";
31013109
html += "</div>";
31023110
}

0 commit comments

Comments
 (0)