summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/account/AccountView.js1
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/auth/SignupView.js9
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js1
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js5
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js1
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js1
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/view/Serializable.js10
7 files changed, 23 insertions, 5 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/account/AccountView.js b/StoneIsland/platforms/ios/www/js/lib/account/AccountView.js
index 0d015ab3..c9a94311 100755
--- a/StoneIsland/platforms/ios/www/js/lib/account/AccountView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/account/AccountView.js
@@ -53,6 +53,7 @@ var AccountView = View.extend({
}.bind(this))
app.cart.shipping.populate()
+ app.cart.payment.populate()
cb && cb()
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js b/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
index 4645d4d9..8d9cf52d 100755
--- a/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
@@ -103,7 +103,14 @@ var SignupView = FormView.extend({
app.signup.show_errors([[ 'Name', data['Error']['Description'] ]])
}
catch (e) {
- app.signup.show_errors([[ 'Name', "There was an unknown error." ]])
+ switch (data.status) {
+ case 409:
+ app.signup.show_errors([[ 'Email', "Email is already in use." ]])
+ break
+ default:
+ app.signup.show_errors([[ 'Name', "There was an unknown error." ]])
+ break
+ }
}
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js
index b7eb8828..e1bfb114 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartConfirm.js
@@ -32,6 +32,7 @@ var CartConfirm = FormView.extend({
window.location.hash = "#/cart/confirm"
this.deferScrollToTop()
+ app.view = this
app.curtain.show("loading")
promise(sdk.cart.get_status).then( this.populate.bind(this) )
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js
index ab454246..a19e69a5 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartPayment.js
@@ -44,6 +44,7 @@ var CartPayment = FormView.extend({
app.footer.show("CONFIRM >")
window.location.hash = "#/cart/payment"
+ app.view = this
this.populate()
this.deferScrollToTop()
},
@@ -138,7 +139,9 @@ var CartPayment = FormView.extend({
this.success()
}.bind(this)).error(function(data){
app.curtain.hide("loading")
+ console.log("card payment error")
console.log(data)
+ app.cart.payment.show_errors([["","There was a problem with your credit card."]])
}.bind(this))
return
@@ -173,6 +176,7 @@ var CartPayment = FormView.extend({
},
error: function(data){
+ console.log("card payment error")
console.log(data)
app.cart.payment.show_errors([["Number","There was a problem with your credit card."]])
},
@@ -181,5 +185,4 @@ var CartPayment = FormView.extend({
app.router.go('cart/shipping')
},
-
}) \ No newline at end of file
diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js
index 1f60307e..fd227324 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js
@@ -30,6 +30,7 @@ var CartShipping = FormView.extend({
app.cart.el.className = "shipping"
app.footer.show("PAYMENT >")
window.location.hash = "#/cart/shipping"
+ app.view = this
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 c3156265..9b5da7b7 100755
--- a/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js
+++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js
@@ -28,6 +28,7 @@ var CartSummary = ScrollableView.extend({
document.body.className = "cart"
app.cart.el.className = "summary"
window.location.hash = "#/cart/summary"
+ app.view = this
if (auth.has_cart()) {
this.load()
}
diff --git a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
index 98aa8ce3..8d25daf4 100755
--- a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
+++ b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
@@ -97,7 +97,8 @@ var SerializableView = View.extend({
},
show_errors: function(errors){
- console.log(errors)
+ console.log("showing errors")
+ console.log(errors)
var msgs = []
errors.forEach(function(e, i){
if (i > 0) { return }
@@ -146,17 +147,20 @@ var SerializableView = View.extend({
}.bind(this),
error: function(data){
app.curtain.hide("loading")
+ console.log("api error")
this.error(data)
}.bind(this),
})
},
success: function(data){
- console.log("SUCCESS", data)
+ console.log("SUCCESS")
+ console.log(data)
},
error: function(data){
- console.log("FAIL", data)
+ console.log("FAIL")
+ console.log(data)
},
})