diff options
Diffstat (limited to 'StoneIsland/www/js/lib/account')
| -rw-r--r-- | StoneIsland/www/js/lib/account/LoginView.js | 20 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/account/PaymentView.js | 4 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/account/SettingsView.js | 15 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/account/ShippingView.js | 6 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/account/SignupView.js | 17 |
5 files changed, 51 insertions, 11 deletions
diff --git a/StoneIsland/www/js/lib/account/LoginView.js b/StoneIsland/www/js/lib/account/LoginView.js index 5058d335..9545b0d8 100644 --- a/StoneIsland/www/js/lib/account/LoginView.js +++ b/StoneIsland/www/js/lib/account/LoginView.js @@ -1,10 +1,10 @@ -var LoginView = View.extend({ +var LoginView = SerializableView.extend({ el: "#login", events: { "click .newuser": "newuser", - "submit form": "submit", + "submit form": "save", }, initialize: function(){ @@ -22,11 +22,17 @@ var LoginView = View.extend({ app.router.go("account/signup") }, - submit: function(e){ - e.preventDefault() - }, - - success: function(){ + save: function(e){ + e && e.preventDefault() + + var data = this.serialize() + + sdk.account.login({ data: data }).done(function(data){ + console.log("LOGIN SUCCESS", data) + }).fail(function(data){ + console.log("LOGIN FAIL", data) + }) + }, }) diff --git a/StoneIsland/www/js/lib/account/PaymentView.js b/StoneIsland/www/js/lib/account/PaymentView.js index 74727648..e43dfc1c 100644 --- a/StoneIsland/www/js/lib/account/PaymentView.js +++ b/StoneIsland/www/js/lib/account/PaymentView.js @@ -9,6 +9,10 @@ var PaymentView = View.extend({ this.address = new AddressView ({ parent: this }) }, + show: function(){ + document.body.className = "payment" + }, + }) var AddressView = View.extend({ diff --git a/StoneIsland/www/js/lib/account/SettingsView.js b/StoneIsland/www/js/lib/account/SettingsView.js new file mode 100644 index 00000000..b690ed81 --- /dev/null +++ b/StoneIsland/www/js/lib/account/SettingsView.js @@ -0,0 +1,15 @@ +var SettingsView = View.extend({ + + el: "#settings", + + events: { + }, + + initialize: function(){ + }, + + show: function(){ + document.body.className = "settings" + }, + +})
\ No newline at end of file diff --git a/StoneIsland/www/js/lib/account/ShippingView.js b/StoneIsland/www/js/lib/account/ShippingView.js index d3a5d8df..d22029c7 100644 --- a/StoneIsland/www/js/lib/account/ShippingView.js +++ b/StoneIsland/www/js/lib/account/ShippingView.js @@ -8,5 +8,9 @@ var ShippingView = View.extend({ initialize: function(){ this.address = new AddressView ({ parent: this }) }, - + + show: function(){ + document.body.className = "shipping" + }, + })
\ No newline at end of file diff --git a/StoneIsland/www/js/lib/account/SignupView.js b/StoneIsland/www/js/lib/account/SignupView.js index c6cd2930..14fb27a6 100644 --- a/StoneIsland/www/js/lib/account/SignupView.js +++ b/StoneIsland/www/js/lib/account/SignupView.js @@ -3,7 +3,7 @@ var SignupView = View.extend({ el: "#signup", events: { - "submit form": "submit", + "submit form": "save", }, initialize: function(){ @@ -17,12 +17,23 @@ var SignupView = View.extend({ document.body.className = "signup" }, - submit: function(e){ - e.preventDefault() + save: function(e){ + e && e.preventDefault() }, success: function(){ // change login in ui to logout or whatever }, +/* + var new_user_data = { + "Email": "testit.account" + Math.floor(Math.random() * 10000000) + "@yoox.com", + "Password": "TestPassword", + "Gender": "M", + "Name": "TestName", + "Surname": "TestSurname", + "DataProfiling": true, + } +*/ + })
\ No newline at end of file |
