Skip to content

Commit a6819c6

Browse files
chasecar lib will report client info
1 parent c5a7c1c commit a6819c6

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.swp
2+
js/mobile.js
3+
css/mobile.css

build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ rm -f mobile.js
1717
# precompiled libs
1818
cat jquery* iscroll.js >> mobile.js
1919

20+
export VERSION="`git rev-parse --short HEAD`"
21+
2022
# compile the rest
21-
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge chasecar.lib.js >> mobile.js
23+
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge chasecar.lib.js | sed "s/{VER}/$VERSION/" >> mobile.js
2224
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge nite-overlay.js >> mobile.js
2325
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge tracker.js >> mobile.js
2426
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge app.js >> mobile.js
2527

2628
cd ..
2729
echo "Done!"
30+
echo "Build version: $VERSION"

cache.manifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
CACHE MANIFEST
2-
# version 28
2+
# version 30
33

44
# gogole maps files
55
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg
66
http://maps.gstatic.com/intl/en_us/mapfiles/api-3/10/20/main.js
77
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bcommon,map,util,geometry,poly,overlay%7D.js
8-
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bcommon,util,stats%7D.js
8+
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bcommon,util,stats%7D.js
99
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bcommon,map,util,geometry,poly,overlay,stats%7D.js
1010
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bstats%7D.js
1111
http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/10/20/%7Bonion%7D.js

css/mobile.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

js/chasecar.lib.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ ChaseCar.request = function(doc) {
3333
if(ChaseCar.ucount == ChaseCar.uused && !ChaseCar.uuidsRequested) {
3434
ChaseCar.uuidsRequested = true; // blocks further uuids request until the current one completes
3535
ChaseCar.getUUIDS(function() {
36-
ChaseCar.uuidsRequested = false;
36+
ChaseCar.uuidsRequested = false;
3737
ChaseCar.request();
3838
});
3939
return;
4040
} else {
4141
ChaseCar.uused++;
4242
// get one uuid and one doc from the queue and push to habitat
4343
var uuid = ChaseCar._uuids.shift(), doc = ChaseCar.queue.shift();
44-
44+
4545
// update doc with uuids and time of upload
4646
doc._id = uuid;
4747
doc.time_uploaded = (new Date()).toISOString();
@@ -61,7 +61,7 @@ ChaseCar.request = function(doc) {
6161
// @callsign string
6262
ChaseCar.putListenerInfo = function(callsign) {
6363
if(!callsign) return;
64-
64+
6565
ChaseCar.request({
6666
'type': "listener_information",
6767
'time_created': (new Date()).toISOString(),
@@ -73,17 +73,22 @@ ChaseCar.putListenerInfo = function(callsign) {
7373
// @position object (geolocation position object)
7474
ChaseCar.updatePosition = function(callsign, position) {
7575
if(!position || !position.coords) return;
76-
76+
7777
ChaseCar.request({
7878
'type': "listener_telemetry",
7979
'time_created': (new Date()).toISOString(),
80-
'data': {
80+
'data': {
8181
'callsign': callsign,
8282
'chase': true,
8383
'latitude': position.coords.latitude,
8484
'longitude': position.coords.longitude,
8585
'altitude': ((!!position.coords.altitude) ? position.coords.altitude : 0),
86-
'speed': ((!!position.coords.speed) ? position.coords.speed : 0)
86+
'speed': ((!!position.coords.speed) ? position.coords.speed : 0),
87+
'client': {
88+
'name': 'Habitat Mobile Tracker',
89+
'version': '{VER}',
90+
'agent': navigator.userAgent
91+
}
8792
}
8893
});
8994
}

js/mobile.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)