diff options
Diffstat (limited to 'StoneIsland/www/js')
| -rwxr-xr-x | StoneIsland/www/js/lib/etc/push.js | 19 | ||||
| -rwxr-xr-x | StoneIsland/www/js/lib/nav/IntroView.js | 3 |
2 files changed, 18 insertions, 4 deletions
diff --git a/StoneIsland/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js index eb0dd4c3..9260ca14 100755 --- a/StoneIsland/www/js/lib/etc/push.js +++ b/StoneIsland/www/js/lib/etc/push.js @@ -51,15 +51,26 @@ var push = (function(){ // } // }, push.error) } - push.got_push_notification = function(pnObj) { - alert('We received this push notification: ' + JSON.stringify(pnObj)); + push.got_push_notification = function(push_obj) { + alert('We received this push notification: ' + JSON.stringify(push_obj)); app.collection.loaded = false app.hub.loaded = false - if (pnObj.receivedInForeground === false) { - // TODO: route the user to the uri in pnObj + if (push_obj.receivedInForeground === false) { + // TODO: route the user to the uri in push_obj } else { app.route("intro") + try { + var is_hub = JSON.stringify(push_obj || {}).match(/hub/i) + if (is_hub) { + app.intro.$alert.show().html("[ HUB UPDATED ]") + } + else { + app.intro.$alert.show().html("[ STORE UPDATED ]") + } + catch (e) { + app.intro.$alert.show().html("[ HUB UPDATED ]") + } } } push.error = function(e){ diff --git a/StoneIsland/www/js/lib/nav/IntroView.js b/StoneIsland/www/js/lib/nav/IntroView.js index 2d8dca43..8797241f 100755 --- a/StoneIsland/www/js/lib/nav/IntroView.js +++ b/StoneIsland/www/js/lib/nav/IntroView.js @@ -10,8 +10,10 @@ var IntroView = View.extend({ }, initialize: function(){ + this.$alert = this.$(".alert") this.compass = this.$("#compass").get(0) this.orient = this.deviceorientation.bind(this) + this.$alert.hide() }, show: function(){ @@ -24,6 +26,7 @@ var IntroView = View.extend({ hide: function(){ window.removeEventListener("deviceorientation", this.orient) + this.$alert.hide() }, deviceorientation: function(e){ |
