summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-12-11 03:36:40 -0600
committerJules Laplace <jules@okfoc.us>2015-12-11 03:36:40 -0600
commit3ae533445b2cd2738b1f4cf1c3b6faa2a0c866c9 (patch)
treef7cb6f54fe6791c48818315a7dd9ee9e112c5835
parent2582c7d92804e44250c9713d79421c8becc61f62 (diff)
perfect time for xcode to update itself
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/etc/push.js19
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/nav/IntroView.js3
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/products/CollectionView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/products/ProductView.js6
-rwxr-xr-xStoneIsland/www/js/lib/etc/push.js19
-rwxr-xr-xStoneIsland/www/js/lib/nav/IntroView.js3
6 files changed, 40 insertions, 12 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js
index eb0dd4c3..9260ca14 100755
--- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js
+++ b/StoneIsland/platforms/ios/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/platforms/ios/www/js/lib/nav/IntroView.js b/StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js
index 2d8dca43..8797241f 100755
--- a/StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js
+++ b/StoneIsland/platforms/ios/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){
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
index 7a020798..798920d1 100755
--- a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
@@ -49,7 +49,7 @@ var CollectionView = ScrollableView.extend({
return
}
this.$loader.show()
- sdk.product.collection({
+ sdk.product.all({
gallery_id: app.gallery_id,
success: this.populate.bind(this)
})
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
index 285e551d..484cd442 100755
--- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
@@ -56,7 +56,7 @@ var ProductView = ScrollableView.extend({
cache: {},
- gallery_prev: function(){
+ gallery_left: function(){
app.product.gallery.gallery.previous()
},
gallery_right: function(){
@@ -250,8 +250,8 @@ var ProductView = ScrollableView.extend({
app.selector.select("style", colors, function(color){
this.code = color.code
this.$color.html(color.label)
-
- // UPDATE GALLERY
+ this.gallery.populate( color.code, this.details['ImageTypes'] )
+ this.gallery_right()
}.bind(this))
},
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){