diff options
Diffstat (limited to 'StoneIsland')
| -rw-r--r-- | StoneIsland/www/css/account.css | 10 | ||||
| -rw-r--r-- | StoneIsland/www/css/nav.css | 2 | ||||
| -rw-r--r-- | StoneIsland/www/index.html | 24 | ||||
| -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 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/FooterView.js | 2 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/products/CollectionView.js | 25 | ||||
| -rw-r--r-- | StoneIsland/www/js/sdk/_sdk.js | 6 | ||||
| -rw-r--r-- | StoneIsland/www/js/vendor/util.js | 1 |
12 files changed, 101 insertions, 31 deletions
diff --git a/StoneIsland/www/css/account.css b/StoneIsland/www/css/account.css index e023480b..b16c60e0 100644 --- a/StoneIsland/www/css/account.css +++ b/StoneIsland/www/css/account.css @@ -21,11 +21,21 @@ #profile { display: none; } + + .payment #payment { display: block } #payment { display: none; } + + .shipping #shipping { display: block } #shipping { display: none; } + + +.settings #settings { display: block } +#settings { + display: none; +}
\ No newline at end of file diff --git a/StoneIsland/www/css/nav.css b/StoneIsland/www/css/nav.css index 809e8943..98c5402e 100644 --- a/StoneIsland/www/css/nav.css +++ b/StoneIsland/www/css/nav.css @@ -220,7 +220,7 @@ #collection, #product, #search, #login, #logout, #cart, -#signup, #shipping, #payment, #profile { +#signup, #shipping, #payment, #profile, #settings { position: absolute; top: 43px; height: -webkit-calc(100% - 43px); diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html index faf6e351..13710677 100644 --- a/StoneIsland/www/index.html +++ b/StoneIsland/www/index.html @@ -32,10 +32,18 @@ <div id="nav"> <span class="menu"> <div class="logo"></div> - <span class="store">STORE</span> - <span class="hub">HUB</span> - <span class="story">STORY</span> - <span class="archive">ARCHIVE</span> + <div class="main_menu"> + <span class="store">STORE</span> + <span class="hub">HUB</span> + <span class="story">STORY</span> + <span class="archive">ARCHIVE</span> + </div> + <div class="account_menu"> + <span class="profile">PROFILE</span> + <span class="payment">PAYMENT</span> + <span class="shipping">SHIPPING</span> + <span class="settings">NOTIFICATIONS</span> + </div> </span> <span class="submenu"> @@ -152,6 +160,13 @@ </div> </div> + <div id="settings"> + <div class="scroll"> + <h1>NOTIFICATIONS</h1> + <div class="content">TURN ON / OFF NOTIFICATIONS</div> + </div> + </div> + <div id="search"> <div class="scroll"> <h1>SEARCH</h1> @@ -412,6 +427,7 @@ <script src="js/lib/account/ProfileView.js"></script> <script src="js/lib/account/PaymentView.js"></script> <script src="js/lib/account/ShippingView.js"></script> +<script src="js/lib/account/SettingsView.js"></script> <script src="js/lib/products/CollectionView.js"></script> <script src="js/lib/products/ProductView.js"></script> 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 diff --git a/StoneIsland/www/js/lib/nav/FooterView.js b/StoneIsland/www/js/lib/nav/FooterView.js index d5560545..414dc4c1 100644 --- a/StoneIsland/www/js/lib/nav/FooterView.js +++ b/StoneIsland/www/js/lib/nav/FooterView.js @@ -26,7 +26,7 @@ var FooterView = View.extend({ }, ok: function(){ - app.view.submit() + (app.view.save || app.view.submit || noop)() }, })
\ No newline at end of file diff --git a/StoneIsland/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js index 1377277a..490b10fe 100644 --- a/StoneIsland/www/js/lib/products/CollectionView.js +++ b/StoneIsland/www/js/lib/products/CollectionView.js @@ -46,19 +46,20 @@ var CollectionView = ScrollableView.extend({ else { this.data = data } - this.loaded = true - this.$loader.hide() - this.$content.empty() - // DefaultCode10 - data.SearchResponseFull.Results.Items.forEach(function(item){ - this.items[ item['Code8'] ] = item - var t = this.template.replace(/{{image}}/, sdk.image(item['DefaultCode10'], '11_f')) - .replace(/{{code8}}/, item['Code8']) - this.$content.append(t) - }.bind(this)) - - this.deferScrollToTop() + if (! this.loaded) { + this.loaded = true + this.$loader.hide() + this.$content.empty() + // DefaultCode10 + data.SearchResponseFull.Results.Items.forEach(function(item){ + this.items[ item['Code8'] ] = item + var t = this.template.replace(/{{image}}/, sdk.image(item['DefaultCode10'], '11_f')) + .replace(/{{code8}}/, item['Code8']) + this.$content.append(t) + }.bind(this)) + this.deferScrollToTop() + } this.afterFetchCallback && this.afterFetchCallback() }, diff --git a/StoneIsland/www/js/sdk/_sdk.js b/StoneIsland/www/js/sdk/_sdk.js index 2054d0dc..d50a99e0 100644 --- a/StoneIsland/www/js/sdk/_sdk.js +++ b/StoneIsland/www/js/sdk/_sdk.js @@ -1,11 +1,13 @@ var sdk = (function(){ var sdk = {} - + + sdk.env = "development" + var endpoint = "https://secure.api.yoox.biz/" // var endpoint = "http://api.yoox.biz/" sdk.init = function(opt){ - switch (opt.env || "development") { + switch (sdk.env = opt.env || "development") { case 'test': endpoint = "http://lvh.me:9090/" break diff --git a/StoneIsland/www/js/vendor/util.js b/StoneIsland/www/js/vendor/util.js index 8a58a84c..0e48ce5a 100644 --- a/StoneIsland/www/js/vendor/util.js +++ b/StoneIsland/www/js/vendor/util.js @@ -41,6 +41,7 @@ function rand(n){ return (Math.random()*n) } function randint(n){ return rand(n)|0 } function randrange(a,b){ return a + rand(b-a) } function choice(a){ return a[randint(a.length)] } +function noop(){} function range(m,n,s){ var a = [] |
