summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/blogs/HubView.js6
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/etc/backup_db.js154
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/products/CollectionView.js20
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/products/filters/SizeFilter.js7
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/view/Scrollable.js17
-rwxr-xr-xStoneIsland/platforms/ios/www/js/vendor/loader.js11
7 files changed, 52 insertions, 165 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
index aa9d1d39..a6ec75f2 100755
--- a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
@@ -59,8 +59,8 @@ var BlogView = View.extend({
if (sdk.env === 'test') {
app.department_id = window.location.search.substr(1) || app.department_id
console.log('using test department id', app.department_id)
+ app.department_id = 'TSTSZS'
}
- // app.department_id = 'TSTD'
app.collection.loaded = false
app.collection.fetch()
}
diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js
index 013c2b45..38a7eecf 100755
--- a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js
@@ -140,6 +140,7 @@ var HubView = ScrollableView.extend({
var HubLoader = (function(){
var queue, view, item, loader
+ var count = 0
var HubLoader = {}
var loader
HubLoader.init = function(v){
@@ -151,6 +152,7 @@ var HubLoader = (function(){
}
HubLoader.load = function(){
item = queue.shift()
+ count++
if (! item) return
if (item.image && item.image.length) {
loader = new Loader (HubLoader.build)
@@ -159,7 +161,7 @@ var HubLoader = (function(){
}).filter(function(img){
return img.uri
})
- loader.preloadImages(images)
+ loader.preloadImages(images, true)
}
else {
HubLoader.build()
@@ -168,7 +170,7 @@ var HubLoader = (function(){
HubLoader.build = function(){
view.append(item)
view.scroller.refresh()
- setTimeout(HubLoader.load, 20)
+ setTimeout(HubLoader.load, count < 4 ? 50 : 5000)
}
return HubLoader
})()
diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/backup_db.js b/StoneIsland/platforms/ios/www/js/lib/etc/backup_db.js
index eec5c415..87d9f08c 100755
--- a/StoneIsland/platforms/ios/www/js/lib/etc/backup_db.js
+++ b/StoneIsland/platforms/ios/www/js/lib/etc/backup_db.js
@@ -310,11 +310,11 @@ var BACKUP_DB = {
],
"hub": [
{
- "id": "ss_-016-collection-preview",
+ "id": "loading",
"date": "Tue, 12 Jan 2016 12:00:00 GMT",
- "title": "SS_'016 COLLECTION PREVIEW",
- "subtitle": "Stone Island App exclusive 1/12-1/19",
- "body": "The unrelenting research by Stone Island results in a collection full of textiles evolutions, finishing and dyeing, featuring pop colors and extraordinary visual effects.\r\n\r\n44447 NYLON METAL WATRO\r\nHooded blouson in Nylon Metal. Hood with half lining in cotton and half in nylon mesh. Slanting hand pockets with windproof entrance and zip fastening. Adjustable strap at cuffs. Drawstring in bottom hem. Zip fastening. \r\nNYLON METAL WATRO: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. The fabric is resin treated inside to achieve a mild wind and water resistance The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n10544 NYLON METAL \r\nOver shirt in Nylon Metal. Garment dyed. Hook fastening collar. On seam pocket along central placket, with snaps fastening. Snap-fastened cuffs. Hidden zip and snap fastening.\r\nNYLON METAL: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n70532 POLYESTER SHANTUNG\r\nParka in an organic looking polyester. Hood with visor and chin strap adjustable with Velcro. Two bellows pockets on chest with flap closed by hidden snaps. Two welt pockets closed by a zip with a second snap opening that holds a cotton tape belt. Snap fasteners at cuffs. Zip and hidden button fastening.\r\nPOLYESTER SHANTUNG: organic looking polyester material with a shantung effect. The organic look is given by the highly technological spinning of the raw material and by its super tight weaving. The pieces are sewn and then garment dyed under pressure at 130°C with the addition of an anti-drop agent. The high pressure dye process compacts the material and induces the high absorption of the color recipe.\r\n\r\n41923 MEMBRANA 3L TC\r\nHooded jacket in a light 3 layers fabric. Garment dyed. Adjustable straps on hood with elasticated gathering on back. Patch pockets with zip fastening. Adjustable straps at cuffs. Elasticated adjustable drawstring on bottom edge. Zip fastening. \r\nMEMBRANA 3L TC: 3 layer light performance fabric made from an opaque nylon outer face laminated to a breathable, water resistant, windproof membrane, protected by an impalpable polyester base. Stone Island’s expertise in garment dyeing gives an outstanding color to the outer face while preserving the performance features of the inner membrane. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n65260 T.CO+OLD\r\nHooded full zip sweatshirt in malfilé cotton, garment dyed to create the OLD effect, an exclusive dyeing treatment and subsequent fading on the finished garment to create a slightly worn and three-dimensional appearance. Hood drawstring in contrasting color. Pouch pockets. Ribbed side band, cuffs and bottom band. Zip fastening.\r\n\r\n530B0\r\nCardigan knit in plain stitching cotton nylon. Raised collar with concealed hood in Nylon Metal. Garment dyed. On seam pockets. Plain cuffs and bottom band with inner ribbing. Zip fastening.\r\nNYLON METAL: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. ",
+ "title": "LOADING",
+ "subtitle": "Loading the hub",
+ "body": "The unrelenting research by Stone Island results in a collection full of textiles evolutions, finishing and dyeing, featuring pop colors and extraordinary visual effects.",
"link": "",
"store": "true",
"image": [
@@ -322,155 +322,9 @@ var BACKUP_DB = {
"uri": "https://ltho.s3.amazonaws.com/1ee6abef-0677-41a6-91eb-029303995073.png",
"caption": ""
},
- {
- "uri": "https://ltho.s3.amazonaws.com/8cc1876a-10c7-4dc5-af66-18f5d1a30727.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/f83bf094-ddee-4d26-938e-d98eef0cb0eb.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/095b2d00-cda6-4275-a475-cf2b27965c29.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/b7b299c4-0f24-4d27-91c3-b2a0856e49f0.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/cb2378dd-2eff-4d92-a942-63da8f3afcea.png",
- "caption": ""
- }
],
"__index": 1,
"dateCreated": "Tue, 12 Jan 2016 15:55:24 GMT"
- },
- {
- "id": "nikelab-x-stone-island-windrunner",
- "date": "Wed, 09 Dec 2015 12:00:00 GMT",
- "title": "NikeLab x Stone Island Windrunner",
- "subtitle": "",
- "body": "<b>NikeLab partners with Stone Island to deliver a unique interpretation of its foremost apparel icon, to celebrate the beginning of  “The Year of Windrunner.</b>\r\n\r\n “An exciting co-lab. Stone Island loves challenges. We source our strength from challenges. It’s a great satisfaction to share our knowhow and expertise with Nike”.\r\n<i>Carlo Rivetti – Stone Island President and Creative Director</i>\r\n \r\nThe Nike Windrunner was born during a time of firsts. Created by Nike’s first apparel designer in 1978 and revolutionary for its raglan sleeves and 26-degree chevron yoke, the jacket became the first piece of Nike apparel worn by athletes at track and field trials before and after competition. Today, to commemorate this running icon, the Nike Windrunner experiences another first, the fabric innovation, the engineering and garment dyeing techniques of Stone Island.\r\n \r\nIn 2016 Nike is celebrating its foremost apparel icon: the Nike Windrunner Jacket. Designed in the late ‘70s, the silhouette has been a fixture on medal stands and city streets ever since. In the launch edition of this yearlong celebration Nike and Stone Island merge the distinctiveness of two brands to create a unique garment.\r\n \r\nThe chevron and hood of the NikeLab x Stone Island Windrunner are constructed with water and wind-resistant Mussola Gommata fabric, formed by bonding lightweight cotton muslin to an opaque polyurethane film. Nylon Metal, a proprietary Stone Island fabric with a metallic sheen, is featured on the body of the garment, which is lined with PrimaLoft®.\r\n \r\nWhile the exterior of the jacket is monochromatic, it mimics the traditional Nike Windrunner color blocking through Stone Island’s garment dyeing process. The result is a subtle distinction between the shades of the Mussola Gommata and Nylon Metal fabrics. The silver PrimaLoft® lining provides a stunning contrast to the monochromatic exterior, while the oversized trims contribute to a rugged look.\r\n \r\nThe NikeLab x Stone Island Windrunner will be available on December 17th at 10am PST from the Stone Island App and selected NikeLab retailers and on nike.com/nikelab.",
- "link": "http://www.stoneisland.com/experience/us/nikelab-x-stone-island/",
- "store": "true",
- "image": [
- {
- "uri": "https://ltho.s3.amazonaws.com/de454e51-59d6-4442-9faa-70d95203f6dd.jpg",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/faeb5522-8793-4a81-882f-3c378cef3192.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/1c7b2292-f4c9-4d4e-869a-4d4cad2a3820.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/0444066e-e3e7-484f-b932-43c855e2fa96.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/d5577c40-4e42-4738-be8b-12066f7a4301.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/540f859f-9684-412d-a012-bb1c2bd45bf6.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/a92f9dd6-09d2-48fb-8858-7c12693c302e.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/a46824b3-90ad-466d-97ab-090022363fa7.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/e234f3cb-38d8-442a-9bb9-95a90b166d20.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/607814ee-1435-42f5-b52d-fb7fe2001b6d.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/21475b14-e216-438a-8673-106d9322bf3e.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/131e1276-aed1-4790-8ab9-333393c3885a.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/e2808d55-7d9a-4c99-842d-16a0a300c93d.png",
- "caption": ""
- }
- ],
- "__index": 4,
- "dateCreated": "Tue, 12 Jan 2016 16:02:48 GMT"
- },
- {
- "id": "nikelab-x-stone-island-koth-ultra-mid-si",
- "date": "Wed, 09 Dec 2015 12:00:00 GMT",
- "title": "NikeLab x Stone Island Koth Ultra Mid SI",
- "subtitle": "",
- "body": "Inspired by the Nike Air Mowabb, the revolutionary 1991 sneaker-hiker hybrid, this all-weather Nike Koth Ultra Mid SI Shoe is made in Nike water resistant materials, real leather, and in Mussola Gommata, a fabric issued from the Stone Island research and treatment research, an exclusive panel dyed material made by bonding an extremely light cotton muslin to an opaque polyurethane film. The shoe features aggressive traction and flexible ankle support. Unitsole foam midsole for cushioning and durable support. Waffle rubber lugs for rugged traction and durability. Flex grooves allow for natural range of motion. Heel loop for easier on and off. Heel overlay for enhanced support. The shoe dust bag is made in 2 Stone Island fabrics, Nylon Metal, nylon canvas with a distinctive metallic and iridescent sheen, 50 Fili, a cotton/nylon canvas, both panel dyed.\r\n\r\nThe NikeLab x Stone Island Koth Ultra Mid SI will be available on December 17th at 10am PST from the Stone Island App and selected NikeLab retailers and on nike.com/nikelab.\r\n",
- "link": "http://www.stoneisland.com/experience/us/nikelab-x-stone-island/",
- "store": "true",
- "image": [
- {
- "uri": "https://ltho.s3.amazonaws.com/dd5f611f-3800-49ed-a6b1-9f6dd06cc103.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/34185ef2-1658-4472-bc3a-4d3f0c23ba2f.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/4767f114-1e8e-4ed3-856c-74f6c4342f0f.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/ed510070-9f60-45a6-aebf-2e7684b67cb3.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/c32af490-4ae5-4040-9327-02ce8808ee71.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/b913fc7d-d5d8-4047-b252-c2f404d9cb3e.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/3bea1cd4-2529-4a06-99ec-ec55c5a9f8d5.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/e29264fd-4236-4d16-938f-7dbe264c9b88.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/9c445717-dc18-4e0f-95f4-f695b13547a2.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/63cb328c-2624-4ed1-9d1e-113649be7f26.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/8ef50cce-c89d-4642-98b9-3be6ff798727.png",
- "caption": ""
- },
- {
- "uri": "https://ltho.s3.amazonaws.com/46f320b1-b908-42b5-9cad-20689c4d0d23.png",
- "caption": ""
- }
- ],
- "__index": 5,
- "dateCreated": "Tue, 12 Jan 2016 16:03:00 GMT"
}
],
"page": [
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
index 803acc76..9387a7b8 100755
--- a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
@@ -5,6 +5,7 @@ var CollectionView = ScrollableView.extend({
template: $("#collection .template").html(),
loaded: false,
data: null,
+ filtered_items: null,
items: {},
events: {
@@ -35,10 +36,11 @@ var CollectionView = ScrollableView.extend({
if (sdk.env !== "test" && app.closed.storeIsClosed) {
return app.closed.show()
}
+
if (this.data && this.data.SearchResponseFull.Results.Items.length < 4) {
app.footer.hide()
}
- else if (app.store.FilterBy !== "none") {
+ if (app.store.FilterBy !== "none") {
if (app.store.FilterBy === "category") {
app.footer.show("FILTER")
}
@@ -106,7 +108,7 @@ var CollectionView = ScrollableView.extend({
this.$content.empty()
// DefaultCode10
// data.SearchResponseFull.Results.Items.length = 1
- var is_single_product = (data.SearchResponseFull.Results.Items.length < 4)
+ var is_single_product = (data.SearchResponseFull.Results.Items.length < 3)
this.$el.toggleClass("single", is_single_product)
if (is_single_product) {
@@ -126,16 +128,20 @@ var CollectionView = ScrollableView.extend({
// }
console.log( data.SearchResponseFull.Results.Items.length )
+
+ var items = this.filtered_items || data.SearchResponseFull.Results.Items
if (app.store.GroupBy === 'size') {
- this.groupBySize( data.SearchResponseFull.Results.Items, is_single_product )
+ this.groupBySize( items, is_single_product )
}
else {
- this.appendItems( data.SearchResponseFull.Results.Items, is_single_product )
+ this.appendItems( items, is_single_product )
}
- this.deferScrollToTop()
+ // this.restoreScroll()
+ // this.deferScrollToTop()
}
this.afterFetchCallback && this.afterFetchCallback()
- app.collection.deferRefresh()
+ this.deferRefresh()
+ this.restoreScroll()
},
groupBySize: function(items, is_single_product){
@@ -180,6 +186,7 @@ var CollectionView = ScrollableView.extend({
var $t = $(t)
if (app.store.ShowProductNameOnCollectionPage) {
var $title = $("<span>")
+ $title.addClass("product-title")
$title.html( item['ModelNames'] )
$t.append($title)
}
@@ -189,6 +196,7 @@ var CollectionView = ScrollableView.extend({
pick: function(e){
var code = $(e.currentTarget).data("code")
var data = this.items[code]
+ this.saveScroll()
app.product.load(code, data)
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/filters/SizeFilter.js b/StoneIsland/platforms/ios/www/js/lib/products/filters/SizeFilter.js
index a009dd15..d0231021 100644
--- a/StoneIsland/platforms/ios/www/js/lib/products/filters/SizeFilter.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/filters/SizeFilter.js
@@ -41,15 +41,18 @@ var SizeFilter = View.extend({
this.parent.$content.empty()
if (choice.id == "__remove_filter") {
this.last_choice = null
+ this.parent.filtered_items = null
this.parent.data.SearchResponseFull.Results.Items.forEach(this.parent.append.bind(this.parent))
}
else {
this.last_choice = choice
console.log("filtering for size", choice.id)
- this.parent.data.SearchResponseFull.Results.Items.filter(function(item){
+ var items = this.parent.data.SearchResponseFull.Results.Items.filter(function(item){
console.log(item.Sizes.map(function(s){ return s }))
return item.Sizes.some(function(size){ return size.Id == choice.id })
- }).forEach(this.parent.append.bind(this.parent))
+ })
+ this.parent.filtered_items = items
+ items.forEach(this.parent.append.bind(this.parent))
}
this.parent.deferScrollToTop()
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js b/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
index 0baff845..7f90929a 100755
--- a/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
+++ b/StoneIsland/platforms/ios/www/js/lib/view/Scrollable.js
@@ -5,9 +5,26 @@ var ScrollableView = View.extend({
},
deferScrollToTop: function(){
+ this.scrollPosition = 0
setTimeout(this.scrollToTop.bind(this), 0)
},
+ scrollPosition: 0,
+
+ resetScroll: function(){
+ this.scrollPosition = 0
+ },
+
+ saveScroll: function(){
+ this.scrollPosition = this.scroller.y
+ },
+
+ restoreScroll: function(){
+ setTimeout(function(){
+ this.scroller.scrollTo(0, this.scrollPosition)
+ }.bind(this), 0)
+ },
+
refreshScroller: function(){
this.scroller.refresh()
clearTimeout( this.scrollerRefreshTimeout )
diff --git a/StoneIsland/platforms/ios/www/js/vendor/loader.js b/StoneIsland/platforms/ios/www/js/vendor/loader.js
index cc9644f8..ccfcdc9e 100755
--- a/StoneIsland/platforms/ios/www/js/vendor/loader.js
+++ b/StoneIsland/platforms/ios/www/js/vendor/loader.js
@@ -62,25 +62,28 @@ var Loader = Loader || (function(){
}
// Preload the images in config.images
- Loader.prototype.preloadImages = function(images){
+ Loader.prototype.preloadImages = function(images, register){
this.register("preload");
for (var i = 0; i < images.length; i++) {
- this.preloadImage(images[i]);
+ this.preloadImage(images[i], register);
}
this.ready("preload");
}
Loader.prototype.preloadImage = function(src, register, cb){
if (! src || src == "none") return;
var _this = this;
- if (! cb && typeof register !== "string") {
+ if (! cb && typeof register !== "boolean") {
cb = register
register = null
}
if (register) {
this.register(src);
}
- var img = new Image();
+ var img = new Image()
+ var loaded = false
img.onload = function(){
+ if (loaded) return
+ loaded = true
if (cb) {
cb(img);
}