Skip to content

Commit b9ec8b0

Browse files
tiny changes to CSS and logic, also closes rossengeorgiev#9
* Additonal telemtry from habitat is displayed only in 'landscape mode' * added a WARNING to the 'chase car' page that position will be made public * move the position of 'no vehicle' message * 'recieved by' is now hidden, if there are no recievers (e.g. chase cars) * ChaseCar lib now sends values that are null as 0
1 parent f39103f commit b9ec8b0

File tree

6 files changed

+23
-64
lines changed

6 files changed

+23
-64
lines changed

css/main.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ header > div {
104104
#main .header.empty {
105105
text-align: center;
106106
width: 100%;
107+
height: 120px;
108+
line-height: 100px;
107109
border: 0;
108110
}
109111
.row .header .arrow:after { content: "▲"; }
@@ -293,7 +295,7 @@ header > div {
293295
#main .data dl > dt {
294296
color: #000;
295297
line-height: 11px;
296-
margin-top: 10px;
298+
margin-top: 5px;
297299
font-weight: bold;
298300
font-size: 14px;
299301
}

css/mobile.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ <h2>Chase car mode</h2>
5757
<span>Callsign</span>
5858
<span class="r"><input type="text" id="cc_callsign" style="width: 140px;"/></span>
5959
</div>
60+
<div class="row">
61+
<span><b>Warning: If you enable this, your location will be uploaded to habitat and be publicly visible on the map.</b></span>
62+
</div>
6063
<hr>
6164
<div class="row">
6265
<span>Last updated</span>

js/chasecar.lib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ ChaseCar.updatePosition = function(callsign, position) {
8383
'chase': true,
8484
'latitude': position.coords.latitude,
8585
'longitude': position.coords.longitude,
86-
'altitude': position.coords.altitude,
87-
'speed': position.coords.speed
86+
'altitude': ((!!position.coords.altitude) ? position.coords.altitude : 0),
87+
'speed': ((!!position.coords.speed) ? position.coords.speed : 0)
8888
}
8989
});
9090
}

js/mobile.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/tracker.js

Lines changed: 13 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,17 @@ function habitat_data(jsondata) {
218218
if (suffixes[key] !== undefined)
219219
suffix = " " + suffixes[key];
220220

221-
output.push("<b>" + name + ":</b> " + data[key] + suffix + "<br />");
221+
output.push("<dt>" + data[key] + suffix + "</dt><dd>" + name + "</dd>");
222222
}
223223

224224
output.sort();
225225
return output.join(" ");
226226
}
227227
catch (error)
228228
{
229-
if (jsondata && jsondata != '')
230-
return "<b>Data:</b> " + jsondata + "<br /> ";
231-
else
229+
//if (jsondata && jsondata != '')
230+
// return "<b>Data:</b> " + jsondata + "<br /> ";
231+
//else
232232
return "";
233233
}
234234
}
@@ -527,12 +527,16 @@ function updateVehicleInfo(index, position) {
527527
+ '</div>' // right
528528
+ '</div>' // data
529529
+ '';
530+
var c = '<dt class="recievers">Recieved by:</dt><dd class="recievers">'
531+
+ position.callsign.split(",").join(", ") + '</dd>'
532+
533+
if(!position.callsign) c = '';
534+
530535
// mid for portrait
531536
var p = '<dt>'+position.gps_time+'</dt><dd>time</dd>'
532537
+ '<dt>'+coords_text+'</dt><dd>time</dd>'
533-
+ '<dt class="recievers">Recieved by:</dt><dd class="recievers">'
534-
+ position.callsign.split(",").join(", ")
535-
+ '</dd></dl>'
538+
+ c // recievers if any
539+
+ '</dl>'
536540
+ '</div>' // left
537541
+ '<div class="right">'
538542
+ '<dl>'
@@ -545,64 +549,14 @@ function updateVehicleInfo(index, position) {
545549
+ '<dt>'+position.gps_alt+'m ('+vehicles[index].max_alt+'m)</dt><dd>altitude (max)</dd>'
546550
+ '<dt>'+position.gps_time+'</dt><dd>time</dd>'
547551
+ '<dt>'+coords_text+'</dt><dd>coordinates</dd>'
548-
+ '<dt class="recievers">Recieved by:</dt><dd class="recievers">'
549-
+ position.callsign.split(",").join(", ")
550-
+ '</dd>';
552+
+ habitat_data(position.data)
553+
+ c // recievers if any
551554
+ '';
552555

553556

554557
$('.portrait .vehicle'+index).html(a + p + b);
555558
$('.landscape .vehicle'+index).html(a + l + b);
556559
return true;
557-
558-
/// old code
559-
560-
var html = ' <div class="altitude_container" id="altitude_' + index + '">'
561-
+ ' <div class="altitude" style="font-size:0px; border-top: solid white ' + (98 - pixels) + 'px; height: ' + pixels + 'px;"></div>'
562-
+ ' </div>'
563-
+ ' <div class="vehicle_info_wrapper">'
564-
+ ' <div class="vehicle_info" style="background: url(' + image + ') no-repeat top right;">'
565-
+ ' <b style="font-size:12px">' + vehicle_names[index] + '</b><br />';
566-
567-
/* XXX OSIRIS INVISIBILITY */ if (vehicle_names[index] != "OSIRIS" && vehicle_names[index] != "PETUNIA")
568-
html += ' <b>Time:</b> ' + position.gps_time + '<br />'
569-
+ ' <b>Position:</b> ' + roundNumber(position.gps_lat, 6) + ',' + roundNumber(position.gps_lon, 6) + '<br />'
570-
+ ' <b>Altitude:</b> ' + position.gps_alt + ' m' + ascent_text + '<br />'
571-
+ (vehicles[index].vehicle_type == "balloon" ? ('<b>Max. Altitude:</b> ' + vehicles[index].max_alt + ' m<br />') : '');
572-
573-
574-
/* XXX OSIRIS INVISIBILITY */ else
575-
html += ' <b>Sentence ID:</b> ' + position.sequence + '<br />';
576-
577-
html += optional("Heading", position.gps_heading, "&deg;")
578-
+ optional("Speed", position.gps_speed, " km/h")
579-
+ optional("Temperature", position.temp_inside, "C");
580-
581-
/* Use habitat data! Just add the keys you want to the habitat_data function
582-
* if (position.vehicle == "wb8elk2")
583-
* html += whitestar_data("Data", position.data, "");
584-
* else if (position.vehicle == "apex")
585-
* html += apex_data("Data", position.data, "");
586-
* else if (position.vehicle == "picochu-1")
587-
* html += picochu_data("Data", position.data, "");
588-
* else if (position.vehicle == "DARKSIDE")
589-
* html += darkside_data("Dara", position.data, "");
590-
* else
591-
* // html += optional("Data", position.data, "");
592-
*/
593-
594-
html += habitat_data(position.data);
595-
html += optional("Receivers", position.callsign.split(",").join(", "), "");
596-
/* XXX OSIRIS INVISIBILITY */ if (vehicle_names[index] != "OSIRIS" && vehicle_names[index] != "PETUNIA")
597-
html += vehicleButtons(index);
598-
599-
html += ' </div>'
600-
+ ' </div>'
601-
+ ' <div style="clear:both;"></div>';
602-
603-
container.innerHTML = html;
604-
//$("#debug_box").html("Height: " + container.offsetHeight);
605-
$("#altitude_" + index).css("margin-top", container.offsetHeight - 100);
606560
}
607561

608562
function showSignals(index, position) {

0 commit comments

Comments
 (0)