diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-04-07 04:15:56 +0200 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-04-07 04:15:56 +0200 |
| commit | 0a2932840bd13cde5fb2693b1c612ca0bf817149 (patch) | |
| tree | 4d470e4094ba314386e8fc9b4500d3135ff5df6a | |
| parent | d0e609bf53d071f0ae66682fb1a2c21201b437a4 (diff) | |
improve loading, preserve scroll position on collection view
39 files changed, 378 insertions, 585 deletions
diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist b/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist index 47ba0769..6145ebd6 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist @@ -9,16 +9,16 @@ <key>CFBundleIdentifier</key> <string>us.okfoc.stoneisland</string> <key>CFBundleShortVersionString</key> - <string>0.8.5</string> + <string>0.8.7</string> <key>CFBundleVersion</key> - <string>0.8.5</string> + <string>0.8.7</string> <key>SigningIdentity</key> <string>iPhone Developer: Francesca Agusani (3ECUPBTQ5W)</string> </dict> <key>ArchiveVersion</key> <integer>2</integer> <key>CreationDate</key> - <date>2017-03-13T02:17:54Z</date> + <date>2017-04-07T02:13:09Z</date> <key>Name</key> <string>Stone Island</string> <key>SchemeName</key> diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib Binary files differindex c588faa1..da7def80 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib Binary files differindex 7d440c97..b7f7b7b4 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Info.plist b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Info.plist Binary files differindex 9ac7273e..947d6f8c 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Info.plist +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Info.plist diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib Binary files differindex 0abc7672..885a176a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island Binary files differindex 083f6877..37f884d2 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources index 4ada86e0..0f592e4a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources @@ -86,7 +86,7 @@ </data> <key>CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key> <data> - /Wh746Q76RuE7ilR6jSINbcHMIE= + Xkdrl2mc6A5tNpsn0pyt1gYKfN4= </data> <key>CDVLaunchScreen.storyboardc/Info.plist</key> <data> @@ -94,7 +94,7 @@ </data> <key>CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib</key> <data> - j5MzLBRmbDhezR6tdN+aYV2lWgo= + 79Yzgc2Yxl6JuKy6S/B4s+OHons= </data> <key>CDVNotification.bundle/beep.wav</key> <data> @@ -102,7 +102,7 @@ </data> <key>Info.plist</key> <data> - oj6CSaHc/p4W/xQZnIM2O3W3jvw= + IqzQ35/6HHyAvnrRX9sW1B0itck= </data> <key>LaunchImage-568h@2x.png</key> <data> @@ -162,7 +162,7 @@ </data> <key>MainViewController.nib</key> <data> - nlax0Qzrc3x2Dm8HOKWtPc4R1kw= + reXHWk0S3phLUHwm4RENN1b887U= </data> <key>PkgInfo</key> <data> @@ -174,7 +174,7 @@ </data> <key>config.xml</key> <data> - ulvVkeAbu0YWQ/suSz5vM3D1Duk= + Dkr/giwZIr7LoEDfFhorU5hV6HM= </data> <key>embedded.mobileprovision</key> <data> @@ -270,12 +270,16 @@ </data> <key>www/css/products.css</key> <data> - oj532+SFMYZGrM6WS5YrKptFn0g= + bY2IfaCUQ+Rz5riamQVF0rOVe6A= </data> <key>www/css/vendor/flickity.css</key> <data> xW5wsn/T/+uaGvIT+Sl9WY/IM2k= </data> + <key>www/db.json</key> + <data> + FHbZPD9DyP+Prfwo3urgg0f3pwo= + </data> <key>www/img/Resources/CDVNotification.bundle/beep.wav</key> <data> /kSUVvLLJcbtfXnxFEolil3/NRk= @@ -382,11 +386,11 @@ </data> <key>www/index.html</key> <data> - Cqs564HHydS1cajG/YyUxH/m/qQ= + 6SGw3uBpkNcmRS2OAELfjhdEOoY= </data> <key>www/js/index.js</key> <data> - kdCkzBXcB8Vtaenbb9zl8ZizLjA= + mCIF9453gfj03wXHO4fPQ4oGz2w= </data> <key>www/js/lib/_router.js</key> <data> @@ -434,11 +438,11 @@ </data> <key>www/js/lib/blogs/BlogView.js</key> <data> - HBB00nKvi8KuQyINKlQuaN0YVM8= + qzZdPFzaPdQIVKXbo/9vdblKhu0= </data> <key>www/js/lib/blogs/HubView.js</key> <data> - 6DGehG89PP9aUQaW7PHtwuDnErE= + 4oI73qy2Z5DyyiA8Kz+k1+9vLnQ= </data> <key>www/js/lib/blogs/PageView.js</key> <data> @@ -478,7 +482,7 @@ </data> <key>www/js/lib/etc/backup_db.js</key> <data> - BwItWjWxRLRdqFFVUnLyB+Cz/94= + jYYyLGagd9QTbKX8mbcDQYkuYFY= </data> <key>www/js/lib/etc/deeplink.js</key> <data> @@ -490,7 +494,7 @@ </data> <key>www/js/lib/etc/push.js</key> <data> - 091MnfJSOTgYMyjWrS5iqiSk5j0= + Lgqf6GimhKCJLIo3F/VPyjfwKT4= </data> <key>www/js/lib/nav/AddressView.js</key> <data> @@ -530,7 +534,7 @@ </data> <key>www/js/lib/products/CollectionView.js</key> <data> - zD/7bB20CHAGKU2CybT2DiHLVDI= + Mhl/1g4Fn4D32DWk0eWaqHrnfP0= </data> <key>www/js/lib/products/GalleryView.js</key> <data> @@ -538,7 +542,7 @@ </data> <key>www/js/lib/products/ProductView.js</key> <data> - CPl4BKl46Rv3x+CP5Wj50aBFTtk= + D0qw484px++H8SgEz/RzF5RTb4Q= </data> <key>www/js/lib/products/Selector.js</key> <data> @@ -550,7 +554,11 @@ </data> <key>www/js/lib/products/filters/DepartmentFilter.js</key> <data> - LueAI+hrodiC7/iu987ag8xkACw= + 8NWvfVz9fG9fo5KCmaEw/J3WOjQ= + </data> + <key>www/js/lib/products/filters/SizeFilter.js</key> + <data> + o/z0F+RylPMY7gYqKn5AUSGjkGE= </data> <key>www/js/lib/view/Router.js</key> <data> @@ -558,7 +566,7 @@ </data> <key>www/js/lib/view/Scrollable.js</key> <data> - eUKMRV6KXM82cDq9rFnmFWP4QAQ= + w8k3ObVeDwNmo5N4RSbu094FfTk= </data> <key>www/js/lib/view/Serializable.js</key> <data> @@ -570,7 +578,7 @@ </data> <key>www/js/sdk/_sdk.js</key> <data> - lQSwQ13C2sQbmhoFgz8BMYN/dIk= + 4hz0+mnCDTNFXjFcq8n3IRBm/ck= </data> <key>www/js/sdk/account.js</key> <data> @@ -622,7 +630,7 @@ </data> <key>www/js/vendor/loader.js</key> <data> - rX3eSoXrP9KCszh6/7wYgtEAKIE= + MNfNXlpvgsuGkqhXhawkjJxwGGU= </data> <key>www/js/vendor/lodash.min.js</key> <data> @@ -939,11 +947,11 @@ <dict> <key>hash</key> <data> - /Wh746Q76RuE7ilR6jSINbcHMIE= + Xkdrl2mc6A5tNpsn0pyt1gYKfN4= </data> <key>hash2</key> <data> - u7u7TmRT5rDnuIv89ZINuCbRzUVxqGwkZMJ8B/jMPos= + 1Jw1nFWS4v8k6jgsKb/hYZW4Az8wKG0y7oTJRKzOEHg= </data> </dict> <key>CDVLaunchScreen.storyboardc/Info.plist</key> @@ -961,11 +969,11 @@ <dict> <key>hash</key> <data> - j5MzLBRmbDhezR6tdN+aYV2lWgo= + 79Yzgc2Yxl6JuKy6S/B4s+OHons= </data> <key>hash2</key> <data> - y10BglaaXBuvaMq1GOE1FbQ+CfDCReG6gyXr2gM4kQU= + SOszOuGA/WMFvFo9pbBZBCw28hXre04Viqa50p/pW5U= </data> </dict> <key>CDVNotification.bundle/beep.wav</key> @@ -1137,11 +1145,11 @@ <dict> <key>hash</key> <data> - nlax0Qzrc3x2Dm8HOKWtPc4R1kw= + reXHWk0S3phLUHwm4RENN1b887U= </data> <key>hash2</key> <data> - oWdDN9aw/EPCgQm4QgJHj6dOWH5YBXuWJFKydNI4Gis= + Cg4q+3gJrlYIf7N+d/nM7fK1rnXpOcPuDW2CSj+WNmE= </data> </dict> <key>archived-expanded-entitlements.xcent</key> @@ -1159,11 +1167,11 @@ <dict> <key>hash</key> <data> - ulvVkeAbu0YWQ/suSz5vM3D1Duk= + Dkr/giwZIr7LoEDfFhorU5hV6HM= </data> <key>hash2</key> <data> - Hw/gY61GNBFaOycn07PXvQ2Nz1vSUKSJeUICLihgN3M= + ClLJnci3T0SOEWO2Dhz9wOdwKn3WT1NrEZyzyNfITZA= </data> </dict> <key>embedded.mobileprovision</key> @@ -1423,11 +1431,11 @@ <dict> <key>hash</key> <data> - oj532+SFMYZGrM6WS5YrKptFn0g= + bY2IfaCUQ+Rz5riamQVF0rOVe6A= </data> <key>hash2</key> <data> - WXJhtEkDkjXj9MWtBw/TP8QUOGexOVRu/VYBiZb1SAM= + hPZUQWrlZ/hGqd0scKaIjhli7AmNraugdxjdk5UoORg= </data> </dict> <key>www/css/vendor/flickity.css</key> @@ -1441,6 +1449,17 @@ T95IzwnM3icXTFFGjaoJ60KBvjBZRIGdOLBHp6g1odc= </data> </dict> + <key>www/db.json</key> + <dict> + <key>hash</key> + <data> + FHbZPD9DyP+Prfwo3urgg0f3pwo= + </data> + <key>hash2</key> + <data> + QSN93k1zzgvbBpJ+82WBuRuad5jnucly7dhUFIsaWhw= + </data> + </dict> <key>www/img/Resources/CDVNotification.bundle/beep.wav</key> <dict> <key>hash</key> @@ -1731,22 +1750,22 @@ <dict> <key>hash</key> <data> - Cqs564HHydS1cajG/YyUxH/m/qQ= + 6SGw3uBpkNcmRS2OAELfjhdEOoY= </data> <key>hash2</key> <data> - ObsyOOX1Wpph0NY4+PW+WpCRRymwVZbyp6Pi8TuFRpY= + JuvKZKz1vAMngVhUVhrI/7xKZAvADkuTZMRvkT93dBo= </data> </dict> <key>www/js/index.js</key> <dict> <key>hash</key> <data> - kdCkzBXcB8Vtaenbb9zl8ZizLjA= + mCIF9453gfj03wXHO4fPQ4oGz2w= </data> <key>hash2</key> <data> - 1dplL43zSsUSGUV6OKR7UrgULfjG7j9JnWrE/aHFC6o= + Tt1X66Dcly53xIKSCYvZKeuvFV+nb+svD1f4ugse9H8= </data> </dict> <key>www/js/lib/_router.js</key> @@ -1874,22 +1893,22 @@ <dict> <key>hash</key> <data> - HBB00nKvi8KuQyINKlQuaN0YVM8= + qzZdPFzaPdQIVKXbo/9vdblKhu0= </data> <key>hash2</key> <data> - n/A++mo0/6iDULki3n3RavdMzWuSZ5AvdCdUKPgTeis= + LVqlKMd6ha14mJ3WbFBukHeCe8hhMgheq+tJI4uG14Q= </data> </dict> <key>www/js/lib/blogs/HubView.js</key> <dict> <key>hash</key> <data> - 6DGehG89PP9aUQaW7PHtwuDnErE= + 4oI73qy2Z5DyyiA8Kz+k1+9vLnQ= </data> <key>hash2</key> <data> - rcxtXZd5Z78fUwcnKauYA7t++KokjPQAbZdZXD0+fk0= + J7ZclyOypLHuMdugOZQJ1O372GtIB66AoF1qFr05X+c= </data> </dict> <key>www/js/lib/blogs/PageView.js</key> @@ -1995,11 +2014,11 @@ <dict> <key>hash</key> <data> - BwItWjWxRLRdqFFVUnLyB+Cz/94= + jYYyLGagd9QTbKX8mbcDQYkuYFY= </data> <key>hash2</key> <data> - u+pCXG0dSwwduDnQ1Y6+Q4SUrYXEK7os4mdREe0khzg= + jV4M3n/bUGxqsECAm4dQXPp+nUN74TjlyxKB38hGeZQ= </data> </dict> <key>www/js/lib/etc/deeplink.js</key> @@ -2028,11 +2047,11 @@ <dict> <key>hash</key> <data> - 091MnfJSOTgYMyjWrS5iqiSk5j0= + Lgqf6GimhKCJLIo3F/VPyjfwKT4= </data> <key>hash2</key> <data> - dosnNVZrzPEs+FH07LHo0EEyxLZwxh/+Y3+wXxwN7EM= + AYBjbLztNci/muE6DD4aTDnMXhYk8UMVCHJ4b6d5urg= </data> </dict> <key>www/js/lib/nav/AddressView.js</key> @@ -2138,11 +2157,11 @@ <dict> <key>hash</key> <data> - zD/7bB20CHAGKU2CybT2DiHLVDI= + Mhl/1g4Fn4D32DWk0eWaqHrnfP0= </data> <key>hash2</key> <data> - xU5gur+RgyErpz0NoMSYrlnYtSKDnB2jT9T5qIozlZ0= + u7MHHPiTtVwgdfQGy3QIDV3+qoTLfeawI6QToYTYP48= </data> </dict> <key>www/js/lib/products/GalleryView.js</key> @@ -2160,11 +2179,11 @@ <dict> <key>hash</key> <data> - CPl4BKl46Rv3x+CP5Wj50aBFTtk= + D0qw484px++H8SgEz/RzF5RTb4Q= </data> <key>hash2</key> <data> - 446nfB6rHykfE8xgnvWRGDg/+1kpBqpMefY5HazVnsA= + 4zohpwepXZsBtqhROr5spKlTXW/2MY6hIPGpMGieFqk= </data> </dict> <key>www/js/lib/products/Selector.js</key> @@ -2193,11 +2212,22 @@ <dict> <key>hash</key> <data> - LueAI+hrodiC7/iu987ag8xkACw= + 8NWvfVz9fG9fo5KCmaEw/J3WOjQ= + </data> + <key>hash2</key> + <data> + 6gaF1qrD9qw36meq0L5sR0tc8WHABwpqex19+ggSMu8= + </data> + </dict> + <key>www/js/lib/products/filters/SizeFilter.js</key> + <dict> + <key>hash</key> + <data> + o/z0F+RylPMY7gYqKn5AUSGjkGE= </data> <key>hash2</key> <data> - pp0SDUmq2llYdhp2Fq5JCdXEQDAHQ25r0PjiRgV4PLs= + 9bxD78h/TRL6HppSlXF3bc2mUsHW/YOCeWZAHPgtD90= </data> </dict> <key>www/js/lib/view/Router.js</key> @@ -2215,11 +2245,11 @@ <dict> <key>hash</key> <data> - eUKMRV6KXM82cDq9rFnmFWP4QAQ= + w8k3ObVeDwNmo5N4RSbu094FfTk= </data> <key>hash2</key> <data> - T2sjPDXHGqpklVYW4nnCST+Tn0iCkrFQok7f+NsAFYQ= + 8fhfyk4Wi6tf1yJbkt57+eNjgJpsGqWKvHM2hKIu4aM= </data> </dict> <key>www/js/lib/view/Serializable.js</key> @@ -2248,11 +2278,11 @@ <dict> <key>hash</key> <data> - lQSwQ13C2sQbmhoFgz8BMYN/dIk= + 4hz0+mnCDTNFXjFcq8n3IRBm/ck= </data> <key>hash2</key> <data> - VWOtB3kM2Yzfu02wmbIUahBqI3AZB0W84D/I4sV+7Do= + nlwVzdPthiCwaIaxt8fE3E6WnslKiGmld5UUKa2XD+c= </data> </dict> <key>www/js/sdk/account.js</key> @@ -2391,11 +2421,11 @@ <dict> <key>hash</key> <data> - rX3eSoXrP9KCszh6/7wYgtEAKIE= + MNfNXlpvgsuGkqhXhawkjJxwGGU= </data> <key>hash2</key> <data> - rGlRT+o5G/bTYjy5PSWSl4vl5znuwvBe/eqHeglBaG0= + +OqOjwnNrePNGE3Ysj4ZPjCFUTgVSlnMDU0NxGVQwWs= </data> </dict> <key>www/js/vendor/lodash.min.js</key> diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/config.xml b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/config.xml index 95e7c2ef..b2b64796 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/config.xml +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-versionCode="6000" id="us.okfoc.stoneisland" version="0.8.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-versionCode="6087" id="us.okfoc.stoneisland" version="0.8.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <feature name="LocalStorage"> <param name="ios-package" value="CDVLocalStorage" /> </feature> diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/products.css b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/products.css index 664ff45b..c4599866 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/products.css +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/products.css @@ -24,6 +24,11 @@ height: 126vw; } +#collection .item .product-title { + padding-bottom: 18px; + display: inline-block; +} + .product #product { display: block } #product { display: none; @@ -104,6 +109,20 @@ position:relative; font-weight:bold; } +.product .product-header.wide { + max-width:100%; +} + +.product-group { + margin-top: 28px; + margin-bottom: 18px; + font-weight: bold; + text-align: center; + font-size: 17px; +} +.product-group:first-child { + margin-top: 0; +} #product::before { content:''; diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/index.html b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/index.html index 28c4f8c6..c9e6e575 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/index.html +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/index.html @@ -262,7 +262,6 @@ <div class="gallery-right"></div> <div class="content"> <div class="product-header"> - <span class="num"></span> <span class="title"></span> </div> <div class="type-price"> @@ -1138,6 +1137,7 @@ <script src="js/lib/products/CollectionView.js"></script> <script src="js/lib/products/filters/CategoryFilter.js"></script> <script src="js/lib/products/filters/DepartmentFilter.js"></script> +<script src="js/lib/products/filters/SizeFilter.js"></script> <script src="js/lib/products/ClosedStoreView.js"></script> <script src="js/lib/products/ProductView.js"></script> <script src="js/lib/products/GalleryView.js"></script> diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/index.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/index.js index 06bfaaac..43b55b04 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/index.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/index.js @@ -4,7 +4,13 @@ var app = (function(){ app.init = function(){ console.log("init") - sdk.init({ env: "production" }) + if (window.location.hostname === 'lvh.me' || window.location.hostname === 'stone.giraffe.life') { + console.log('launching in test mode') + sdk.init({ env: "test" }) + } + else { + sdk.init({ env: "production" }) + } app.bind() app.build() diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/BlogView.js index 1bd56908..a6ec75f2 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/BlogView.js @@ -9,8 +9,8 @@ var BlogView = View.extend({ fetch: function(fn){ $.ajax({ method: "GET", -// url: sdk.env == 'test' ? '/db.json' : "https://stone.sup.land/db.json", - url: "https://stone.sup.land/db.json", + url: sdk.env === 'test' ? '/db.json' : "https://stone.sup.land/db.json", + // url: "https://stone.sup.land/db.json", success: function(data){ this.success(data) fn && fn() @@ -31,27 +31,36 @@ var BlogView = View.extend({ this.loaded = true this.data = data = typeof data == "string" ? JSON.parse(data) : data - switch (data.store[0].DepartmentStoreStatus) { + app.store = data.store[0] + + switch (app.store.DepartmentStoreStatus) { case "open": app.closed.storeIsClosed = false break case "closed": app.closed.storeIsClosed = true - app.closed.storeClosedMessageOne = data.store[0].StoreClosedMessageOne - app.closed.storeClosedMessageTwo = data.store[0].StoreClosedMessageTwo + app.closed.storeClosedMessageOne = app.store.StoreClosedMessageOne + app.closed.storeClosedMessageTwo = app.store.StoreClosedMessageTwo break } - - if (app.closed.storeIsClosed) { - app.closed.populate(data.store[0].ClosedStoreImages) + + // sdk.env = 'test' + + if (app.closed.storeIsClosed && sdk.env !== 'test') { + app.closed.populate(app.store.ClosedStoreImages) } else { - app.departments = data.store[0].Departments - app.department_id = data.store[0].Departments[0].uri - $("#collections h1").toggleClass("single-dept", data.store[0].Departments.length == 1) - app.collection.setCollectionName( data.store[0].Departments[0].text ) + app.departments = app.store.Departments + app.department_id = app.store.Departments[0].uri + $("#collections h1").toggleClass("single-dept", app.store.Departments.length == 1) + app.collection.setCollectionName( app.store.Departments[0].text ) //// demo department for shoes with weird SizeTypeId // app.department_id = "NKDrtSC" + 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.collection.loaded = false app.collection.fetch() } @@ -72,16 +81,16 @@ var BlogView = View.extend({ app[page.tag].populate(page) }) - console.log(data.store[0].StoreStatus) + console.log(app.store.StoreStatus) app.product.fitLargeCodes = {} - if (data.store[0].FittingCodes.length) { - data.store[0].FittingCodes.split("\n").forEach(function(code){ + if (app.store.FittingCodes.length) { + app.store.FittingCodes.split("\n").forEach(function(code){ app.product.fitLargeCodes[code] = true }) } - if (data.store[0].BackgroundIsGray === "true") { + if (app.store.BackgroundIsGray === "true") { app.collection.$el.addClass("gray") app.product.gallery.$el.addClass("gray") } diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/HubView.js index 013c2b45..38a7eecf 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/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/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/backup_db.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/backup_db.js index eec5c415..87d9f08c 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/backup_db.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/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/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js index da63fdd1..043a4d75 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js @@ -2,7 +2,7 @@ var push = (function(){ var push = { settings: {}, disabled: false } var pushPlugin push.init = function(){ - if (device.platform !== "ios") { + if (! ('device' in window) || device.platform !== "ios") { push.disabled = true return } diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/CollectionView.js index 3bc2623c..9387a7b8 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/CollectionView.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/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: { @@ -22,7 +23,8 @@ var CollectionView = ScrollableView.extend({ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#collection', app.iscroll_options) - this.filterView = new DepartmentFilter ({ parent: this }) + this.departmentFilterView = new DepartmentFilter ({ parent: this }) + this.sizeFilterView = new SizeFilter ({ parent: this }) }, show: function(){ @@ -34,11 +36,17 @@ 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 { - app.footer.show("FILTER") + if (app.store.FilterBy !== "none") { + if (app.store.FilterBy === "category") { + app.footer.show("FILTER") + } + else { + app.footer.show("FILTER BY " + app.store.FilterBy.toUpperCase()) + } } document.body.className = "collection" if (this.loaded) { @@ -50,8 +58,16 @@ var CollectionView = ScrollableView.extend({ } }, + // called when footer is tapped - filter by (x) save: function(){ - this.filterView.filter() + switch (app.store.FilterBy) { + case 'none': + this.departmentFilterView.filter() + break + case 'size': + this.sizeFilterView.filter() + break + } }, fetch: function(){ @@ -92,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) { @@ -112,26 +128,75 @@ var CollectionView = ScrollableView.extend({ // } console.log( data.SearchResponseFull.Results.Items.length ) - data.SearchResponseFull.Results.Items.forEach(function(item){ - console.log(">>> ITEM") - this.append(item, is_single_product) - }.bind(this)) - this.deferScrollToTop() + + var items = this.filtered_items || data.SearchResponseFull.Results.Items + if (app.store.GroupBy === 'size') { + this.groupBySize( items, is_single_product ) + } + else { + this.appendItems( items, is_single_product ) + } + // this.restoreScroll() + // this.deferScrollToTop() } this.afterFetchCallback && this.afterFetchCallback() - app.collection.deferRefresh() + this.deferRefresh() + this.restoreScroll() + }, + + groupBySize: function(items, is_single_product){ + var groups = {} + items.forEach(function(item){ + if (! item.Sizes.length) return + var size = item.Sizes[0] + var id = size['Text'] + if ( ! (id in groups) ) { + groups[id] = { + label: SIZE_LOOKUP[ id ], + items: [], + } + } + groups[id].items.push( item ) + }.bind(this)) + + Object.keys(groups).sort(function(a,b){ + var ao = SIZE_ORDER.indexOf( a ) + var bo = SIZE_ORDER.indexOf( b ) + return ao - bo + }).forEach(function(id){ + var size = groups[id] + var $el = $("<div>") + $el.addClass("product-group") + $el.html( size.label ) + this.$content.append($el) + this.appendItems( size.items, is_single_product ) + }.bind(this)) + }, + + appendItems: function(items, is_single_product){ + items.forEach(function(item){ + this.append(item, is_single_product) + }.bind(this)) }, append: function(item, is_single_product){ this.items[ item['Code8'] ] = item var t = this.template.replace(/{{image}}/, sdk.image(item['DefaultCode10'], is_single_product ? '13_f' : '11_f')) .replace(/{{code8}}/, item['Code8']) - this.$content.append(t) + var $t = $(t) + if (app.store.ShowProductNameOnCollectionPage) { + var $title = $("<span>") + $title.addClass("product-title") + $title.html( item['ModelNames'] ) + $t.append($title) + } + this.$content.append($t) }, pick: function(e){ var code = $(e.currentTarget).data("code") var data = this.items[code] + this.saveScroll() app.product.load(code, data) }, @@ -141,9 +206,10 @@ var CollectionView = ScrollableView.extend({ this.$title.html(this.collectionName) }, + // filter by department showDepartmentSelector: function(){ if (this.$("h1").hasClass("single-dept")) { - this.filterView.filter() + this.departmentFilterView.filter() } }, diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/ProductView.js index a757f681..6a61be1b 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/ProductView.js @@ -16,7 +16,7 @@ var ProductView = ScrollableView.extend({ this.gallery = new GalleryView () this.scroller = new IScroll('#product', app.iscroll_options) - this.$num = this.$(".num") + this.$productHeader = this.$(".product-header") this.$title = this.$(".title") this.$type = this.$(".type") this.$price = this.$(".price") @@ -113,12 +113,12 @@ var ProductView = ScrollableView.extend({ var descriptions = this.get_descriptions(details) - var name_partz = data['ModelNames'].split(' ') - var num = name_partz.shift() - var title = name_partz.join(' ') + var title = data['ModelNames'] var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" - var body = descriptions['Details'] + " " + descriptions['EditorialDescription'] + var details_description = descriptions['Details'] || "" + var editorial = descriptions['EditorialDescription'] || "" + var body = details_description + " " + editorial // body = body.replace(/<br>/g, "<br><br>").replace(/(<br>)+$/, "") var default_color_id = this.populate_selectors(data, details) @@ -162,11 +162,12 @@ var ProductView = ScrollableView.extend({ console.log( data['DefaultCode10'] ) - this.$num.html(num) this.$title.html(title) this.$type.html(type) this.$price.html(price) this.$body.html(body) + + this.$productHeader.toggleClass("wide", title.length > 48) var fits_large = !! this.fitLargeCodes[this.code] app.product.$fit.toggle( fits_large ) @@ -196,8 +197,11 @@ var ProductView = ScrollableView.extend({ populate_selectors: function(data, details){ var sizes = {}, colors = {}, size_lookup = {}, default_color - console.log(details['Item']['ModelColors'].length) - if (! details['Item']['ModelColors'].length) { + + var modelColors = details['Item']['ModelColors'] || [] + console.log('colors:', modelColors.length || "none") + + if (! modelColors.length) { this.not_available = true return } @@ -205,7 +209,7 @@ var ProductView = ScrollableView.extend({ this.not_available = false } - details['Item']['ModelColors'].forEach(function(color, index){ + modelColors.forEach(function(color, index){ if (! default_color || color['Code10'] == data['DefaultCode10']) { default_color = color['ColorId'] } diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/DepartmentFilter.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/DepartmentFilter.js index cc0d925e..7d5ccf3d 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/DepartmentFilter.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/DepartmentFilter.js @@ -6,7 +6,6 @@ var DepartmentFilter = View.extend({ filter: function(){ var deps = app.departments.map(function(dep){ - console.log(dep) return { id: dep.uri, label: dep.text, diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Scrollable.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Scrollable.js index 0baff845..7f90929a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Scrollable.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/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/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/_sdk.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/_sdk.js index 017df015..705ca002 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/_sdk.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/_sdk.js @@ -9,7 +9,7 @@ var sdk = (function(){ sdk.init = function(opt){ switch (sdk.env = opt.env || "development") { case 'test': - endpoint = "http://lvh.me:9090/" + endpoint = window.location.origin + "/" break default: case 'development': @@ -26,7 +26,7 @@ var sdk = (function(){ } sdk.image = function(code, size){ - return "http://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_" + size + ".jpg" + return "https://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_" + size + ".jpg" } $.ajaxSetup({ diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/loader.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/loader.js index cc9644f8..ccfcdc9e 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/loader.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/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); } diff --git a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate Binary files differindex 02f98378..7b85af90 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate +++ b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/StoneIsland/platforms/ios/www/css/products.css b/StoneIsland/platforms/ios/www/css/products.css index dd3c217a..c4599866 100755 --- a/StoneIsland/platforms/ios/www/css/products.css +++ b/StoneIsland/platforms/ios/www/css/products.css @@ -24,6 +24,11 @@ height: 126vw; } +#collection .item .product-title { + padding-bottom: 18px; + display: inline-block; +} + .product #product { display: block } #product { display: none; 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); } diff --git a/StoneIsland/www/css/products.css b/StoneIsland/www/css/products.css index dd3c217a..c4599866 100755 --- a/StoneIsland/www/css/products.css +++ b/StoneIsland/www/css/products.css @@ -24,6 +24,11 @@ height: 126vw; } +#collection .item .product-title { + padding-bottom: 18px; + display: inline-block; +} + .product #product { display: block } #product { display: none; diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js index aa9d1d39..a6ec75f2 100755 --- a/StoneIsland/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/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/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js index 013c2b45..38a7eecf 100755 --- a/StoneIsland/www/js/lib/blogs/HubView.js +++ b/StoneIsland/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/www/js/lib/etc/backup_db.js b/StoneIsland/www/js/lib/etc/backup_db.js index eec5c415..dccfa36b 100755 --- a/StoneIsland/www/js/lib/etc/backup_db.js +++ b/StoneIsland/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": "", + "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/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js index 803acc76..7b634138 100755 --- a/StoneIsland/www/js/lib/products/CollectionView.js +++ b/StoneIsland/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") } @@ -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/www/js/lib/products/filters/SizeFilter.js b/StoneIsland/www/js/lib/products/filters/SizeFilter.js index a009dd15..d0231021 100644 --- a/StoneIsland/www/js/lib/products/filters/SizeFilter.js +++ b/StoneIsland/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/www/js/lib/view/Scrollable.js b/StoneIsland/www/js/lib/view/Scrollable.js index 0baff845..7f90929a 100755 --- a/StoneIsland/www/js/lib/view/Scrollable.js +++ b/StoneIsland/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/www/js/vendor/loader.js b/StoneIsland/www/js/vendor/loader.js index cc9644f8..ccfcdc9e 100755 --- a/StoneIsland/www/js/vendor/loader.js +++ b/StoneIsland/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); } diff --git a/stoneisland.apk b/stoneisland.apk Binary files differindex f57548b3..744124c5 100644 --- a/stoneisland.apk +++ b/stoneisland.apk |
