summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/account
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/account')
-rw-r--r--StoneIsland/www/js/lib/account/LoginView.js57
-rw-r--r--StoneIsland/www/js/lib/account/PaymentView.js33
-rw-r--r--StoneIsland/www/js/lib/account/ProfileView.js5
-rw-r--r--StoneIsland/www/js/lib/account/ShippingView.js12
-rw-r--r--StoneIsland/www/js/lib/account/SignupView.js5
5 files changed, 112 insertions, 0 deletions
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