Skip to content

Commit f39103f

Browse files
* on mobile devices the coordinates for each vehicle are now clickable. Upon which they laucnh the native maps app (should be useful for getting nav directions to balloon) * tiny changes in the style sheets
1 parent 87134f0 commit f39103f

File tree

6 files changed

+36
-8
lines changed

6 files changed

+36
-8
lines changed

css/main.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ header > div {
101101
width: 90%;
102102
float: left;
103103
}
104-
#main .header span.center {
104+
#main .header.empty {
105105
text-align: center;
106+
width: 100%;
107+
border: 0;
106108
}
107109
.row .header .arrow:after { content: "▲"; }
108110
.row.active .header .arrow:after { content: "▼"; }
@@ -129,6 +131,13 @@ header > div {
129131
right: 25%;
130132
opacity: 0.6;
131133
}
134+
#main .row .data dt > i {
135+
font-size: 12px;
136+
}
137+
#main .row .data a {
138+
text-decoration: none;
139+
color: #00A3D3;
140+
}
132141

133142
#chasecarbox,
134143
#aboutbox {

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ <h2>Chase car mode</h2>
8888
<div id="main" style="dispaly: none">
8989
<div class="scrollwrapper">
9090
<div class="portrait">
91-
<div class="row active vehicle0"><div class="header"><span class="center">No vehicles :(</span></div></div>
91+
<div class="row active vehicle0"><div class="header empty"><span>No vehicles :(</span></div></div>
9292
</div>
9393
<div class="landscape">
94-
<div class="row active vehicle0"><div class="header"><span class="center">No vehicles :(</span></div></div>
94+
<div class="row active vehicle0"><div class="header empty"><span>No vehicles :(</span></div></div>
9595
</div>
9696
</div>
9797
</div>

js/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ $(window).ready(function() {
5353
// add inline scroll to vehicle list
5454
listScroll = new iScroll('main', { hScrollbar: false, hScroll: false, snap: false });
5555

56+
// confirm dialog when launchnig a native map app with coordinates
57+
$('#main').on('click', '#launch_mapapp', function() {
58+
return confirm("Launch your maps app?");
59+
});
60+
5661
// expand list items
5762
$('#main').on('click', '.row .header', function() {
5863
var e = $(this).parent();

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: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,21 @@ function updateVehicleInfo(index, position) {
501501

502502
}
503503

504-
ascent_text = position.gps_alt != 0 ? vehicles[index].ascent_rate.toFixed(1) + ' m/s' : '';
504+
var ascent_text = position.gps_alt != 0 ? vehicles[index].ascent_rate.toFixed(1) + ' m/s' : '';
505+
506+
var coords_text;
507+
var ua = navigator.userAgent.toLowerCase();
508+
if(ua.indexOf('iphone') > -1) {
509+
coords_text = '<a id="launch_mapapp" href="http://maps.google.com/?q='+position.gps_lat+','+position.gps_lon+'">'
510+
+ roundNumber(position.gps_lat, 6) + ',' + roundNumber(position.gps_lon, 6) +'</a>'
511+
+ ' <i class="icon-location"></i>';
512+
} else if(ua.indexOf('android') > -1) {
513+
coords_text = '<a id="launch_mapapp" href="geo:0,0?q='+position.gps_lat+','+position.gps_lon+'">'
514+
+ roundNumber(position.gps_lat, 6) + ',' + roundNumber(position.gps_lon, 6) +'</a>'
515+
+ ' <i class="icon-location"></i>';
516+
} else {
517+
coords_text = roundNumber(position.gps_lat, 6) + ',' + roundNumber(position.gps_lon, 6);
518+
}
505519
// start
506520
var a = '<div class="header"><span>' + vehicle_names[index] + '</span><i class="arrow"></i></div>'
507521
+ '<div class="data">'
@@ -515,7 +529,7 @@ function updateVehicleInfo(index, position) {
515529
+ '';
516530
// mid for portrait
517531
var p = '<dt>'+position.gps_time+'</dt><dd>time</dd>'
518-
+ '<dt>'+ roundNumber(position.gps_lat, 6) + ',' + roundNumber(position.gps_lon, 6) +'</dt><dd>time</dd>'
532+
+ '<dt>'+coords_text+'</dt><dd>time</dd>'
519533
+ '<dt class="recievers">Recieved by:</dt><dd class="recievers">'
520534
+ position.callsign.split(",").join(", ")
521535
+ '</dd></dl>'
@@ -530,7 +544,7 @@ function updateVehicleInfo(index, position) {
530544
var l = '<dt>'+ascent_text+'</dt><dd>rate</dd>'
531545
+ '<dt>'+position.gps_alt+'m ('+vehicles[index].max_alt+'m)</dt><dd>altitude (max)</dd>'
532546
+ '<dt>'+position.gps_time+'</dt><dd>time</dd>'
533-
+ '<dt>'+ roundNumber(position.gps_lat, 6) + ', ' + roundNumber(position.gps_lon, 6) +'</dt><dd>coordinates</dd>'
547+
+ '<dt>'+coords_text+'</dt><dd>coordinates</dd>'
534548
+ '<dt class="recievers">Recieved by:</dt><dd class="recievers">'
535549
+ position.callsign.split(",").join(", ")
536550
+ '</dd>';

0 commit comments

Comments
 (0)