From aa23fc23b5a8cf43d115bcf3953806e66dadf1c3 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 7 Nov 2015 16:49:17 -0500 Subject: stub in account views.. --- StoneIsland/www/index.html | 166 +++++++++++++------------ StoneIsland/www/js/lib/account/LoginView.js | 57 +++++++++ StoneIsland/www/js/lib/account/PaymentView.js | 33 +++++ StoneIsland/www/js/lib/account/ProfileView.js | 5 + StoneIsland/www/js/lib/account/ShippingView.js | 12 ++ StoneIsland/www/js/lib/account/SignupView.js | 5 + StoneIsland/www/js/lib/cart/CartBilling.js | 5 +- StoneIsland/www/js/lib/cart/CartShipping.js | 5 +- StoneIsland/www/js/lib/nav/LoginView.js | 57 --------- 9 files changed, 205 insertions(+), 140 deletions(-) create mode 100644 StoneIsland/www/js/lib/account/LoginView.js create mode 100644 StoneIsland/www/js/lib/account/PaymentView.js create mode 100644 StoneIsland/www/js/lib/account/ProfileView.js create mode 100644 StoneIsland/www/js/lib/account/ShippingView.js create mode 100644 StoneIsland/www/js/lib/account/SignupView.js delete mode 100644 StoneIsland/www/js/lib/nav/LoginView.js diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html index 953b3f8d..a00539d4 100644 --- a/StoneIsland/www/index.html +++ b/StoneIsland/www/index.html @@ -231,86 +231,10 @@ -
+
ADDRESS
-
-
- - -
-
- - - -
-
- - -
-
- - -
-
- - -
-

SHIPPING METHOD

@@ -327,13 +251,92 @@
-
+
+ + @@ -358,9 +361,14 @@ - + + + + + + diff --git a/StoneIsland/www/js/lib/account/LoginView.js b/StoneIsland/www/js/lib/account/LoginView.js new file mode 100644 index 00000000..60f6263e --- /dev/null +++ b/StoneIsland/www/js/lib/account/LoginView.js @@ -0,0 +1,57 @@ +var LoginView = View.extend({ + + el: "#login", + + events: { + "click .close": "hide", + "click .login_ask": "login", + "click .signup_ask": "signup", + "submit form": "submit", + }, + + mode: null, + + initialize: function(){ + this.$form = this.$("form") + this.$email = this.$("[name=email]") + this.$password = this.$("[name=password]") + }, + + show: function(){ + this.$form.hide() + this.$email.val("") + this.$password.val("") + app.curtain.show() + document.body.classList.add("login") + }, + + hide: function(){ + app.curtain.hide() + document.body.classList.remove("login") + }, + + login: function(){ + this.mode = "login" + this.$form.show() + }, + + signup: function(){ + this.mode = "signup" + this.$form.show() + }, + + submit: function(e){ + e.preventDefault() + if (this.mode == "login") { + // login api + } + else { + // signup api + } + }, + + success: function(){ + // change login in ui to logout or whatever + }, + +}) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/account/PaymentView.js b/StoneIsland/www/js/lib/account/PaymentView.js new file mode 100644 index 00000000..a8c68267 --- /dev/null +++ b/StoneIsland/www/js/lib/account/PaymentView.js @@ -0,0 +1,33 @@ +var PaymentView = View.extend({ + + el: "#payment", + + events: { + }, + + initialize: function(){ + this.address = new AddressView () + }, + +}) + +var AddressView = View.extend({ + + template: $("#address_template").html(), + + events: { + }, + + initialize: function(){ + }, + + build: function(){ + }, + + deserialize: function(){ + }, + + serialize: function(){ + }, + +}) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/account/ProfileView.js b/StoneIsland/www/js/lib/account/ProfileView.js new file mode 100644 index 00000000..93c61b33 --- /dev/null +++ b/StoneIsland/www/js/lib/account/ProfileView.js @@ -0,0 +1,5 @@ +var ProfileView = View.extend({ + + el: "#profile", + +}) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/account/ShippingView.js b/StoneIsland/www/js/lib/account/ShippingView.js new file mode 100644 index 00000000..5bf80cfb --- /dev/null +++ b/StoneIsland/www/js/lib/account/ShippingView.js @@ -0,0 +1,12 @@ +var ShippingView = View.extend({ + + el: "#shipping", + + events: { + }, + + initialize: function(){ + this.address = new AddressView () + }, + +}) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/account/SignupView.js b/StoneIsland/www/js/lib/account/SignupView.js new file mode 100644 index 00000000..395c0b00 --- /dev/null +++ b/StoneIsland/www/js/lib/account/SignupView.js @@ -0,0 +1,5 @@ +var SignupView = View.extend({ + + el: "#signup", + +}) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/cart/CartBilling.js b/StoneIsland/www/js/lib/cart/CartBilling.js index f3c9cbe2..447fae0f 100644 --- a/StoneIsland/www/js/lib/cart/CartBilling.js +++ b/StoneIsland/www/js/lib/cart/CartBilling.js @@ -1,11 +1,12 @@ var CartBilling = View.extend({ - el: "#billing", + el: "#cart_billing", events: { }, - + initialize: function(){ + this.address = new AddressView () }, }) \ 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 beaf6bd2..32b25bb9 100644 --- a/StoneIsland/www/js/lib/cart/CartShipping.js +++ b/StoneIsland/www/js/lib/cart/CartShipping.js @@ -1,11 +1,12 @@ var CartShipping = View.extend({ - el: "#shipping", + el: "#cart_shipping", events: { }, - + initialize: function(){ + this.address = new AddressView () }, }) \ No newline at end of file diff --git a/StoneIsland/www/js/lib/nav/LoginView.js b/StoneIsland/www/js/lib/nav/LoginView.js deleted file mode 100644 index 60f6263e..00000000 --- a/StoneIsland/www/js/lib/nav/LoginView.js +++ /dev/null @@ -1,57 +0,0 @@ -var LoginView = View.extend({ - - el: "#login", - - events: { - "click .close": "hide", - "click .login_ask": "login", - "click .signup_ask": "signup", - "submit form": "submit", - }, - - mode: null, - - initialize: function(){ - this.$form = this.$("form") - this.$email = this.$("[name=email]") - this.$password = this.$("[name=password]") - }, - - show: function(){ - this.$form.hide() - this.$email.val("") - this.$password.val("") - app.curtain.show() - document.body.classList.add("login") - }, - - hide: function(){ - app.curtain.hide() - document.body.classList.remove("login") - }, - - login: function(){ - this.mode = "login" - this.$form.show() - }, - - signup: function(){ - this.mode = "signup" - this.$form.show() - }, - - submit: function(e){ - e.preventDefault() - if (this.mode == "login") { - // login api - } - else { - // signup api - } - }, - - success: function(){ - // change login in ui to logout or whatever - }, - -}) \ No newline at end of file -- cgit v1.2.3-70-g09d2