Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.log
js/mobile.js
js/init_plot.js
js/version.json
css/mobile.css
cache.manifest
tiles/
tiles/
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ java -jar "../tools/yuicompressor-2.4.8.jar" --type=js --disable-optimizations -
java -jar "../tools/yuicompressor-2.4.8.jar" --type=js --disable-optimizations --nomunge _jquery.flot.js >> init_plot.js
java -jar "../tools/yuicompressor-2.4.8.jar" --type=js --disable-optimizations --nomunge plot_config.js >> init_plot.js

# create version check file
echo "{\"build_date\": \"$BUILD_DATE\", \"version\": \"$VERSION\", \"refresh\": 86400}" > version.json

cd ..
echo "Done!"
echo -n "Generate cache.manifest..."
Expand Down
16 changes: 16 additions & 0 deletions css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,19 @@ header h1{
font-weight: normal;
font-style: normal; }
*/

#reload_warning {
position: absolute;
left: 20px;
bottom: 20px;
font-size: 12;
width: 300px;
height: auto;
background-color: white;
z-index: 10;
box-shadow: rgba(9, 20, 66, 0.25) 0px 20px 32px -8px;
border: #ddd solid;
padding: 10px;
border-width: 1px;
display: none;
}
18 changes: 14 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<div class="bar" style="display: none"><div class="complete"></div></div>
</div>
</div>

<header style="display: none">
<div class="container">
<div class="search">
Expand Down Expand Up @@ -81,7 +80,9 @@ <h2><i class="icon-question rfloat"></i>Welcome</h2>
<div id="motda">
<h4>User Guide</h4>
A User Guide for the tracker is <a href="https://github.com/projecthorus/sondehub-tracker/wiki/SondeHub-Tracker-User-Guide" target="_blank" rel="noopener">available here.</a>

<br/>
<b>Check the <a href="https://github.com/projecthorus/sondehub-tracker/wiki/SondeHub%E2%80%90Tracker-Changelog" target="_blank" rel="noopener">SondeHub-Tracker Changelog</a> to find info on recent updates.</b>
<br/>
<h4>Radiosondes?</h4>
To learn more check out our
<a href="https://www.youtube.com/watch?v=YBy-bXEWZeM" target="_blank" rel="noopener">LCA video</a>.</br>
Expand Down Expand Up @@ -364,6 +365,11 @@ <h3>Report Recovery</h3>
</div>
<div id="homebox" style="width:0px;height:0px"></div>
<div id="mapscreen">
<div style="width: 100%;">
<div id="zoom_warning" class="lfloat slickbox" style="width:250px; bottom: 0px; left: 50%; transform: translate(-50%, -50%);">
<div style="width:250px">Zoom in for realtime data!</div>
</div>
</div>
<div id="timebox" class="present slickbox animate" style="display: none">
<svg width="40" height="40" viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" version="1.1" version="1.1" class="lfloat">
<path d="M99.812,43.188c-2.77,0-5,2.032-5,4.562v40.875c-4.315,1.97-7.312,6.321-7.312,11.375,0,6.9,5.596,12.5,12.5,12.5,1.05,0,2.06-0.16,3.03-0.41l23.35,23.35c2.23,2.24,5.93,2.13,8.28-0.22s2.42-6.04,0.18-8.28l-23-23c0.42-1.24,0.66-2.56,0.66-3.94,0-5.202-3.17-9.68-7.69-11.562v-40.688c0-2.53-2.23-4.562-4.998-4.562zm-5.906-23c0.031-0.003,0.063,0.002,0.094,0v14.374c0,0.236,0.202,0.438,0.438,0.438h11.122c0.24,0,0.44-0.202,0.44-0.438v-14.343c39.4,2.921,70.86,34.381,73.78,73.781h-14.34c-0.24,0-0.44,0.171-0.44,0.406v11.154c0,0.24,0.2,0.44,0.44,0.44h14.34c-2.92,39.4-34.38,70.86-73.78,73.78v-14.37c0-0.24-0.2-0.41-0.44-0.41h-11.122c-0.236,0-0.438,0.17-0.438,0.41v14.37c-39.4-2.92-70.86-34.38-73.781-73.78h14.343c0.236,0,0.438-0.2,0.438-0.44v-11.154c0-0.235-0.202-0.406-0.438-0.406h-14.343c2.918-39.372,34.33-70.848,73.687-73.812zm6.094-10.188c-49.706,0-90,40.294-90,90,0,49.71,40.294,90,90,90,49.71,0,90-40.29,90-90,0-49.706-40.29-90-90-90zm0-10c55.23,0,100,44.772,100,100,0,55.23-44.77,100-100,100-55.228,0-100-44.77-100-100,0-55.228,44.772-100,100-100z"></path>
Expand Down Expand Up @@ -394,13 +400,17 @@ <h3>Report Recovery</h3>
<div id="main" style="display: none">
<div class="scrollwrapper">
<div class="portrait">
<div class="row vehicle0"><div class="header empty"><img style="width:90px;height:30px" src="img/hab-spinner.gif"/></div></div>
<div class="row vehicle0" id="pv0"><div class="header empty"><img style="width:90px;height:30px" src="img/hab-spinner.gif"/></div></div>
</div>
<div class="landscape">
<div class="row vehicle0"><div class="header empty"><img style="width:90px;height:30px" src="img/hab-spinner.gif"/></div></div>
<div class="row vehicle0" id="lv0"><div class="header empty"><img style="width:90px;height:30px" src="img/hab-spinner.gif"/></div></div>
</div>
</div>
</div>

<div id="reload_warning">This version of SondeHub is out of date. <a href="javascript:window.location.reload(true)">Click here to reload</a>. Page will reload automatically in <span id="reload_timer"></span>
</div>

<!-- Was 3.31-->
<script type="text/javascript" language="javascript" src="https://www.google.com/recaptcha/api.js" async defer></script>
<script type="text/javascript" language="javascript" src="https://xc5dqkj2cgb1.statuspage.io/embed/script.js" async defer></script>
Expand Down
34 changes: 33 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ var updateTime = function(date) {
}
};

const version = "{VER}";

$(window).ready(function() {
// refresh timebox
Expand All @@ -464,7 +465,7 @@ $(window).ready(function() {
}, 1000);

// Update Tracker version info
$('#build_version').text("{VER}");
$('#build_version').text(version);
$('#build_date').text("{BUILD_DATE}");

// resize elements if needed
Expand Down Expand Up @@ -999,3 +1000,34 @@ $(window).ready(function() {
clean_refresh(wvar.mode, true, true);
});
});


function check_version(){
const updateRequest = new Request("/js/version.json");
fetch(updateRequest)
.then(function(response){ return response.json()})
.then(function(response){
if (response['version'] != version) {
window.clearInterval(update_check)
reload_timer = window.setTimeout(update_site, response['refresh']*1000)
reload_end_time = new Date().getTime() +response['refresh']*1000
update_countdown();
countdown_interval = setInterval(update_countdown, 100);
document.getElementById("reload_warning").style.display = "block";
}
})
}
function update_site(){
window.location.reload(true)
}

function update_countdown(){
var date = new Date(0);
time_remaining = (reload_end_time - new Date().getTime())/1000
date.setSeconds(time_remaining);
var timeString = date.toISOString().substring(11, 19); // hacky
document.getElementById("reload_timer").innerText = timeString;
}

check_version()
update_check = setInterval(check_version, 15 * 60 * 1000)
2 changes: 1 addition & 1 deletion js/station.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ function generateLaunchSites() {
var burst_altitude = 26000;
var burst_samples = "";
var descent_samples = "";
var marker = new L.circleMarker(latlon, {color: '#696969', fillColor: "white", radius: 8});
var marker = new L.circleMarker(latlon, {color: '#696969', fillColor: "white", radius: Math.min(map.getZoom(),8)});
var popup = new L.popup({ autoClose: false, closeOnClick: false });
marker.title = key;
marker.bindPopup(popup);
Expand Down
Loading