From 3bd704dd83f55a038b1eac699ecdf1fa3bbf8123 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 7 Mar 2016 16:14:16 +0100 Subject: fixing weirdness --- StoneIsland/config.xml | 2 +- .../user.xcuserdatad/UserInterfaceState.xcuserstate | Bin 41602 -> 41614 bytes .../ios/Stone Island/Stone Island-Info.plist | 4 ++-- StoneIsland/platforms/ios/Stone Island/config.xml | 2 +- .../platforms/ios/www/js/lib/account/AccountView.js | 1 + .../platforms/ios/www/js/lib/auth/SignupView.js | 9 ++++++++- .../platforms/ios/www/js/lib/cart/CartConfirm.js | 1 + .../platforms/ios/www/js/lib/cart/CartPayment.js | 5 ++++- .../platforms/ios/www/js/lib/cart/CartShipping.js | 1 + .../platforms/ios/www/js/lib/cart/CartSummary.js | 1 + .../platforms/ios/www/js/lib/view/Serializable.js | 10 +++++++--- StoneIsland/www/js/lib/account/AccountView.js | 1 + StoneIsland/www/js/lib/auth/SignupView.js | 9 ++++++++- StoneIsland/www/js/lib/cart/CartConfirm.js | 1 + StoneIsland/www/js/lib/cart/CartPayment.js | 5 ++++- StoneIsland/www/js/lib/cart/CartShipping.js | 1 + StoneIsland/www/js/lib/cart/CartSummary.js | 1 + StoneIsland/www/js/lib/view/Serializable.js | 10 +++++++--- 18 files changed, 50 insertions(+), 14 deletions(-) (limited to 'StoneIsland') diff --git a/StoneIsland/config.xml b/StoneIsland/config.xml index 33cbbd87..6a9ded95 100755 --- a/StoneIsland/config.xml +++ b/StoneIsland/config.xml @@ -1,5 +1,5 @@ - + Stone Island Stone Island diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate index 95a3a47b..48ed2a15 100755 Binary files a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate and b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist index 73cfd97a..96abd27c 100755 --- a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist +++ b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist @@ -57,7 +57,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.5.4 + 0.5.5 CFBundleSignature ???? CFBundleURLTypes @@ -70,7 +70,7 @@ CFBundleVersion - 0.5.4 + 0.5.5 LSApplicationQueriesSchemes youtube diff --git a/StoneIsland/platforms/ios/Stone Island/config.xml b/StoneIsland/platforms/ios/Stone Island/config.xml index caaf6ba2..aae77f74 100755 --- a/StoneIsland/platforms/ios/Stone Island/config.xml +++ b/StoneIsland/platforms/ios/Stone Island/config.xml @@ -1,5 +1,5 @@ - + 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) }, }) diff --git a/StoneIsland/www/js/lib/account/AccountView.js b/StoneIsland/www/js/lib/account/AccountView.js index 0d015ab3..c9a94311 100755 --- a/StoneIsland/www/js/lib/account/AccountView.js +++ b/StoneIsland/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/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js index 4645d4d9..8d9cf52d 100755 --- a/StoneIsland/www/js/lib/auth/SignupView.js +++ b/StoneIsland/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/www/js/lib/cart/CartConfirm.js b/StoneIsland/www/js/lib/cart/CartConfirm.js index b7eb8828..e1bfb114 100755 --- a/StoneIsland/www/js/lib/cart/CartConfirm.js +++ b/StoneIsland/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/www/js/lib/cart/CartPayment.js b/StoneIsland/www/js/lib/cart/CartPayment.js index ab454246..a19e69a5 100755 --- a/StoneIsland/www/js/lib/cart/CartPayment.js +++ b/StoneIsland/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/www/js/lib/cart/CartShipping.js b/StoneIsland/www/js/lib/cart/CartShipping.js index 1f60307e..fd227324 100755 --- a/StoneIsland/www/js/lib/cart/CartShipping.js +++ b/StoneIsland/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/www/js/lib/cart/CartSummary.js b/StoneIsland/www/js/lib/cart/CartSummary.js index c3156265..9b5da7b7 100755 --- a/StoneIsland/www/js/lib/cart/CartSummary.js +++ b/StoneIsland/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/www/js/lib/view/Serializable.js b/StoneIsland/www/js/lib/view/Serializable.js index 98aa8ce3..8d25daf4 100755 --- a/StoneIsland/www/js/lib/view/Serializable.js +++ b/StoneIsland/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) }, }) -- cgit v1.2.3-70-g09d2