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/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 +++ 5 files changed, 112 insertions(+) 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 (limited to 'StoneIsland/www/js/lib/account') 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 -- cgit v1.2.3-70-g09d2