From 3a12871d8513c1daed9d0309b10df3b40105dad9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 2 Apr 2017 18:15:02 +0200 Subject: load department id from querystring --- .gitignore | 1 + StoneIsland/angle-down.svg | 1 - StoneIsland/config.xml | 2 +- .../user.xcuserdatad/UserInterfaceState.xcuserstate | Bin 13186 -> 13204 bytes .../ios/Stone Island/Stone Island-Info.plist | 4 ++-- StoneIsland/platforms/ios/Stone Island/config.xml | 2 +- .../ios/www/js/lib/products/ProductView.js | 4 +++- StoneIsland/www/js/index.js | 2 +- StoneIsland/www/js/lib/blogs/BlogView.js | 10 +++++++--- StoneIsland/www/js/lib/etc/push.js | 2 +- StoneIsland/www/js/lib/products/CollectionView.js | 1 + 11 files changed, 18 insertions(+), 11 deletions(-) delete mode 100644 StoneIsland/angle-down.svg diff --git a/.gitignore b/.gitignore index 57a0c3a3..4627e998 100755 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ app.min.js server/ +StoneIsland/www/db.json diff --git a/StoneIsland/angle-down.svg b/StoneIsland/angle-down.svg deleted file mode 100644 index e7f3161b..00000000 --- a/StoneIsland/angle-down.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/StoneIsland/config.xml b/StoneIsland/config.xml index b19749a0..5260c0a2 100755 --- a/StoneIsland/config.xml +++ b/StoneIsland/config.xml @@ -1,5 +1,5 @@ - + Stone Island Stone Island 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 index e591d9f5..0297ea66 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate and b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist index 9df040b0..6182f0a3 100644 --- a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist +++ b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.8.5 + 0.8.6 CFBundleSignature ???? CFBundleURLTypes @@ -34,7 +34,7 @@ CFBundleVersion - 0.8.5 + 0.8.6 GCM_SENDER_ID XXXXXXX IS_GCM_ENABLED diff --git a/StoneIsland/platforms/ios/Stone Island/config.xml b/StoneIsland/platforms/ios/Stone Island/config.xml index 95e7c2ef..eadd656d 100755 --- a/StoneIsland/platforms/ios/Stone Island/config.xml +++ b/StoneIsland/platforms/ios/Stone Island/config.xml @@ -1,5 +1,5 @@ - + diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js index a757f681..4ae77c1f 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js @@ -118,7 +118,9 @@ var ProductView = ScrollableView.extend({ var title = name_partz.join(' ') var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" - var body = descriptions['Details'] + " " + descriptions['EditorialDescription'] + var details = descriptions['Details'] || "" + var editorial = descriptions['EditorialDescription'] || "" + var body = details + " " + editorial // body = body.replace(/
/g, "

").replace(/(
)+$/, "") var default_color_id = this.populate_selectors(data, details) diff --git a/StoneIsland/www/js/index.js b/StoneIsland/www/js/index.js index 06bfaaac..e583a2cd 100755 --- a/StoneIsland/www/js/index.js +++ b/StoneIsland/www/js/index.js @@ -4,7 +4,7 @@ var app = (function(){ app.init = function(){ console.log("init") - sdk.init({ env: "production" }) + sdk.init({ env: "test" }) app.bind() app.build() diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js index 1bd56908..fe36e025 100755 --- a/StoneIsland/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/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() @@ -42,7 +42,7 @@ var BlogView = View.extend({ break } - if (app.closed.storeIsClosed) { + if (app.closed.storeIsClosed && sdk.env !== 'test') { app.closed.populate(data.store[0].ClosedStoreImages) } else { @@ -52,6 +52,10 @@ var BlogView = View.extend({ app.collection.setCollectionName( data.store[0].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.collection.loaded = false app.collection.fetch() } diff --git a/StoneIsland/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js index da63fdd1..043a4d75 100755 --- a/StoneIsland/www/js/lib/etc/push.js +++ b/StoneIsland/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/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js index 3bc2623c..67a3a456 100755 --- a/StoneIsland/www/js/lib/products/CollectionView.js +++ b/StoneIsland/www/js/lib/products/CollectionView.js @@ -98,6 +98,7 @@ var CollectionView = ScrollableView.extend({ if (is_single_product) { console.log("IS SINGLE PRODUCT") var item = data.SearchResponseFull.Results.Items[0] + console.log(item) var url = sdk.image(item['DefaultCode10'], '13_f') console.log(url) var img = new Image () -- cgit v1.2.3-70-g09d2