summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-12-11 02:06:50 -0600
committerJules Laplace <jules@okfoc.us>2015-12-11 02:06:50 -0600
commitfb691ed5fbe0122efa1b8eda05c40f2f1272b1b0 (patch)
treef6c9da3ed67b1c9fe1576e3d9febaf8bd2587ced /StoneIsland/platforms/ios/www/js
parent20739f5f572e043aec1a4b25de63231c4c176ffe (diff)
rebuild
Diffstat (limited to 'StoneIsland/platforms/ios/www/js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/account/PaymentView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/account/ProfileView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/account/SettingsView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/account/ShippingView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/auth/LoginView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/auth/SignupView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/nav/SearchView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/products/ProductView.js72
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/products/Selector.js18
-rwxr-xr-xStoneIsland/platforms/ios/www/js/sdk/_sdk.js2
14 files changed, 70 insertions, 44 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/account/PaymentView.js b/StoneIsland/platforms/ios/www/js/lib/account/PaymentView.js
index 03dc8cbf..8b49ed1d 100755
--- a/StoneIsland/platforms/ios/www/js/lib/account/PaymentView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/account/PaymentView.js
@@ -34,7 +34,7 @@ var PaymentView = FormView.extend({
show: function(){
if (! auth.logged_in()) { return app.router.go("intro") }
- app.footer.show("SAVE", "CANCEL")
+ app.footer.show("SAVE")
document.body.className = "payment"
this.deferScrollToTop()
// this.preload()
diff --git a/StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js b/StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js
index ed2f3536..f370c055 100755
--- a/StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js
@@ -15,7 +15,7 @@ var ProfileView = FormView.extend({
show: function(){
if (! auth.logged_in()) { return app.router.go("intro") }
- app.footer.show("SAVE", "CANCEL")
+ app.footer.show("SAVE")
document.body.className = "profile"
this.preload(auth.user)
this.deferScrollToTop()
diff --git a/StoneIsland/platforms/ios/www/js/lib/account/SettingsView.js b/StoneIsland/platforms/ios/www/js/lib/account/SettingsView.js
index 7f96bb88..0de80048 100755
--- a/StoneIsland/platforms/ios/www/js/lib/account/SettingsView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/account/SettingsView.js
@@ -13,7 +13,7 @@ var SettingsView = FormView.extend({
show: function(){
if (! auth.logged_in()) { return app.router.go("intro") }
- app.footer.show("SAVE", "CANCEL")
+ app.footer.show("SAVE")
document.body.className = "settings"
this.deferScrollToTop()
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/account/ShippingView.js b/StoneIsland/platforms/ios/www/js/lib/account/ShippingView.js
index 39baf2aa..0bf88025 100755
--- a/StoneIsland/platforms/ios/www/js/lib/account/ShippingView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/account/ShippingView.js
@@ -33,7 +33,7 @@ var ShippingView = FormView.extend({
show: function(){
if (! auth.logged_in()) { return app.router.go("intro") }
// this.preload( this.data || this.test_data )
- app.footer.show("SAVE", "CANCEL")
+ app.footer.show("SAVE")
document.body.className = "shipping"
this.deferScrollToTop()
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/auth/LoginView.js b/StoneIsland/platforms/ios/www/js/lib/auth/LoginView.js
index 1f7438cc..8a002632 100755
--- a/StoneIsland/platforms/ios/www/js/lib/auth/LoginView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/auth/LoginView.js
@@ -21,7 +21,7 @@ var LoginView = FormView.extend({
return
}
var msg = "* Your personal and payment<br>information will always remain private"
- app.footer.show("SUBMIT", "CANCEL")
+ app.footer.show("SUBMIT")
this.$form.get(0).reset()
this.$msg.html(msg)
document.body.className = "login"
diff --git a/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js b/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
index afbb8877..ff5fa6bb 100755
--- a/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
@@ -36,7 +36,7 @@ var SignupView = FormView.extend({
return
}
var msg = "* Your personal and payment<br>information will always remain private"
- app.footer.show("SUBMIT", "CANCEL")
+ app.footer.show("SUBMIT")
this.$form.get(0).reset()
this.$msg.html(msg)
document.body.className = "signup"
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js
index f6c7f1f5..b7eb8828 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js
@@ -28,7 +28,7 @@ var CartConfirm = FormView.extend({
show: function(){
document.body.className = "cart"
app.cart.el.className = "confirm"
- app.footer.show("PLACE ORDER", "CANCEL")
+ app.footer.show("PLACE ORDER")
window.location.hash = "#/cart/confirm"
this.deferScrollToTop()
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js
index f3c54d55..ab454246 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js
@@ -41,7 +41,7 @@ var CartPayment = FormView.extend({
show: function(){
document.body.className = "cart"
app.cart.el.className = "payment"
- app.footer.show("CONFIRM &gt;", "CANCEL")
+ app.footer.show("CONFIRM &gt;")
window.location.hash = "#/cart/payment"
this.populate()
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js
index f17d42d2..1f60307e 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js
@@ -28,7 +28,7 @@ var CartShipping = FormView.extend({
show: function(){
document.body.className = "cart"
app.cart.el.className = "shipping"
- app.footer.show("PAYMENT &gt;", "CANCEL")
+ app.footer.show("PAYMENT &gt;")
window.location.hash = "#/cart/shipping"
this.populate()
this.deferScrollToTop()
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js
index 21fc27dc..01887d95 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js
@@ -38,7 +38,7 @@ var CartSummary = ScrollableView.extend({
load: function(){
this.el.className = "loading"
- app.footer.show("SHIPPING &gt;", "CANCEL")
+ app.footer.show("SHIPPING &gt;")
app.curtain.show("loading")
sdk.cart.get_status({
success: this.populate.bind(this),
diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/SearchView.js b/StoneIsland/platforms/ios/www/js/lib/nav/SearchView.js
index f21634a5..b477d72f 100755
--- a/StoneIsland/platforms/ios/www/js/lib/nav/SearchView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/nav/SearchView.js
@@ -6,7 +6,7 @@ var SearchView = View.extend({
},
show: function(){
- app.footer.show("SEARCH", "CANCEL")
+ app.footer.show("SEARCH")
document.body.className = "search"
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
index 6893f88c..285e551d 100755
--- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js
@@ -29,12 +29,21 @@ var ProductView = ScrollableView.extend({
},
show: function(){
- app.footer.show("ADD TO CART", "BUY NOW")
+ this.showFooter()
document.body.className = "product"
},
hide: function(){
},
+ showFooter: function(){
+ if (this.not_available) {
+ app.footer.show("SOLD OUT")
+ }
+ else {
+ app.footer.show("ADD TO CART", "BUY NOW")
+ }
+ },
+
item: null,
details: null,
size: null,
@@ -87,7 +96,6 @@ var ProductView = ScrollableView.extend({
}
window.location.href = "#/store/" + code
- console.log(data)
if (data) {
app.collection.items[code] = data
}
@@ -113,38 +121,46 @@ var ProductView = ScrollableView.extend({
var body = descriptions['EditorialDescription'].replace(/<br>/g, "<br><br>")
var default_color_id = this.populate_selectors(data, details)
-
- var color = this.colors[default_color_id]
- var color_label = color.label
- var sizes = this.find_sizes_for_color(default_color_id)
- var size = sizes[0]
- var size_label = this.sizes[size].label
- this.is_onesize = !! this.sizes[1]
+ if (this.not_available) {
+ this.$color.html("NOT AVAILABLE")
+ this.$size.hide()
+ }
+ else {
+ var color = this.colors[default_color_id]
+ var color_label = color.label
+ var sizes = this.find_sizes_for_color(default_color_id)
+ var size = sizes[0]
+ var size_label = this.sizes[size].label
+
+ this.color = color
+ this.size = size
+
+ this.is_onesize = !! this.sizes[1]
+ this.$size.show().html(size_label)
+ if (color_label) {
+ this.$color.html(color_label)
+ }
+ else {
+ this.$color.hide()
+ }
+ }
+
// console.log(color, color_label, size, size_label)
this.item = data
this.details = details['Item']
this.code = data['DefaultCode10']
- this.color = color
- this.size = size
-
this.$num.html(num)
this.$title.html(title)
this.$type.html(type)
this.$price.html(price)
this.$body.html(body)
-
- this.$size.html(size_label)
- if (color_label) {
- this.$color.show().html(color_label)
- }
- else {
- this.$color.hide()
- }
+ this.showFooter()
+
this.deferScrollToTop()
},
@@ -167,6 +183,15 @@ var ProductView = ScrollableView.extend({
populate_selectors: function(data, details){
var sizes = {}, colors = {}, size_lookup = {}, default_color
+ console.log(details['Item']['ModelColors'].length)
+ if (! details['Item']['ModelColors'].length) {
+ this.not_available = true
+ return
+ }
+ else {
+ this.not_available = false
+ }
+
details['Item']['ModelColors'].forEach(function(color, index){
if (! default_color || color['Code10'] == data['DefaultCode10']) {
default_color = color['ColorId']
@@ -203,7 +228,7 @@ var ProductView = ScrollableView.extend({
},
select_size: function(){
-
+ if (this.not_available) { return }
if (this.is_onesize) { return this.select_color() }
if (this.item['Sizes'].length == 0) { return }
var sizes = Object.keys(this.sizes).map(function(key){
@@ -217,6 +242,7 @@ var ProductView = ScrollableView.extend({
},
select_color: function(){
+ if (this.not_available) { return }
if (this.item['Colors'].length == 0) { return }
var colors = Object.keys(this.colors).map(function(key){
return this.colors[key]
@@ -224,15 +250,19 @@ var ProductView = ScrollableView.extend({
app.selector.select("style", colors, function(color){
this.code = color.code
this.$color.html(color.label)
+
+ // UPDATE GALLERY
}.bind(this))
},
// ADD TO CART
save: function(){
+ if (this.not_available) { return }
this.add_to_cart({ route: false })
},
// BUY NOW
cancel: function(){
+ if (this.not_available) { return }
this.add_to_cart({ route: true })
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/Selector.js b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js
index 69bb1186..17278a06 100755
--- a/StoneIsland/platforms/ios/www/js/lib/products/Selector.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js
@@ -27,17 +27,13 @@ var Selector = View.extend({
this.$el.show()
app.curtain.show("white")
this.visible = true
- var selectionXY = $("." + origin).offset()
- var selectionWidth = $("." + origin).width()
- var selectorHeight = $('#selector').height()
- console.log(selectionXY.left)
- console.log(selectionXY.top)
-
- $("#selector").css({"top":(selectionXY.top - selectorHeight),"left":selectionXY.left})
-
-
-
-
+// var selectionXY = $("." + origin).offset()
+// var selectionWidth = $("." + origin).width()
+// var selectorHeight = $('#selector').height()
+// console.log(selectionXY.left)
+// console.log(selectionXY.top)
+//
+// $("#selector").css({"top":(selectionXY.top - selectorHeight),"left":selectionXY.left})
},
hide: function(){
diff --git a/StoneIsland/platforms/ios/www/js/sdk/_sdk.js b/StoneIsland/platforms/ios/www/js/sdk/_sdk.js
index b7880e50..017df015 100755
--- a/StoneIsland/platforms/ios/www/js/sdk/_sdk.js
+++ b/StoneIsland/platforms/ios/www/js/sdk/_sdk.js
@@ -26,7 +26,7 @@ var sdk = (function(){
}
sdk.image = function(code, size){
- return "http://cdn.yoox.biz/" + code.substr(0,2) + "/" + code.substr(0,8) + "_" + size + ".jpg"
+ return "http://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_" + size + ".jpg"
}
$.ajaxSetup({