summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-30 23:11:28 -0500
committerJules Laplace <jules@okfoc.us>2015-11-30 23:11:28 -0500
commit83a884197ff0226631a46e4894f22b8468b15598 (patch)
tree4048ed87510ae15d283f63ef799072914ed4b2d3
parentef14c875d7056f90be606ebf1f389c112b947f81 (diff)
add deep linking lib
-rw-r--r--StoneIsland/www/index.html2
-rw-r--r--StoneIsland/www/js/index.js2
-rw-r--r--StoneIsland/www/js/lib/_router.js11
-rw-r--r--StoneIsland/www/js/lib/etc/deeplink.js3
-rw-r--r--StoneIsland/www/js/lib/etc/push.js1
5 files changed, 18 insertions, 1 deletions
diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html
index 7bd73c84..03d4a958 100644
--- a/StoneIsland/www/index.html
+++ b/StoneIsland/www/index.html
@@ -1063,6 +1063,8 @@
<script src="js/sdk/product.js"></script>
<script src="js/sdk/shipping.js"></script>
+<script src="js/lib/etc/push.js"></script>
+<script src="js/lib/etc/deeplink.js"></script>
<script src="js/lib/etc/geo.js"></script>
<script src="js/lib/view/View.js"></script>
diff --git a/StoneIsland/www/js/index.js b/StoneIsland/www/js/index.js
index 1f2de128..e6bdf49f 100644
--- a/StoneIsland/www/js/index.js
+++ b/StoneIsland/www/js/index.js
@@ -69,7 +69,7 @@ var app = (function(){
app.view = null
app.router = new SiteRouter ()
- app.account.connect( app.router.route.bind(app.router) )
+ app.account.connect( app.router.launch.bind(app.router) )
$("body").removeClass("loading")
}
diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js
index b70d9be8..23daf4c7 100644
--- a/StoneIsland/www/js/lib/_router.js
+++ b/StoneIsland/www/js/lib/_router.js
@@ -47,6 +47,17 @@ var SiteRouter = Router.extend({
}
}
},
+
+ initial_route: null,
+ launch: function(){
+ if (this.initial_route) {
+ this.parseRoute( this.initial_route )
+ }
+ else {
+ this.route()
+ }
+ this.initial_route = null
+ },
go: function(url){
if (app.view && app.view.hide) {
diff --git a/StoneIsland/www/js/lib/etc/deeplink.js b/StoneIsland/www/js/lib/etc/deeplink.js
new file mode 100644
index 00000000..648dd167
--- /dev/null
+++ b/StoneIsland/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/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js
new file mode 100644
index 00000000..ab0c0141
--- /dev/null
+++ b/StoneIsland/www/js/lib/etc/push.js
@@ -0,0 +1 @@
+// \ No newline at end of file