summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/etc
diff options
context:
space:
mode:
authorRene Ae <aehtyb@gmail.com>2015-12-04 20:32:44 -0600
committerRene Ae <aehtyb@gmail.com>2015-12-04 20:32:44 -0600
commit10efb0f7b426426057fed757fe3c851a249358dd (patch)
treeb80e285251d30fbca36220c932ef180c29c55dcf /StoneIsland/platforms/android/assets/www/js/lib/etc
parent015b58ff6845b5cb79b13fec109a37b4c10c7813 (diff)
android build
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/etc')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js3
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/etc/geo.js39
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/etc/push.js1
3 files changed, 43 insertions, 0 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js
new file mode 100755
index 00000000..648dd167
--- /dev/null
+++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js
@@ -0,0 +1,3 @@
+function handleOpenURL (url) {
+ app.router.initial_route = url
+} \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/geo.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/geo.js
new file mode 100755
index 00000000..fac34c1e
--- /dev/null
+++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/geo.js
@@ -0,0 +1,39 @@
+var geo = (function(){
+ var geo = {}
+
+ geo.fetch = function(){
+ navigator.geolocation.getCurrentPosition(geo.success, geo.error, {timeout: 15000})
+ }
+
+ geo.success = function(position){
+ var lat_str = as_degrees( position.coords.latitude || 40.99167 )
+ var lng_str = as_degrees( position.coords.longitude || -74.07944 )
+ $(".latlng").html( lat_str + " " + lng_str )
+ }
+
+ geo.error = function(error){
+ $(".latlng").html( "+40&deg; 58' 90\" -74&deg; 04' 46\"" )
+ }
+
+ function as_degrees (n) {
+ var s = ""
+ if (n >= 0) s += "+"
+ s += Math.floor(n) + "&deg; "
+
+ n = Math.abs(n)
+ n %= 1
+ n *= 60
+ nn = Math.floor(n)
+ if (nn < 10) nn = "0" + nn
+ s += nn + "' "
+
+ n %= 1
+ n *= 60
+ nn = Math.floor(n)
+ if (nn < 10) nn = "0" + nn
+ s += nn + '"'
+ return s
+ }
+
+ return geo
+})() \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js
new file mode 100755
index 00000000..ab0c0141
--- /dev/null
+++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js
@@ -0,0 +1 @@
+// \ No newline at end of file