diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-21 17:45:29 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-21 17:45:29 -0500 |
| commit | d6eea989f63e1e51563daa64873ce33166bc28c0 (patch) | |
| tree | 9431419465c7151a0927ec84970befc696581380 /StoneIsland/www/js/lib | |
| parent | c223032bbd67fe5b6ad1334ce81a3f51a7631bfc (diff) | |
testin login stuff..
Diffstat (limited to 'StoneIsland/www/js/lib')
| -rw-r--r-- | StoneIsland/www/js/lib/account/ProfileView.js | 8 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/auth/LoginView.js | 2 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/auth/SignupView.js | 16 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartPayment.js | 11 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartShipping.js | 4 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartSummary.js | 19 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/AddressView.js | 4 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/CreditCardView.js | 2 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/products/ProductView.js | 2 |
9 files changed, 51 insertions, 17 deletions
diff --git a/StoneIsland/www/js/lib/account/ProfileView.js b/StoneIsland/www/js/lib/account/ProfileView.js index 3c37c835..83ab0cdc 100644 --- a/StoneIsland/www/js/lib/account/ProfileView.js +++ b/StoneIsland/www/js/lib/account/ProfileView.js @@ -22,10 +22,10 @@ var ProfileView = FormView.extend({ "Email": "Please enter a valid email address.", }, - validate_fields: function(errors){ - if (! data.CurrentPassword && data.NewPassword) { errors.push("CurrentPassword", "Please enter your current password.") } - if (data.CurrentPassword && ! data.NewPassword) { errors.push("NewPassword", "Please enter your new password.") } - if (data.NewPassword && data.NewPassword.length < 7) { errors.push("CurrentPassword", "New password must be 7 characters or more.") } + validate_fields: function(data, errors){ + if (! data.CurrentPassword && data.NewPassword) { errors.push([ "CurrentPassword", "Please enter your current password." ]) } + if (data.CurrentPassword && ! data.NewPassword) { errors.push([ "NewPassword", "Please enter your new password." ]) } + if (data.NewPassword && data.NewPassword.length < 7) { errors.push([ "CurrentPassword", "New password must be 7 characters or more." ]) } }, success: function(data){ diff --git a/StoneIsland/www/js/lib/auth/LoginView.js b/StoneIsland/www/js/lib/auth/LoginView.js index c4ec8870..1e0f3b7a 100644 --- a/StoneIsland/www/js/lib/auth/LoginView.js +++ b/StoneIsland/www/js/lib/auth/LoginView.js @@ -36,6 +36,8 @@ var LoginView = FormView.extend({ }, error: function(data){ + this.$msg.html("There was an error logging you in. Bad password?") + this.$msg.addClass('alert-notice') }, cancel: function(){ diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js index 3ad84cc9..a29b4657 100644 --- a/StoneIsland/www/js/lib/auth/SignupView.js +++ b/StoneIsland/www/js/lib/auth/SignupView.js @@ -32,13 +32,17 @@ var SignupView = FormView.extend({ "DataProfiling": "You must agree to data profiling.", }, - validate_fields: function(errors){ - if (data.Password.length < 7) { errors.push("Password", "Password must be 7 characters or more.") } - if (data.Password !== data.Password2) { errors.push("Password2", "Passwords don't match.") } - if (data.Email !== data.ConfirmEmail) { errors.push("ConfirmEmail", "Email addresses don't match.") } - if (data.DataProfiling !== "true") { errors.push("DataProfiling", "You must consent to use this service.") } - if (data.DataProfiling2 !== "true") { errors.push("DataProfiling2", "You must consent to use this service.") } + validate_fields: function(data, errors){ + if (data.Password.length < 7) { errors.push([ "Password", "Password must be 7 characters or more." ]) } + if (data.Password !== data.Password2) { errors.push([ "Password2", "Passwords don't match." ]) } + if (data.Email.toLowerCase() !== data.ConfirmEmail.toLowerCase()) { errors.push([ "ConfirmEmail", "Email addresses don't match." ]) } + if (data.DataProfiling !== "true") { errors.push([ "DataProfiling", "You must consent to use this service." ]) } + if (data.DataProfiling2 !== "true") { errors.push([ "DataProfiling2", "You must consent to use this service." ]) } if (! data.YooxLetter) { data.YooxLetter = "false" } + + delete data.DataProfiling2 + delete data.ConfirmEmail + console.log(data) }, privacy_link: function(){ diff --git a/StoneIsland/www/js/lib/cart/CartPayment.js b/StoneIsland/www/js/lib/cart/CartPayment.js index a9772ffe..19d21ffd 100644 --- a/StoneIsland/www/js/lib/cart/CartPayment.js +++ b/StoneIsland/www/js/lib/cart/CartPayment.js @@ -14,11 +14,21 @@ var CartPayment = FormView.extend({ this.scroller = new IScroll('#cart_payment', app.iscroll_options) }, + // sdk.cart.set_credit_card + // sdk.payment.list_credit_cards + // sdk.payment.add_credit_card + // sdk.payment.delete_credit_card + // sdk.payment.get_payment_types + // sdk.cart.use_stored_credit_card + show: function(){ document.body.className = "cart" app.cart.el.className = "payment" app.footer.show("CONFIRM >", "CANCEL") + this.deferScrollToTop() + + sdk.cart.set_payment_type({ data: payment_id }) }, save: function(){ @@ -27,5 +37,4 @@ var CartPayment = FormView.extend({ cancel: function(){ }, - })
\ 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 c0c21b4d..7d7c8540 100644 --- a/StoneIsland/www/js/lib/cart/CartShipping.js +++ b/StoneIsland/www/js/lib/cart/CartShipping.js @@ -20,6 +20,10 @@ var CartShipping = FormView.extend({ this.deferScrollToTop() }, + // sdk.cart.set_shipping_address + // sdk.shipping.get_delivery_types + // sdk.shipping.set_delivery_type + save: function(){ }, diff --git a/StoneIsland/www/js/lib/cart/CartSummary.js b/StoneIsland/www/js/lib/cart/CartSummary.js index 290627d3..268f6ee0 100644 --- a/StoneIsland/www/js/lib/cart/CartSummary.js +++ b/StoneIsland/www/js/lib/cart/CartSummary.js @@ -2,6 +2,8 @@ var CartSummary = ScrollableView.extend({ el: "#cart_summary", + template: $("#cart_summary .template").html(), + events: { }, @@ -20,7 +22,7 @@ var CartSummary = ScrollableView.extend({ sdk.cart.get_status({ success: this.populate.bind(this), - error: this.error.bind(this), + error: this.empty.bind(this), }) }, @@ -36,7 +38,7 @@ var CartSummary = ScrollableView.extend({ this.deferScrollToTop() }, - error: function(){ + empty: function(){ this.$loader.hide() app.footer.hide() this.parent.$itemcount.html("0 ITEMS") @@ -44,9 +46,22 @@ var CartSummary = ScrollableView.extend({ }, ok: function(){ + app.router.go('cart/shipping') }, cancel: function(){ + app.router.go('intro') + }, + + remove_item: function(e){ + // $( e.currentTarget ).closest(".row").remove() + sdk.cart.delete_item({ + data: { + Code10: "", + Size: "", + }, + }).done(function(){ + }) }, })
\ No newline at end of file diff --git a/StoneIsland/www/js/lib/nav/AddressView.js b/StoneIsland/www/js/lib/nav/AddressView.js index e5467250..15a5784d 100644 --- a/StoneIsland/www/js/lib/nav/AddressView.js +++ b/StoneIsland/www/js/lib/nav/AddressView.js @@ -32,8 +32,8 @@ var AddressView = SerializableView.extend({ "Phone": "Please enter your phone number.", }, - validate_fields: function(errors){ - if (data.Phone.replace(/[^0-9]/g, "").length < 10) { errors.push("Phone", "Phone numbers must be at least 10 digits.") } + validate_fields: function(data, errors){ + if (data.Phone.replace(/[^0-9]/g, "").length < 10) { errors.push([ "Phone", "Phone numbers must be at least 10 digits." ]) } }, }) diff --git a/StoneIsland/www/js/lib/nav/CreditCardView.js b/StoneIsland/www/js/lib/nav/CreditCardView.js index 20705a9e..33ecab79 100644 --- a/StoneIsland/www/js/lib/nav/CreditCardView.js +++ b/StoneIsland/www/js/lib/nav/CreditCardView.js @@ -21,7 +21,7 @@ var CreditCardView = View.extend({ validate_presence: { }, - validate_fields: function(errors){ + validate_fields: function(data, errors){ }, }) diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js index 84889db1..d1a9005f 100644 --- a/StoneIsland/www/js/lib/products/ProductView.js +++ b/StoneIsland/www/js/lib/products/ProductView.js @@ -88,7 +88,7 @@ var ProductView = ScrollableView.extend({ var name_partz = data['ModelNames'].split(' ') var num = name_partz.shift() var title = name_partz.join(' ') - var type = data['MicroCategory'].toUpperCase() + var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" var body = descriptions['EditorialDescription'].replace(/<br>/g, "<br><br>") |
