Skip to content

Commit 09f568a

Browse files
Merge branch 'master' into feature-time
Conflicts: index.html
2 parents 8b3415d + 39f5e08 commit 09f568a

File tree

3 files changed

+26
-59
lines changed

3 files changed

+26
-59
lines changed

css/main.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ body {
2828
}
2929

3030
.scrollStyleV {
31-
z-index: 100;
31+
z-index: 49;
3232
width: 5px;
3333
bottom: 6px;
3434
top: 6px;
@@ -43,7 +43,7 @@ body {
4343
border-radius: 3px 3px 3px 3px;
4444
position: absolute;
4545
width: 100%;
46-
z-index: 100;
46+
z-index: 49;
4747
}
4848

4949
#timebox {
@@ -227,7 +227,7 @@ header > div {
227227
padding-left: 5px;
228228
border-bottom: 1px solid #33b5e5;
229229
position: relative;
230-
z-index: 4;
230+
z-index: 51;
231231
cursor: pointer;
232232
background-color: #fff;
233233
border-left: 5px solid #fff;
@@ -375,7 +375,7 @@ header > div {
375375
overflow: auto;
376376
position: absolute;
377377
width: 100%;
378-
z-index: 4;
378+
z-index: 50;
379379
background: #fff;
380380
}
381381

@@ -453,7 +453,7 @@ header > div {
453453
height: 26px;
454454
position: relative;
455455
top: 0;
456-
z-index: 3;
456+
z-index: 51;
457457
border: solid 1px #919191;
458458
border-radius: 28px;
459459
box-shadow: inset 0 2px 1px white, inset 0 -2px 1px white;

index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ <h2>Chase car mode</h2>
206206
</div>
207207
</div>
208208
</div>
209+
<div id="homebox" style="width:0px;height:0px"></div>
209210
<div id="mapscreen">
210211
<div id="timebox" class="present" style="display: none">
211212
<svg width="40" height="40" viewbox="0 0 200 200" version="1.1" class="lfloat">
@@ -215,14 +216,14 @@ <h2>Chase car mode</h2>
215216
<span class="local lfloat">Local: ???</span>
216217
</div>
217218

218-
<div id="map" style="dispaly: none" class="main_screen"></div>
219+
<div id="map"></div>
219220

220221
<div id="telemetry_graph" style="display: none">
221222
<div class="graph_label">Telemetry Graph</div>
222223
<div class="holder" style="height: 200px;width: 50px"></div>
223224
</div>
224225
</div>
225-
<div id="main" style="dispaly: none" class="main_screen">
226+
<div id="main" style="dispaly: none">
226227
<div class="scrollwrapper">
227228
<div class="portrait">
228229
<div class="row vehicle0"><div class="header empty"><span>No vehicles :(</span></div></div>

js/app.js

Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ var loadComplete = function(e) {
4949
clearTimeout(initTimer);
5050

5151
if(e.type == 'updateready') {
52-
window.applicationCache.swapCache();
52+
// swapCache may throw exception if the isn't a previous cache
53+
try {
54+
window.applicationCache.swapCache();
55+
} catch(e) {}
56+
5357
window.location.reload();
5458
return;
5559
}
@@ -62,15 +66,15 @@ function trackerInit() {
6266
if(map) return;
6367

6468
$('#loading,#settingsbox,#aboutbox,#chasebox').hide(); // welcome screen
65-
$('header,#main,#map').show(); // interface elements
69+
$('header,#main').show(); // interface elements
6670

6771
if(is_mobile || embed.enabled) $(".nav .embed").hide();
6872

6973
if(!is_mobile) {
7074
if(!embed.enabled) $.getScript("js/ssdv.js");
7175

7276
$.getScript("js/init_plot.js", function() { checkSize(); if(!map) load(); });
73-
if(embed.graph) $('#telemetry_graph').addClass("main_screen").attr('style','');
77+
if(embed.graph) $('#telemetry_graph').attr('style','');
7478
return;
7579
}
7680
checkSize();
@@ -385,65 +389,27 @@ $(window).ready(function() {
385389

386390
// menu interface options
387391
$('.nav')
388-
.on('click', '.home', function() {
392+
.on('click', 'li', function() {
389393
var e = $(this);
390-
var box = $('.main_screen');
391-
if(box.is(':hidden')) {
392-
$('#chasecarbox,#aboutbox,#settingsbox,#embedbox').hide();
393-
box.show();
394+
var name = e.attr('class').replace(" last","");
395+
var box = $("#"+name+"box");
394396

395-
// analytics
396-
if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'UI Menubar', 'Open Page', 'Map']);
397-
}
398-
checkSize();
399-
})
400-
.on('click', '.chasecar', function() {
401-
var e = $(this);
402-
var box = $('#chasecarbox');
403397
if(box.is(':hidden')) {
404-
$('.main_screen,#aboutbox,#settingsbox,#embedbox').hide();
398+
$('.flatpage').hide();
405399
box.show().scrollTop(0);
406400

407401
// analytics
408-
if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'UI Menubar', 'Open Page', 'Chase Car']);
409-
}
410-
checkSize();
411-
})
412-
.on('click', '.about', function() {
413-
var e = $(this);
414-
var box = $('#aboutbox');
415-
if(box.is(':hidden')) {
416-
$('.main_screen,#chasecarbox,#settingsbox,#embedbox').hide();
417-
box.show().scrollTop(0);
402+
var pretty_name;
403+
switch(name) {
404+
case "home": pretty_name = "Map"; break;
405+
case "chasecar": pretty_name = "Chase Car"; break;
406+
default: pretty_name = name[0].toUpperCase() + name.slice(1);
407+
}
418408

419-
// analytics
420-
if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'UI Menubar', 'Open Page', 'About']);
409+
if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'UI Menubar', 'Open Page', pretty_name]);
421410
}
422411
checkSize();
423412
})
424-
.on('click', '.settings', function() {
425-
var e = $(this);
426-
var box = $('#settingsbox');
427-
if(box.is(':hidden')) {
428-
$('.main_screen,#chasecarbox,#aboutbox,#embedbox').hide();
429-
box.show().scrollTop(0);
430-
431-
// analytics
432-
if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'UI Menubar', 'Open Page', 'Settings']);
433-
}
434-
})
435-
.on('click', '.embed', function() {
436-
var e = $(this);
437-
var box = $('#embedbox');
438-
if(box.is(':hidden')) {
439-
$('.main_screen,#chasecarbox,#aboutbox,#settingsbox').hide();
440-
box.show().scrollTop(0);
441-
442-
// analytics
443-
if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'UI Menubar', 'Open Page', 'Embed']);
444-
}
445-
checkSize();
446-
});
447413

448414
// toggle functionality for switch button
449415
$("#sw_chasecar").click(function() {

0 commit comments

Comments
 (0)