diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-10-16 02:22:53 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-10-16 02:22:53 +0200 |
| commit | c75e4f0b5fc83548e337af6c533036baec8c85c9 (patch) | |
| tree | 71580d75dfb378951ace4a9dd620f32a0ec42cbb | |
| parent | 335e61243d45c4c2eb5d030a8ee5f85c2ddf35f3 (diff) | |
update
64 files changed, 701 insertions, 308 deletions
diff --git a/StoneIsland/config.xml b/StoneIsland/config.xml index 6dad78db..44a36a16 100755 --- a/StoneIsland/config.xml +++ b/StoneIsland/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-versionCode="6123" id="us.okfoc.stoneisland" version="1.2.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-versionCode="6124" id="us.okfoc.stoneisland" version="1.2.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>Stone Island</name> <description> Stone Island diff --git a/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/fileHashes.bin b/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/fileHashes.bin Binary files differindex cf1d6d8e..16a05746 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/fileHashes.bin +++ b/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/fileHashes.bin diff --git a/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/fileSnapshots.bin b/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/fileSnapshots.bin Binary files differindex d81b4a62..afc21d86 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/fileSnapshots.bin +++ b/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/fileSnapshots.bin diff --git a/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/taskArtifacts.bin b/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/taskArtifacts.bin Binary files differindex be4a82e5..654d6093 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/taskArtifacts.bin +++ b/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/taskArtifacts.bin diff --git a/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/taskArtifacts.lock b/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/taskArtifacts.lock Binary files differindex ad0f98ee..20e5a3a0 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/taskArtifacts.lock +++ b/StoneIsland/platforms/android/.gradle/3.3/taskArtifacts/taskArtifacts.lock diff --git a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin Binary files differindex 36561273..829a44a1 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin +++ b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin diff --git a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock Binary files differindex 620aaf9e..9846179a 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock +++ b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock diff --git a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock Binary files differindex d9d88041..0e3369e0 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock +++ b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock diff --git a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock Binary files differindex d45fbf63..11c32db9 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock +++ b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock diff --git a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock Binary files differindex 3a057f3e..8e6837da 100644 --- a/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock +++ b/StoneIsland/platforms/android/.gradle/3.3/tasks/_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock diff --git a/StoneIsland/platforms/android/AndroidManifest.xml b/StoneIsland/platforms/android/AndroidManifest.xml index ae659c26..4949ed38 100755 --- a/StoneIsland/platforms/android/AndroidManifest.xml +++ b/StoneIsland/platforms/android/AndroidManifest.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<manifest android:hardwareAccelerated="true" android:versionCode="6123" android:versionName="1.2.3" package="us.okfoc.stoneisland" xmlns:android="http://schemas.android.com/apk/res/android"> +<manifest android:hardwareAccelerated="true" android:versionCode="6124" android:versionName="1.2.4" package="us.okfoc.stoneisland" xmlns:android="http://schemas.android.com/apk/res/android"> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true"> diff --git a/StoneIsland/platforms/android/assets/www/css/blogs.css b/StoneIsland/platforms/android/assets/www/css/blogs.css index f857db9e..c4b74c19 100755 --- a/StoneIsland/platforms/android/assets/www/css/blogs.css +++ b/StoneIsland/platforms/android/assets/www/css/blogs.css @@ -186,6 +186,9 @@ height:100px; box-sizing:border-box } +.vscroll .fade-cover { + display: none; +} /* .fade-cover::before { @@ -264,6 +267,13 @@ ul.links { transform-origin: 50% 50%; transform: translateZ(0) translateX(-50%) translateY(-50%); } +#archive .menu { + position: fixed; + display: none; +} +#archive.menu .menu { + display: block; +} .accessible #archive .row .image, .accessible #archive .row .text { @@ -353,6 +363,16 @@ ul.links { width: 90%; } +.gallery-target { + display: none; +} +.accessible .gallery-target { + display: block; + position: absolute; + top: 0; left: 0; + width: 100vw; + height: 52vh; +} .gallery-video-post { position:relative; } diff --git a/StoneIsland/platforms/android/assets/www/css/products.css b/StoneIsland/platforms/android/assets/www/css/products.css index 63e9b020..e15e0e54 100755 --- a/StoneIsland/platforms/android/assets/www/css/products.css +++ b/StoneIsland/platforms/android/assets/www/css/products.css @@ -55,6 +55,7 @@ } .gallery .item { + display: block; width: 100vw; height: 52vh; background-size: contain; @@ -93,6 +94,11 @@ text-align: center; width: 100%; } +#closed .closed_target { + position: absolute; + top: 0; left: 0; + width: 100%; height: 100%; +} .product .content { box-sizing:border-box; @@ -160,19 +166,31 @@ display: flex; flex-direction: row; } -.product .size-color span { - position:relative; - box-sizing:border-box; - padding: 0 12px; +.product .size-color > div { + position: relative; + box-sizing: border-box; height: 48px; font-size: 1rem; display: flex; justify-content: center; align-items: center; } -.product .size-color span.size { +.product .size-color > div > div.label { + padding: 0 12px; + max-width: 6rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.product .size-color div.size { border-right: 1px solid #444; } +.product .size-color > div > select { + position: absolute; + top: 0; left: 0; + width: 100%; height: 100%; + opacity: 0; +} .product .price { display:table-cell; diff --git a/StoneIsland/platforms/android/assets/www/db.json b/StoneIsland/platforms/android/assets/www/db.json index 8b9d322c..7bffd341 100644 --- a/StoneIsland/platforms/android/assets/www/db.json +++ b/StoneIsland/platforms/android/assets/www/db.json @@ -4838,7 +4838,7 @@ "Departments": [ { "text": "Test", - "uri": "ctsjckts" + "uri": "PPPRVWFWSC1" } ], "StoreStatus": "closed", diff --git a/StoneIsland/platforms/android/assets/www/index.html b/StoneIsland/platforms/android/assets/www/index.html index eaae059a..a422832c 100755 --- a/StoneIsland/platforms/android/assets/www/index.html +++ b/StoneIsland/platforms/android/assets/www/index.html @@ -138,10 +138,11 @@ <script type="text/html" class="template"> <div class="hub_item" data-id="{{id}}"> <div class="gallery gallery-{{id}}" role="carousel"></div> + <div role="button" class="gallery-target gallery-target-{{id}}"></div> <div role="button" aria-label='Scroll gallery to the left' class="gallery-left"></div> <div role="button" aria-label='Scroll gallery to the right' class="gallery-right"></div> <div role="heading" class="content-header"> - <div role="button" class="content-share"> + <div role="button" class="content-share" aria-label="Share this post"> SHARE + </div> <span role="heading" aria-details="{{cleantitle}}" class="title">{{title}}</span> @@ -166,7 +167,7 @@ <div class="content"> <script type="text/html" class="template"> - <div class="image" style="background-image:url({{image}})"></div> + <div class="image" aria-label="{{label}}" style="background-image:url({{image}})"></div> <div class="text"> <h2> <b>{{code}}</b><br> @@ -312,6 +313,7 @@ <div role="link" class="item" aria-label="{{alt}}" style="background-image:url({{image}})"></div> </script> </div> + <div role="button" class="gallery-target"></div> <div role="button" class="gallery-left" aria-label="Scroll gallery left"></div> <div role="button" class="gallery-right" aria-label="Scroll gallery right"></div> <div class="content"> @@ -325,11 +327,17 @@ <div class="style-share"> <span class="style"> <div class="size-color"> - <span role="button" class="size" aria-label="Tap to select size. Current size"></span> - <span role="button" class="color" aria-label="Tap to select color. Current color"></span> + <div role="button" class="size" aria-label="Tap to select size. Current size"> + <div class="label"></div> + <select name="size"></select> + </div> + <div role="button" class="color" aria-label="Tap to select color. Current color"> + <div class="label"></div> + <select name="color"></select> + </div> </div> </span> - <span role="button" class="share">SHARE +</span> + <span role="button" class="share" aria-label="Share this product">SHARE +</span> </div> <div class="fit">Fits Large</div> <div class='fitHeader'></div> @@ -346,15 +354,16 @@ </div> <div id="closed" role="region" aria-label="The store is closed"> + <div class="closed_target" role="button" aria-label="The store is closed. Placeholder image of a Stone Island model wearing a jacket."></div> <div class="closed_store_msg"> <h3> LOADING THE STORE, PLEASE WAIT </h3> <h4> </h4> - <div role="link" class="website_link"> + <div role="link" class="website_link" aria-label='Visit w w w dot stone island dot com'> visit<br> - <b aria-label='w w w dot stone island dot com'>www.stoneisland.com</b> + <b role='link' aria-label='w w w dot stone island dot com'>www.stoneisland.com</b> </div> </div> </div> @@ -1359,8 +1368,8 @@ <script src="js/lib/blogs/BlogView.js"></script> <script src="js/lib/blogs/ArchiveView.js"></script> <script src="js/lib/blogs/HubView.js"></script> -<script src="js/lib/blogs/PageView.js"></script> <script src="js/lib/blogs/StoryView.js"></script> +<script src="js/lib/blogs/PageView.js"></script> <script src="js/lib/_router.js"></script> diff --git a/StoneIsland/platforms/android/assets/www/js/index.js b/StoneIsland/platforms/android/assets/www/js/index.js index b90f74b1..42cec6f1 100755 --- a/StoneIsland/platforms/android/assets/www/js/index.js +++ b/StoneIsland/platforms/android/assets/www/js/index.js @@ -12,26 +12,11 @@ var app = (function(){ sdk.init({ env: "production" }) } - accessibility.init(app.prebuild) // check if we can do native scrolling before build - } - - app.prebuild = function(){ - app.bind() - app.build() - - app.iscroll_options = { - mouseWheel: true, - scrollbars: true, - disablePointer: is_android ? true : false, // important to disable the pointer events that causes the issues - disableTouch: false, // false if you want the slider to be usable with touch devices - disableMouse: false // false if you want the slider to be usable with a mouse (desktop) - } - if (window.cordova) { - document.addEventListener('deviceready', app.ready, false) + document.addEventListener('deviceready', app.device_ready, false) } else { - app.ready() + app.device_ready() } } @@ -77,8 +62,24 @@ var app = (function(){ app.selector = new Selector () } + app.device_ready = function(){ + accessibility.init(app.ready) // check if we can do native scrolling before build + } + app.ready = function(){ console.log(">> READY") + + app.bind() + app.build() + + app.iscroll_options = { + mouseWheel: true, + scrollbars: true, + disablePointer: is_android ? true : false, // important to disable the pointer events that causes the issues + disableTouch: false, // false if you want the slider to be usable with touch devices + disableMouse: false // false if you want the slider to be usable with a mouse (desktop) + } + if (window.cordova) { document.addEventListener('pause', app.paused, false) document.addEventListener('resume', app.resumed, false) diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js index f10f7744..92427b6f 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js @@ -58,10 +58,9 @@ var ArchiveView = ScrollableView.extend({ // id title images[ uri label code caption ] this.data.forEach(function(row, index){ - var t = this.menu_template.replace(/{{title}}/, row.title) var $t = $(t) - $t.data("aria-label", stonewash(row.title.replace(/'/g, " '").trim())) + $t.data("aria-label", stonewash(row.title.replace(/'0/g, " 20").replace(/'9/g, " 19").trim())) $t.data("title", row.title) $t.data("index", index) this.$menu_items.append($t) @@ -86,7 +85,7 @@ var ArchiveView = ScrollableView.extend({ var $t = $("<div>") $t.addClass("row").addClass("loading") var t = this.row_template.replace(/{{image}}/, cell.uri) - .replace(/{{label}}/, cell.label) + .replace(/{{label}}/g, cell.label) .replace(/{{code}}/, cell.code) .replace(/{{caption}}/, cell.caption) $t.html(t) diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js index a0ee9dd0..d3b15f77 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js @@ -94,10 +94,18 @@ var HubView = ScrollableView.extend({ app.fullscreenViewer.show(url, url) }) $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Image gallery, use the arrows to scroll.") + if (accessibility.voiceOver) { + $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Image gallery, use the arrows to scroll.") + $(".gallery-target-" + row.id).click(function(e){ + e && e.preventDefault() + var url = gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + app.fullscreenViewer.show(url, url) + }) + } } else { // single image - var el = document.createElement("div") + var el = document.createElement(accessibility.voiceOver ? "a" : "div") if (row.image && row.image.length) { el.style.backgroundImage = "url(" + row.image[0].uri + ")" } @@ -112,16 +120,28 @@ var HubView = ScrollableView.extend({ $(".gallery-" + row.id).addClass("gallery-video-post") $(".gallery-" + row.id).attr('role', 'link') $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Tap to watch the video on Youtube") + // $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Tap to watch the video on Youtube") if (! row.image) { var url = row.link var ytid = (url.match(/v=([-_a-zA-Z0-9]{11})/i) || url.match(/youtu.be\/([-_a-zA-Z0-9]{11})/i) || url.match(/embed\/([-_a-zA-Z0-9]{11})/i))[1].split('&')[0]; e.style.backgroundImage = "url(https://i.ytimg.com/vi/" + ytid + "/maxresdefault.jpg" } + // $(".gallery-target-" + row.id).click(function(e){ + // e && e.preventDefault() + // window.open(row.link, '_system') + // }) + $(".gallery-target-" + row.id).remove() } else { - $(el).click(function(){ + $(el).click(function(e){ + e && e.preventDefault() app.fullscreenViewer.show(row.image[0].uri) }) $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Main image") + $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Main image.") + $(".gallery-target-" + row.id).click(function(e){ + e && e.preventDefault() + app.fullscreenViewer.show(row.image[0].uri) + }) } $t.find(".gallery-left").remove() $t.find(".gallery-right").remove() diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/accessibility.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/accessibility.js index 8108e461..31ddaf23 100644 --- a/StoneIsland/platforms/android/assets/www/js/lib/etc/accessibility.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/accessibility.js @@ -17,8 +17,10 @@ var accessibility = (function() { return ready() } if ('MobileAccessibility' in window) { + console.log('init accessibility') accessibility.build(ready) } else { + console.log('MobileAccessibility not found') ready() } } diff --git a/StoneIsland/platforms/android/assets/www/js/lib/nav/FooterView.js b/StoneIsland/platforms/android/assets/www/js/lib/nav/FooterView.js index 8641668f..855c37bd 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/nav/FooterView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/nav/FooterView.js @@ -17,12 +17,14 @@ var FooterView = View.extend({ if (cancel) { this.$ok.removeClass("wide") this.$cancel.show().html(cancel) + this.$cancel.attr('aria-label', cancel.toLowerCase()) } else { this.$ok.addClass("wide") this.$cancel.hide() } this.$ok.html(ok) + this.$ok.attr('aria-label', ok.toLowerCase()) this.$el.show() }, diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/GalleryView.js b/StoneIsland/platforms/android/assets/www/js/lib/products/GalleryView.js index d6f5723c..e84caa68 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/GalleryView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/GalleryView.js @@ -58,19 +58,40 @@ var GalleryView = View.extend({ draggable: true, }) - this.gallery.on('staticClick', function(e){ - var currentImage = gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + this.gallery.on('change', function(){ + var currentImage = this.gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") var partz = currentImage.split("_") var head = partz[0] var size = partz[1] var tail = partz[2] var end_partz = tail.split(/\./) var style = end_partz[0] - var largest_size = large_styles[style] - var hiresImage = [head, largest_size, tail].join("_") - app.fullscreenViewer.show(currentImage, hiresImage) + var label = YOOX_IMAGE_STYLE_LABELS[style] || "Image: Alternate view" + $("#product .gallery-target").attr('aria-label', label) }) + + this.gallery.on('staticClick', this.static_click.bind(this)) + + if (accessibility.voiceOver) { + $("#product .gallery-target").click(this.static_click.bind(this)) + $("#product .gallery-target").attr('aria-label', "Image: Front view") + } else { + $("#product .gallery-target").remove() + } }, + static_click: function(e){ + var currentImage = this.gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + var partz = currentImage.split("_") + var head = partz[0] + var size = partz[1] + var tail = partz[2] + var end_partz = tail.split(/\./) + var style = end_partz[0] + var largest_size = large_styles[style] + var hiresImage = [head, largest_size, tail].join("_") + app.fullscreenViewer.show(currentImage, hiresImage) + }, + touchstart: function(e){ }, touchmove: function(e){ @@ -82,7 +103,7 @@ var GalleryView = View.extend({ var YOOX_IMAGE_STYLE_ORDER = "ZZZ f r d e a b c g l".split(" ") var YOOX_IMAGE_STYLE_LABELS = { - f: 'Front view', - r: 'Rear view', + f: 'Image: Front view', + r: 'Image: Rear view', } function sort_image_styles (b,a){ return (YOOX_IMAGE_STYLE_ORDER.indexOf(b)) - (YOOX_IMAGE_STYLE_ORDER.indexOf(a)) }
\ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js b/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js index 62a6de18..f834b1c5 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js @@ -1,4 +1,3 @@ - var ProductView = ScrollableView.extend({ el: "#product", @@ -6,8 +5,10 @@ var ProductView = ScrollableView.extend({ events: { "click .fit": "scroll_to_bottom", "click .notAvailableInCanada": "scroll_to_bottom", - "click .size": "select_size", - "click .color": "select_color", + "change select[name=size]": "select_size", + "change select[name=color]": "select_color", + // "click .size": "select_size", + // "click .color": "select_color", "click .share": "share", "click .gallery-left": "gallery_left", "click .gallery-right": "gallery_right", @@ -22,8 +23,12 @@ var ProductView = ScrollableView.extend({ this.$type = this.$(".type") this.$price = this.$(".price") this.$size = this.$(".size") - this.$share = this.$(".share") + this.$sizeSelect = this.$(".size select") + this.$sizeLabel = this.$(".size .label") this.$color = this.$(".color") + this.$colorSelect = this.$(".color select") + this.$colorLabel = this.$(".color .label") + this.$share = this.$(".share") this.$body = this.$(".body") this.$fit = this.$(".fit") this.$fitHeader = this.$('.fitHeader') @@ -123,7 +128,7 @@ var ProductView = ScrollableView.extend({ var descriptions = this.get_descriptions(details) - var title = data['ModelNames'] + var title = data['ModelNames'] || "" var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" var details_description = descriptions['Details'] || "" @@ -132,7 +137,7 @@ var ProductView = ScrollableView.extend({ // body = body.replace(/<br>/g, "<br><br>").replace(/(<br>)+$/, "") var default_color_id = this.populate_selectors(data, details) - + var notAvailableInCanada = !! app.store.NotAvailableInCanada app.product.$notAvailableInCanada.toggle( notAvailableInCanada ) @@ -166,14 +171,8 @@ var ProductView = ScrollableView.extend({ this.size = size this.is_onesize = !! this.sizes[1] - - this.$size.show().html(size_label) - if (color_label) { - this.$color.html(color_label) - } - else { - this.$color.hide() - } + this.set_size_label(size_label) + this.set_color_label(color_label) } // console.log(color, color_label, size, size_label) @@ -233,6 +232,9 @@ var ProductView = ScrollableView.extend({ this.$sizing.hide() } + this.populate_sizes() + this.populate_colors() + this.deferScrollToTop() }, @@ -314,37 +316,74 @@ var ProductView = ScrollableView.extend({ return default_color }, - select_size: function(){ + populate_sizes: function() { + console.log(this.sold_out, this.notAvailable, this.is_onesize, this.item) if (this.sold_out) { return } if (this.notAvailable) { return } - if (this.is_onesize) { return this.select_color() } - if (this.item['Sizes'].length == 0) { return } - var sizes = Object.keys(this.sizes).map(function(key){ - return this.sizes[key] - }.bind(this)) - - app.selector.select("style", sizes, function(size){ - console.log(size) - this.size = size.value - this.$size.html(size.label) + // if (this.is_onesize) { return this.select_color() } + if (this.details['ModelSizes'].length == 0) { return } + + this.$sizeSelect.empty() + var sizes = Object.keys(this.sizes).forEach(function(key){ + var size = this.sizes[key] + var option = document.createElement('option') + option.value = size.value + option.innerHTML = size.label + this.$sizeSelect.append(option) }.bind(this)) }, - - select_color: function(){ + + populate_colors: function() { if (this.sold_out) { return } if (this.notAvailable) { return } - if (this.item['Colors'].length == 0) { return } - var colors = Object.keys(this.colors).map(function(key){ - return this.colors[key] - }.bind(this)) - app.selector.select("style", colors, function(color){ - this.code = color.code - this.$color.html(color.label) - this.gallery.populate( color.code, this.details['ImageTypes'] ) - this.gallery_right() + if (this.details['ModelColors'].length == 0) { return } + + this.$colorSelect.empty() + Object.keys(this.colors).forEach(function(key){ + var color = this.colors[key] + var option = document.createElement('option') + option.value = key + option.innerHTML = color.label + this.$colorSelect.append(option) }.bind(this)) }, + select_size: function(){ + console.log(this.colors) + var value = this.$sizeSelect.val() + var size = this.sizes[value] + console.log(size) + this.set_size_label(size.label) + this.size = size.value + }, + + select_color: function(){ + var value = this.$colorSelect.val() + var color = this.colors[value] + console.log(color) + this.code = color.code + this.set_color_label(color.label) + this.gallery.populate( color.code, this.details['ImageTypes'] ) + this.gallery_right() + }, + + set_size_label: function(size_label){ + this.$size.show() + this.$sizeLabel.html(size_label) + this.$size.attr('aria-label', 'Tap to select size. Current size: ' + size_label) + }, + + set_color_label: function(color_label){ + if (color_label) { + this.$color.show() + this.$colorLabel.html(color_label) + this.$color.attr('aria-label', 'Tap to select color. Current color: ' + color_label) + } + else { + this.$color.hide() + } + }, + // ADD TO CART save: function(){ if (this.sold_out) { return } diff --git a/StoneIsland/platforms/android/assets/www/js/vendor/util.js b/StoneIsland/platforms/android/assets/www/js/vendor/util.js index 27bdf008..c44dda79 100755 --- a/StoneIsland/platforms/android/assets/www/js/vendor/util.js +++ b/StoneIsland/platforms/android/assets/www/js/vendor/util.js @@ -25,7 +25,7 @@ function hex_string (rgb) { return "#" + rgb.map(Math.round).map(function(n){ va function parse_rgba_string (s) { return s.match(/(\d+)/g).slice(0,3) } function title_case (str) { - return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); + return (str || "").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); } function pluralize (n,s,ss) { return n + " " + s + ( n == 1 ? "" : (ss || "s") ) } function as_cash(n){ diff --git a/StoneIsland/platforms/android/res/xml/config.xml b/StoneIsland/platforms/android/res/xml/config.xml index 1b471bd4..ad4929e6 100644 --- a/StoneIsland/platforms/android/res/xml/config.xml +++ b/StoneIsland/platforms/android/res/xml/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-versionCode="6123" id="us.okfoc.stoneisland" version="1.2.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-versionCode="6124" id="us.okfoc.stoneisland" version="1.2.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <feature name="InAppBrowser"> <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" /> </feature> diff --git a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist index 4f3362e8..3038bdb4 100644 --- a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -22,7 +22,7 @@ <key>CordovaLib.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> - <integer>3</integer> + <integer>2</integer> </dict> </dict> </dict> diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist b/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist index 3c1a15d7..492b3406 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist @@ -9,9 +9,9 @@ <key>CFBundleIdentifier</key> <string>us.okfoc.stoneisland</string> <key>CFBundleShortVersionString</key> - <string>1.2.3</string> + <string>1.2.4</string> <key>CFBundleVersion</key> - <string>1.2.3</string> + <string>1.2.4</string> <key>SigningIdentity</key> <string>iPhone Developer: Francesca Agusani (3ECUPBTQ5W)</string> <key>Team</key> @@ -20,7 +20,7 @@ <key>ArchiveVersion</key> <integer>2</integer> <key>CreationDate</key> - <date>2019-09-03T17:36:10Z</date> + <date>2019-10-15T13:42:26Z</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/Assets.car b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car Binary files differindex c5eab167..6c786a61 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car 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 44bd0efb..a5c0a5af 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 2d671b31..200094d3 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 f182f60f..1f6abc6f 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 6a932178..26c95177 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 f6b65fba..1ba4f7d6 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 5b30e4e4..f426ba0f 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 @@ -94,11 +94,11 @@ </data> <key>Assets.car</key> <data> - VH1h9C+NzgBCZrqAmWhSs/dbGmc= + Kwar1Lpeq1PSL1k9Htg3b88BLOU= </data> <key>CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key> <data> - tmw9rPRh0FHxDYK8d+XNTVAW8lE= + EZSKMENet04qnojPKjTy87Ck+kU= </data> <key>CDVLaunchScreen.storyboardc/Info.plist</key> <data> @@ -106,7 +106,7 @@ </data> <key>CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib</key> <data> - GjQfqLxJ+zEF5K8ZynCdnGblEbo= + FjF8wMpbNRaWuLABS8u/DSNBgAQ= </data> <key>CDVNotification.bundle/beep.wav</key> <data> @@ -114,11 +114,11 @@ </data> <key>Info.plist</key> <data> - LHCAmJHRhZPqMmRio/xgaF1HwuM= + zgJX+PBuvZOn7XqgLJ/VpeYUnIo= </data> <key>MainViewController.nib</key> <data> - YSGSdofDJzUxj+jdvDecPcpDO78= + KTqOI00Es51zeiXqiLVhUoSBkik= </data> <key>PkgInfo</key> <data> @@ -126,11 +126,11 @@ </data> <key>config.xml</key> <data> - PqlLBIYAkd+4vr1/1jZQAJj8J7k= + fz52wQVVOwlkB35iTIUIMBC2dhA= </data> <key>embedded.mobileprovision</key> <data> - l8wkj9UX5I2v1dBJQvQf/lTQiew= + gendZ7kyekdN6egm653Da4aRvrk= </data> <key>www/cordova-js-src/exec.js</key> <data> @@ -162,7 +162,7 @@ </data> <key>www/css/blogs.css</key> <data> - SLcjU48OnlqOEA9Xii5RYPNFNDI= + 09ZjZlLNOQw7OoxGbKdCihckd6E= </data> <key>www/css/cart.css</key> <data> @@ -230,7 +230,7 @@ </data> <key>www/css/products.css</key> <data> - SXRuqV2NmKVKCeNwd7FF1tkA4/8= + i+K2W+RxK1uySUdaychd3szaRfg= </data> <key>www/css/vendor/flickity.css</key> <data> @@ -242,7 +242,7 @@ </data> <key>www/db.json</key> <data> - 5bTB9V2YtoA5QVMvp5Cu/kOlwvc= + nCdTRhbwbIPXuxkUG7gUGdg9KpQ= </data> <key>www/img/Resources/CDVNotification.bundle/beep.wav</key> <data> @@ -350,11 +350,11 @@ </data> <key>www/index.html</key> <data> - N6Ei61hN+athrqTf75/rhgH6zL0= + j+k8ujaqcnpJuX/czMBrEaZz8jk= </data> <key>www/js/index.js</key> <data> - /cmUIeMQ3DDaWZ5QbC3eB3ckBM4= + HKZPM32zArXyA4bnl5aP8A4JVic= </data> <key>www/js/lib/_router.js</key> <data> @@ -402,7 +402,7 @@ </data> <key>www/js/lib/blogs/ArchiveView.js</key> <data> - wHoTh7iyP/3X6Q6v2D07aS6+t30= + hy7Nn4x1dubd+m3LsLuwDpieX8I= </data> <key>www/js/lib/blogs/BlogView.js</key> <data> @@ -410,7 +410,7 @@ </data> <key>www/js/lib/blogs/HubView.js</key> <data> - YyQmezakSQTIXkBa75zrel7aReI= + y1ppo+9KlLX9tA/tyccz1eBydP4= </data> <key>www/js/lib/blogs/PageView.js</key> <data> @@ -450,7 +450,7 @@ </data> <key>www/js/lib/etc/accessibility.js</key> <data> - yTRyqtg1FGVi7NAS5ofPpYeCMJY= + WADhuojQGHPJ5xCqJ0lp+/1uIuM= </data> <key>www/js/lib/etc/backup_db.js</key> <data> @@ -490,7 +490,7 @@ </data> <key>www/js/lib/nav/FooterView.js</key> <data> - WaOKgFizQ3W8RPEhwga57tf3sLM= + ZZj8fj+7470dumQaosbq7OiXAx0= </data> <key>www/js/lib/nav/HeaderView.js</key> <data> @@ -518,11 +518,11 @@ </data> <key>www/js/lib/products/GalleryView.js</key> <data> - PlTNRrOKZ/pThjhfJGIhPyF0vF8= + 2uKZw/R68RVKeU/Dm93O7bC9IeA= </data> <key>www/js/lib/products/ProductView.js</key> <data> - nhowdeurib4AiVHGpPeQXHuVAZY= + NJ28uOLdIXAcLOstCEyyoSFwMFQ= </data> <key>www/js/lib/products/Selector.js</key> <data> @@ -642,7 +642,7 @@ </data> <key>www/js/vendor/util.js</key> <data> - cSu4UPfMDruX6UfHaF7e81XCbK8= + ItYn9dXlQ80otg0lHvs5ktBK08U= </data> <key>www/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js</key> <data> @@ -965,22 +965,22 @@ <dict> <key>hash</key> <data> - VH1h9C+NzgBCZrqAmWhSs/dbGmc= + Kwar1Lpeq1PSL1k9Htg3b88BLOU= </data> <key>hash2</key> <data> - syXWjwlVt8IaDz5J253dVsKDU5HNG1WcrNk5N19teV0= + 1qoqioWSqyyQKmIJUeXxYG0vy0CiJcQlNNJ/lH/i1rg= </data> </dict> <key>CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key> <dict> <key>hash</key> <data> - tmw9rPRh0FHxDYK8d+XNTVAW8lE= + EZSKMENet04qnojPKjTy87Ck+kU= </data> <key>hash2</key> <data> - pXxOQQe+v2mY83410YsYODdWMR+Yg374OWv3U1WHVZ0= + D0At/LS/sZbaIClfPU3oVFtY9eY8EnlLe+2eOFFjCvQ= </data> </dict> <key>CDVLaunchScreen.storyboardc/Info.plist</key> @@ -998,11 +998,11 @@ <dict> <key>hash</key> <data> - GjQfqLxJ+zEF5K8ZynCdnGblEbo= + FjF8wMpbNRaWuLABS8u/DSNBgAQ= </data> <key>hash2</key> <data> - MDgen06oOcviHQVZDZNatF0/FamLu5exeNdKdCrUKiI= + FMfkQ1dI7KF4iEbm8hVdz7VI04npLUC8Tb5CFhcI7Ww= </data> </dict> <key>CDVNotification.bundle/beep.wav</key> @@ -1020,33 +1020,33 @@ <dict> <key>hash</key> <data> - YSGSdofDJzUxj+jdvDecPcpDO78= + KTqOI00Es51zeiXqiLVhUoSBkik= </data> <key>hash2</key> <data> - QNR2oSKBv86+uT/QGNHXOLY6O9Mywi/jh3ep5+L6GXY= + lxNz93e2ckI7aZ2hWhw5PepZH8v6Z3XYr0+KYG+PaKA= </data> </dict> <key>config.xml</key> <dict> <key>hash</key> <data> - PqlLBIYAkd+4vr1/1jZQAJj8J7k= + fz52wQVVOwlkB35iTIUIMBC2dhA= </data> <key>hash2</key> <data> - 0yKwA1oQBBEAO2OxvUMfrkQW9+/VMI20K8Vli4WtY6s= + i6++/3MmPSGLm1VRuP6gfk6oRwhSCR8KGgWIkERgWkk= </data> </dict> <key>embedded.mobileprovision</key> <dict> <key>hash</key> <data> - l8wkj9UX5I2v1dBJQvQf/lTQiew= + gendZ7kyekdN6egm653Da4aRvrk= </data> <key>hash2</key> <data> - EkGKDjJhII43Qn+PEmfD7sVHEiZWrPJeyGj1aKMzEco= + UATtk+TXKOk5NZIU0r2QInKazo541PfMgFR/PIEBW30= </data> </dict> <key>www/cordova-js-src/exec.js</key> @@ -1130,11 +1130,11 @@ <dict> <key>hash</key> <data> - SLcjU48OnlqOEA9Xii5RYPNFNDI= + 09ZjZlLNOQw7OoxGbKdCihckd6E= </data> <key>hash2</key> <data> - FSpvLts90M8yXzYK/pL6k8i55r9l1EyamPeym+AAj2M= + CtzlzhHemv5DQFCm5AUcXoTejGOsn0ds+n3TVlp03Uo= </data> </dict> <key>www/css/cart.css</key> @@ -1317,11 +1317,11 @@ <dict> <key>hash</key> <data> - SXRuqV2NmKVKCeNwd7FF1tkA4/8= + i+K2W+RxK1uySUdaychd3szaRfg= </data> <key>hash2</key> <data> - R3OfPGRgptd3/0+r7zNs1A8PRvPZni6SDEA6W+kBcNE= + OJaHx68V8yCFPBzyM0D0aDZt+/+SjM2bIwjyVskN2ZM= </data> </dict> <key>www/css/vendor/flickity.css</key> @@ -1350,11 +1350,11 @@ <dict> <key>hash</key> <data> - 5bTB9V2YtoA5QVMvp5Cu/kOlwvc= + nCdTRhbwbIPXuxkUG7gUGdg9KpQ= </data> <key>hash2</key> <data> - 7Jr5PoZ94tA1GbWwhhqOKNeoptZoFGI16ifArD1xwq4= + z0MlhI2VCJklAb9mV7jh0UxxJ93HJtT75ViawEj6P+M= </data> </dict> <key>www/img/Resources/CDVNotification.bundle/beep.wav</key> @@ -1647,22 +1647,22 @@ <dict> <key>hash</key> <data> - N6Ei61hN+athrqTf75/rhgH6zL0= + j+k8ujaqcnpJuX/czMBrEaZz8jk= </data> <key>hash2</key> <data> - kY+ifVuBRKlbir0XnojOAeKdKZwBn/yObsDd8y8Ni6s= + 1hNa7gFvckraIa19E+Kc/1nCVUYOC10ddnGAiuUBMSM= </data> </dict> <key>www/js/index.js</key> <dict> <key>hash</key> <data> - /cmUIeMQ3DDaWZ5QbC3eB3ckBM4= + HKZPM32zArXyA4bnl5aP8A4JVic= </data> <key>hash2</key> <data> - iUhVw8Cpra+wD4XsWsUMco/S7cRxepGqomKSW/zHl64= + 2EgjPLSSAqC1As/Z/Rl2nznPFvvwC5Wki10jbIXs9l0= </data> </dict> <key>www/js/lib/_router.js</key> @@ -1790,11 +1790,11 @@ <dict> <key>hash</key> <data> - wHoTh7iyP/3X6Q6v2D07aS6+t30= + hy7Nn4x1dubd+m3LsLuwDpieX8I= </data> <key>hash2</key> <data> - RfpM20RknSwCAY7zbPDEpkIquL3NtjBXWU6wfcdbO5M= + LiJLs5Tio977c4D6P4Co/3c6ywImOTKuwpLgY+hbyeo= </data> </dict> <key>www/js/lib/blogs/BlogView.js</key> @@ -1812,11 +1812,11 @@ <dict> <key>hash</key> <data> - YyQmezakSQTIXkBa75zrel7aReI= + y1ppo+9KlLX9tA/tyccz1eBydP4= </data> <key>hash2</key> <data> - 39fN9c2QR7jtUZumNck3TTD3M86AnscxwuG6QdcRS0E= + 08zv3aMQTQkctFQ7maI6vlZdUT8qgH8pujNzvkN57x4= </data> </dict> <key>www/js/lib/blogs/PageView.js</key> @@ -1922,11 +1922,11 @@ <dict> <key>hash</key> <data> - yTRyqtg1FGVi7NAS5ofPpYeCMJY= + WADhuojQGHPJ5xCqJ0lp+/1uIuM= </data> <key>hash2</key> <data> - EpWdVbZkiGtY+imrqtGRtv2WZeL0CRTx2C4/WFF9NzQ= + Fjrwlrpwi5rt9Q6pvyftkCx9VA7KHuLHsolN4xNsu4g= </data> </dict> <key>www/js/lib/etc/backup_db.js</key> @@ -2032,11 +2032,11 @@ <dict> <key>hash</key> <data> - WaOKgFizQ3W8RPEhwga57tf3sLM= + ZZj8fj+7470dumQaosbq7OiXAx0= </data> <key>hash2</key> <data> - Z2+GeBAj/oHQ6m3AxNvY8tIeLbh2Kv4ScrteiHlFdm8= + QERCwKdicHOKF6qcwAE70vS0H2PNTosnWt9mvhQb2Wo= </data> </dict> <key>www/js/lib/nav/HeaderView.js</key> @@ -2109,22 +2109,22 @@ <dict> <key>hash</key> <data> - PlTNRrOKZ/pThjhfJGIhPyF0vF8= + 2uKZw/R68RVKeU/Dm93O7bC9IeA= </data> <key>hash2</key> <data> - GGDqzbrlfnfziT6ikQX/loU9bpQ6vZap1bCH/cx0Nr0= + 3NKeKuDQh7LTme/6eCnTyrieaCAOHUwtwWz+wCAipjE= </data> </dict> <key>www/js/lib/products/ProductView.js</key> <dict> <key>hash</key> <data> - nhowdeurib4AiVHGpPeQXHuVAZY= + NJ28uOLdIXAcLOstCEyyoSFwMFQ= </data> <key>hash2</key> <data> - yo3bWl6j6z/M2xwX0QMeOlgX59TZdiWTiFPcUn2CEsA= + Agl/HX2pNASS06k4rf2MyePibkjt4WQaTJVomYm9yLg= </data> </dict> <key>www/js/lib/products/Selector.js</key> @@ -2450,11 +2450,11 @@ <dict> <key>hash</key> <data> - cSu4UPfMDruX6UfHaF7e81XCbK8= + ItYn9dXlQ80otg0lHvs5ktBK08U= </data> <key>hash2</key> <data> - imFkJySBUiXdVgDM/cv/YIcz6CCVK8TSP5TPXrEYi2M= + 80zGuEkMLKirI91e1Rqma5g/KI0A1JZOIWVeDqOMhZ0= </data> </dict> <key>www/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.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 727ea16c..4368e5b6 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="6123" id="us.okfoc.stoneisland" version="1.2.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-versionCode="6124" id="us.okfoc.stoneisland" version="1.2.4" 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/embedded.mobileprovision b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/embedded.mobileprovision Binary files differindex 7ec4c547..1a7c33da 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/embedded.mobileprovision +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/embedded.mobileprovision diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/blogs.css b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/blogs.css index f857db9e..c4b74c19 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/blogs.css +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/blogs.css @@ -186,6 +186,9 @@ height:100px; box-sizing:border-box } +.vscroll .fade-cover { + display: none; +} /* .fade-cover::before { @@ -264,6 +267,13 @@ ul.links { transform-origin: 50% 50%; transform: translateZ(0) translateX(-50%) translateY(-50%); } +#archive .menu { + position: fixed; + display: none; +} +#archive.menu .menu { + display: block; +} .accessible #archive .row .image, .accessible #archive .row .text { @@ -353,6 +363,16 @@ ul.links { width: 90%; } +.gallery-target { + display: none; +} +.accessible .gallery-target { + display: block; + position: absolute; + top: 0; left: 0; + width: 100vw; + height: 52vh; +} .gallery-video-post { position:relative; } 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 63e9b020..e15e0e54 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 @@ -55,6 +55,7 @@ } .gallery .item { + display: block; width: 100vw; height: 52vh; background-size: contain; @@ -93,6 +94,11 @@ text-align: center; width: 100%; } +#closed .closed_target { + position: absolute; + top: 0; left: 0; + width: 100%; height: 100%; +} .product .content { box-sizing:border-box; @@ -160,19 +166,31 @@ display: flex; flex-direction: row; } -.product .size-color span { - position:relative; - box-sizing:border-box; - padding: 0 12px; +.product .size-color > div { + position: relative; + box-sizing: border-box; height: 48px; font-size: 1rem; display: flex; justify-content: center; align-items: center; } -.product .size-color span.size { +.product .size-color > div > div.label { + padding: 0 12px; + max-width: 6rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.product .size-color div.size { border-right: 1px solid #444; } +.product .size-color > div > select { + position: absolute; + top: 0; left: 0; + width: 100%; height: 100%; + opacity: 0; +} .product .price { display:table-cell; diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/db.json b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/db.json index 8b9d322c..7bffd341 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/db.json +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/db.json @@ -4838,7 +4838,7 @@ "Departments": [ { "text": "Test", - "uri": "ctsjckts" + "uri": "PPPRVWFWSC1" } ], "StoreStatus": "closed", 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 eaae059a..a422832c 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 @@ -138,10 +138,11 @@ <script type="text/html" class="template"> <div class="hub_item" data-id="{{id}}"> <div class="gallery gallery-{{id}}" role="carousel"></div> + <div role="button" class="gallery-target gallery-target-{{id}}"></div> <div role="button" aria-label='Scroll gallery to the left' class="gallery-left"></div> <div role="button" aria-label='Scroll gallery to the right' class="gallery-right"></div> <div role="heading" class="content-header"> - <div role="button" class="content-share"> + <div role="button" class="content-share" aria-label="Share this post"> SHARE + </div> <span role="heading" aria-details="{{cleantitle}}" class="title">{{title}}</span> @@ -166,7 +167,7 @@ <div class="content"> <script type="text/html" class="template"> - <div class="image" style="background-image:url({{image}})"></div> + <div class="image" aria-label="{{label}}" style="background-image:url({{image}})"></div> <div class="text"> <h2> <b>{{code}}</b><br> @@ -312,6 +313,7 @@ <div role="link" class="item" aria-label="{{alt}}" style="background-image:url({{image}})"></div> </script> </div> + <div role="button" class="gallery-target"></div> <div role="button" class="gallery-left" aria-label="Scroll gallery left"></div> <div role="button" class="gallery-right" aria-label="Scroll gallery right"></div> <div class="content"> @@ -325,11 +327,17 @@ <div class="style-share"> <span class="style"> <div class="size-color"> - <span role="button" class="size" aria-label="Tap to select size. Current size"></span> - <span role="button" class="color" aria-label="Tap to select color. Current color"></span> + <div role="button" class="size" aria-label="Tap to select size. Current size"> + <div class="label"></div> + <select name="size"></select> + </div> + <div role="button" class="color" aria-label="Tap to select color. Current color"> + <div class="label"></div> + <select name="color"></select> + </div> </div> </span> - <span role="button" class="share">SHARE +</span> + <span role="button" class="share" aria-label="Share this product">SHARE +</span> </div> <div class="fit">Fits Large</div> <div class='fitHeader'></div> @@ -346,15 +354,16 @@ </div> <div id="closed" role="region" aria-label="The store is closed"> + <div class="closed_target" role="button" aria-label="The store is closed. Placeholder image of a Stone Island model wearing a jacket."></div> <div class="closed_store_msg"> <h3> LOADING THE STORE, PLEASE WAIT </h3> <h4> </h4> - <div role="link" class="website_link"> + <div role="link" class="website_link" aria-label='Visit w w w dot stone island dot com'> visit<br> - <b aria-label='w w w dot stone island dot com'>www.stoneisland.com</b> + <b role='link' aria-label='w w w dot stone island dot com'>www.stoneisland.com</b> </div> </div> </div> @@ -1359,8 +1368,8 @@ <script src="js/lib/blogs/BlogView.js"></script> <script src="js/lib/blogs/ArchiveView.js"></script> <script src="js/lib/blogs/HubView.js"></script> -<script src="js/lib/blogs/PageView.js"></script> <script src="js/lib/blogs/StoryView.js"></script> +<script src="js/lib/blogs/PageView.js"></script> <script src="js/lib/_router.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 b90f74b1..42cec6f1 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 @@ -12,26 +12,11 @@ var app = (function(){ sdk.init({ env: "production" }) } - accessibility.init(app.prebuild) // check if we can do native scrolling before build - } - - app.prebuild = function(){ - app.bind() - app.build() - - app.iscroll_options = { - mouseWheel: true, - scrollbars: true, - disablePointer: is_android ? true : false, // important to disable the pointer events that causes the issues - disableTouch: false, // false if you want the slider to be usable with touch devices - disableMouse: false // false if you want the slider to be usable with a mouse (desktop) - } - if (window.cordova) { - document.addEventListener('deviceready', app.ready, false) + document.addEventListener('deviceready', app.device_ready, false) } else { - app.ready() + app.device_ready() } } @@ -77,8 +62,24 @@ var app = (function(){ app.selector = new Selector () } + app.device_ready = function(){ + accessibility.init(app.ready) // check if we can do native scrolling before build + } + app.ready = function(){ console.log(">> READY") + + app.bind() + app.build() + + app.iscroll_options = { + mouseWheel: true, + scrollbars: true, + disablePointer: is_android ? true : false, // important to disable the pointer events that causes the issues + disableTouch: false, // false if you want the slider to be usable with touch devices + disableMouse: false // false if you want the slider to be usable with a mouse (desktop) + } + if (window.cordova) { document.addEventListener('pause', app.paused, false) document.addEventListener('resume', app.resumed, false) diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/ArchiveView.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/ArchiveView.js index f10f7744..92427b6f 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/ArchiveView.js @@ -58,10 +58,9 @@ var ArchiveView = ScrollableView.extend({ // id title images[ uri label code caption ] this.data.forEach(function(row, index){ - var t = this.menu_template.replace(/{{title}}/, row.title) var $t = $(t) - $t.data("aria-label", stonewash(row.title.replace(/'/g, " '").trim())) + $t.data("aria-label", stonewash(row.title.replace(/'0/g, " 20").replace(/'9/g, " 19").trim())) $t.data("title", row.title) $t.data("index", index) this.$menu_items.append($t) @@ -86,7 +85,7 @@ var ArchiveView = ScrollableView.extend({ var $t = $("<div>") $t.addClass("row").addClass("loading") var t = this.row_template.replace(/{{image}}/, cell.uri) - .replace(/{{label}}/, cell.label) + .replace(/{{label}}/g, cell.label) .replace(/{{code}}/, cell.code) .replace(/{{caption}}/, cell.caption) $t.html(t) 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 a0ee9dd0..d3b15f77 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 @@ -94,10 +94,18 @@ var HubView = ScrollableView.extend({ app.fullscreenViewer.show(url, url) }) $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Image gallery, use the arrows to scroll.") + if (accessibility.voiceOver) { + $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Image gallery, use the arrows to scroll.") + $(".gallery-target-" + row.id).click(function(e){ + e && e.preventDefault() + var url = gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + app.fullscreenViewer.show(url, url) + }) + } } else { // single image - var el = document.createElement("div") + var el = document.createElement(accessibility.voiceOver ? "a" : "div") if (row.image && row.image.length) { el.style.backgroundImage = "url(" + row.image[0].uri + ")" } @@ -112,16 +120,28 @@ var HubView = ScrollableView.extend({ $(".gallery-" + row.id).addClass("gallery-video-post") $(".gallery-" + row.id).attr('role', 'link') $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Tap to watch the video on Youtube") + // $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Tap to watch the video on Youtube") if (! row.image) { var url = row.link var ytid = (url.match(/v=([-_a-zA-Z0-9]{11})/i) || url.match(/youtu.be\/([-_a-zA-Z0-9]{11})/i) || url.match(/embed\/([-_a-zA-Z0-9]{11})/i))[1].split('&')[0]; e.style.backgroundImage = "url(https://i.ytimg.com/vi/" + ytid + "/maxresdefault.jpg" } + // $(".gallery-target-" + row.id).click(function(e){ + // e && e.preventDefault() + // window.open(row.link, '_system') + // }) + $(".gallery-target-" + row.id).remove() } else { - $(el).click(function(){ + $(el).click(function(e){ + e && e.preventDefault() app.fullscreenViewer.show(row.image[0].uri) }) $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Main image") + $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Main image.") + $(".gallery-target-" + row.id).click(function(e){ + e && e.preventDefault() + app.fullscreenViewer.show(row.image[0].uri) + }) } $t.find(".gallery-left").remove() $t.find(".gallery-right").remove() diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/accessibility.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/accessibility.js index 8108e461..31ddaf23 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/accessibility.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/accessibility.js @@ -17,8 +17,10 @@ var accessibility = (function() { return ready() } if ('MobileAccessibility' in window) { + console.log('init accessibility') accessibility.build(ready) } else { + console.log('MobileAccessibility not found') ready() } } diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/FooterView.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/FooterView.js index 8641668f..855c37bd 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/FooterView.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/FooterView.js @@ -17,12 +17,14 @@ var FooterView = View.extend({ if (cancel) { this.$ok.removeClass("wide") this.$cancel.show().html(cancel) + this.$cancel.attr('aria-label', cancel.toLowerCase()) } else { this.$ok.addClass("wide") this.$cancel.hide() } this.$ok.html(ok) + this.$ok.attr('aria-label', ok.toLowerCase()) this.$el.show() }, diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/GalleryView.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/GalleryView.js index d6f5723c..e84caa68 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/GalleryView.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/GalleryView.js @@ -58,19 +58,40 @@ var GalleryView = View.extend({ draggable: true, }) - this.gallery.on('staticClick', function(e){ - var currentImage = gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + this.gallery.on('change', function(){ + var currentImage = this.gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") var partz = currentImage.split("_") var head = partz[0] var size = partz[1] var tail = partz[2] var end_partz = tail.split(/\./) var style = end_partz[0] - var largest_size = large_styles[style] - var hiresImage = [head, largest_size, tail].join("_") - app.fullscreenViewer.show(currentImage, hiresImage) + var label = YOOX_IMAGE_STYLE_LABELS[style] || "Image: Alternate view" + $("#product .gallery-target").attr('aria-label', label) }) + + this.gallery.on('staticClick', this.static_click.bind(this)) + + if (accessibility.voiceOver) { + $("#product .gallery-target").click(this.static_click.bind(this)) + $("#product .gallery-target").attr('aria-label', "Image: Front view") + } else { + $("#product .gallery-target").remove() + } }, + static_click: function(e){ + var currentImage = this.gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + var partz = currentImage.split("_") + var head = partz[0] + var size = partz[1] + var tail = partz[2] + var end_partz = tail.split(/\./) + var style = end_partz[0] + var largest_size = large_styles[style] + var hiresImage = [head, largest_size, tail].join("_") + app.fullscreenViewer.show(currentImage, hiresImage) + }, + touchstart: function(e){ }, touchmove: function(e){ @@ -82,7 +103,7 @@ var GalleryView = View.extend({ var YOOX_IMAGE_STYLE_ORDER = "ZZZ f r d e a b c g l".split(" ") var YOOX_IMAGE_STYLE_LABELS = { - f: 'Front view', - r: 'Rear view', + f: 'Image: Front view', + r: 'Image: Rear view', } function sort_image_styles (b,a){ return (YOOX_IMAGE_STYLE_ORDER.indexOf(b)) - (YOOX_IMAGE_STYLE_ORDER.indexOf(a)) }
\ No newline at end of file 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 62a6de18..f834b1c5 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 @@ -1,4 +1,3 @@ - var ProductView = ScrollableView.extend({ el: "#product", @@ -6,8 +5,10 @@ var ProductView = ScrollableView.extend({ events: { "click .fit": "scroll_to_bottom", "click .notAvailableInCanada": "scroll_to_bottom", - "click .size": "select_size", - "click .color": "select_color", + "change select[name=size]": "select_size", + "change select[name=color]": "select_color", + // "click .size": "select_size", + // "click .color": "select_color", "click .share": "share", "click .gallery-left": "gallery_left", "click .gallery-right": "gallery_right", @@ -22,8 +23,12 @@ var ProductView = ScrollableView.extend({ this.$type = this.$(".type") this.$price = this.$(".price") this.$size = this.$(".size") - this.$share = this.$(".share") + this.$sizeSelect = this.$(".size select") + this.$sizeLabel = this.$(".size .label") this.$color = this.$(".color") + this.$colorSelect = this.$(".color select") + this.$colorLabel = this.$(".color .label") + this.$share = this.$(".share") this.$body = this.$(".body") this.$fit = this.$(".fit") this.$fitHeader = this.$('.fitHeader') @@ -123,7 +128,7 @@ var ProductView = ScrollableView.extend({ var descriptions = this.get_descriptions(details) - var title = data['ModelNames'] + var title = data['ModelNames'] || "" var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" var details_description = descriptions['Details'] || "" @@ -132,7 +137,7 @@ var ProductView = ScrollableView.extend({ // body = body.replace(/<br>/g, "<br><br>").replace(/(<br>)+$/, "") var default_color_id = this.populate_selectors(data, details) - + var notAvailableInCanada = !! app.store.NotAvailableInCanada app.product.$notAvailableInCanada.toggle( notAvailableInCanada ) @@ -166,14 +171,8 @@ var ProductView = ScrollableView.extend({ this.size = size this.is_onesize = !! this.sizes[1] - - this.$size.show().html(size_label) - if (color_label) { - this.$color.html(color_label) - } - else { - this.$color.hide() - } + this.set_size_label(size_label) + this.set_color_label(color_label) } // console.log(color, color_label, size, size_label) @@ -233,6 +232,9 @@ var ProductView = ScrollableView.extend({ this.$sizing.hide() } + this.populate_sizes() + this.populate_colors() + this.deferScrollToTop() }, @@ -314,37 +316,74 @@ var ProductView = ScrollableView.extend({ return default_color }, - select_size: function(){ + populate_sizes: function() { + console.log(this.sold_out, this.notAvailable, this.is_onesize, this.item) if (this.sold_out) { return } if (this.notAvailable) { return } - if (this.is_onesize) { return this.select_color() } - if (this.item['Sizes'].length == 0) { return } - var sizes = Object.keys(this.sizes).map(function(key){ - return this.sizes[key] - }.bind(this)) - - app.selector.select("style", sizes, function(size){ - console.log(size) - this.size = size.value - this.$size.html(size.label) + // if (this.is_onesize) { return this.select_color() } + if (this.details['ModelSizes'].length == 0) { return } + + this.$sizeSelect.empty() + var sizes = Object.keys(this.sizes).forEach(function(key){ + var size = this.sizes[key] + var option = document.createElement('option') + option.value = size.value + option.innerHTML = size.label + this.$sizeSelect.append(option) }.bind(this)) }, - - select_color: function(){ + + populate_colors: function() { if (this.sold_out) { return } if (this.notAvailable) { return } - if (this.item['Colors'].length == 0) { return } - var colors = Object.keys(this.colors).map(function(key){ - return this.colors[key] - }.bind(this)) - app.selector.select("style", colors, function(color){ - this.code = color.code - this.$color.html(color.label) - this.gallery.populate( color.code, this.details['ImageTypes'] ) - this.gallery_right() + if (this.details['ModelColors'].length == 0) { return } + + this.$colorSelect.empty() + Object.keys(this.colors).forEach(function(key){ + var color = this.colors[key] + var option = document.createElement('option') + option.value = key + option.innerHTML = color.label + this.$colorSelect.append(option) }.bind(this)) }, + select_size: function(){ + console.log(this.colors) + var value = this.$sizeSelect.val() + var size = this.sizes[value] + console.log(size) + this.set_size_label(size.label) + this.size = size.value + }, + + select_color: function(){ + var value = this.$colorSelect.val() + var color = this.colors[value] + console.log(color) + this.code = color.code + this.set_color_label(color.label) + this.gallery.populate( color.code, this.details['ImageTypes'] ) + this.gallery_right() + }, + + set_size_label: function(size_label){ + this.$size.show() + this.$sizeLabel.html(size_label) + this.$size.attr('aria-label', 'Tap to select size. Current size: ' + size_label) + }, + + set_color_label: function(color_label){ + if (color_label) { + this.$color.show() + this.$colorLabel.html(color_label) + this.$color.attr('aria-label', 'Tap to select color. Current color: ' + color_label) + } + else { + this.$color.hide() + } + }, + // ADD TO CART save: function(){ if (this.sold_out) { return } diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/util.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/util.js index 27bdf008..c44dda79 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/util.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/util.js @@ -25,7 +25,7 @@ function hex_string (rgb) { return "#" + rgb.map(Math.round).map(function(n){ va function parse_rgba_string (s) { return s.match(/(\d+)/g).slice(0,3) } function title_case (str) { - return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); + return (str || "").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); } function pluralize (n,s,ss) { return n + " " + s + ( n == 1 ? "" : (ss || "s") ) } function as_cash(n){ diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist index 4dadab85..605e51b3 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -12,7 +12,7 @@ <key>Stone Island.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> - <integer>2</integer> + <integer>3</integer> </dict> </dict> </dict> 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 2156bf4f..d4c3c9bd 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/Stone Island/Stone Island-Info.plist b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist index 2f55165d..aa7b8366 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 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>1.2.3</string> + <string>1.2.4</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleURLTypes</key> @@ -34,7 +34,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>1.2.3</string> + <string>1.2.4</string> <key>GCM_SENDER_ID</key> <string>85075801930</string> <key>IS_GCM_ENABLED</key> diff --git a/StoneIsland/platforms/ios/Stone Island/config.xml b/StoneIsland/platforms/ios/Stone Island/config.xml index 727ea16c..4368e5b6 100755 --- a/StoneIsland/platforms/ios/Stone Island/config.xml +++ b/StoneIsland/platforms/ios/Stone Island/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-versionCode="6123" id="us.okfoc.stoneisland" version="1.2.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-versionCode="6124" id="us.okfoc.stoneisland" version="1.2.4" 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/ios.json b/StoneIsland/platforms/ios/ios.json index 037d3c69..13984298 100644 --- a/StoneIsland/platforms/ios/ios.json +++ b/StoneIsland/platforms/ios/ios.json @@ -356,4 +356,4 @@ "cordova-plugin-sim": "1.3.3", "phonegap-plugin-mobile-accessibility": "1.0.5-dev" } -} +}
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/css/blogs.css b/StoneIsland/platforms/ios/www/css/blogs.css index f857db9e..c4b74c19 100755 --- a/StoneIsland/platforms/ios/www/css/blogs.css +++ b/StoneIsland/platforms/ios/www/css/blogs.css @@ -186,6 +186,9 @@ height:100px; box-sizing:border-box } +.vscroll .fade-cover { + display: none; +} /* .fade-cover::before { @@ -264,6 +267,13 @@ ul.links { transform-origin: 50% 50%; transform: translateZ(0) translateX(-50%) translateY(-50%); } +#archive .menu { + position: fixed; + display: none; +} +#archive.menu .menu { + display: block; +} .accessible #archive .row .image, .accessible #archive .row .text { @@ -353,6 +363,16 @@ ul.links { width: 90%; } +.gallery-target { + display: none; +} +.accessible .gallery-target { + display: block; + position: absolute; + top: 0; left: 0; + width: 100vw; + height: 52vh; +} .gallery-video-post { position:relative; } diff --git a/StoneIsland/platforms/ios/www/css/products.css b/StoneIsland/platforms/ios/www/css/products.css index 63e9b020..e15e0e54 100755 --- a/StoneIsland/platforms/ios/www/css/products.css +++ b/StoneIsland/platforms/ios/www/css/products.css @@ -55,6 +55,7 @@ } .gallery .item { + display: block; width: 100vw; height: 52vh; background-size: contain; @@ -93,6 +94,11 @@ text-align: center; width: 100%; } +#closed .closed_target { + position: absolute; + top: 0; left: 0; + width: 100%; height: 100%; +} .product .content { box-sizing:border-box; @@ -160,19 +166,31 @@ display: flex; flex-direction: row; } -.product .size-color span { - position:relative; - box-sizing:border-box; - padding: 0 12px; +.product .size-color > div { + position: relative; + box-sizing: border-box; height: 48px; font-size: 1rem; display: flex; justify-content: center; align-items: center; } -.product .size-color span.size { +.product .size-color > div > div.label { + padding: 0 12px; + max-width: 6rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.product .size-color div.size { border-right: 1px solid #444; } +.product .size-color > div > select { + position: absolute; + top: 0; left: 0; + width: 100%; height: 100%; + opacity: 0; +} .product .price { display:table-cell; diff --git a/StoneIsland/platforms/ios/www/db.json b/StoneIsland/platforms/ios/www/db.json index 8b9d322c..7bffd341 100644 --- a/StoneIsland/platforms/ios/www/db.json +++ b/StoneIsland/platforms/ios/www/db.json @@ -4838,7 +4838,7 @@ "Departments": [ { "text": "Test", - "uri": "ctsjckts" + "uri": "PPPRVWFWSC1" } ], "StoreStatus": "closed", diff --git a/StoneIsland/platforms/ios/www/index.html b/StoneIsland/platforms/ios/www/index.html index eaae059a..a422832c 100755 --- a/StoneIsland/platforms/ios/www/index.html +++ b/StoneIsland/platforms/ios/www/index.html @@ -138,10 +138,11 @@ <script type="text/html" class="template"> <div class="hub_item" data-id="{{id}}"> <div class="gallery gallery-{{id}}" role="carousel"></div> + <div role="button" class="gallery-target gallery-target-{{id}}"></div> <div role="button" aria-label='Scroll gallery to the left' class="gallery-left"></div> <div role="button" aria-label='Scroll gallery to the right' class="gallery-right"></div> <div role="heading" class="content-header"> - <div role="button" class="content-share"> + <div role="button" class="content-share" aria-label="Share this post"> SHARE + </div> <span role="heading" aria-details="{{cleantitle}}" class="title">{{title}}</span> @@ -166,7 +167,7 @@ <div class="content"> <script type="text/html" class="template"> - <div class="image" style="background-image:url({{image}})"></div> + <div class="image" aria-label="{{label}}" style="background-image:url({{image}})"></div> <div class="text"> <h2> <b>{{code}}</b><br> @@ -312,6 +313,7 @@ <div role="link" class="item" aria-label="{{alt}}" style="background-image:url({{image}})"></div> </script> </div> + <div role="button" class="gallery-target"></div> <div role="button" class="gallery-left" aria-label="Scroll gallery left"></div> <div role="button" class="gallery-right" aria-label="Scroll gallery right"></div> <div class="content"> @@ -325,11 +327,17 @@ <div class="style-share"> <span class="style"> <div class="size-color"> - <span role="button" class="size" aria-label="Tap to select size. Current size"></span> - <span role="button" class="color" aria-label="Tap to select color. Current color"></span> + <div role="button" class="size" aria-label="Tap to select size. Current size"> + <div class="label"></div> + <select name="size"></select> + </div> + <div role="button" class="color" aria-label="Tap to select color. Current color"> + <div class="label"></div> + <select name="color"></select> + </div> </div> </span> - <span role="button" class="share">SHARE +</span> + <span role="button" class="share" aria-label="Share this product">SHARE +</span> </div> <div class="fit">Fits Large</div> <div class='fitHeader'></div> @@ -346,15 +354,16 @@ </div> <div id="closed" role="region" aria-label="The store is closed"> + <div class="closed_target" role="button" aria-label="The store is closed. Placeholder image of a Stone Island model wearing a jacket."></div> <div class="closed_store_msg"> <h3> LOADING THE STORE, PLEASE WAIT </h3> <h4> </h4> - <div role="link" class="website_link"> + <div role="link" class="website_link" aria-label='Visit w w w dot stone island dot com'> visit<br> - <b aria-label='w w w dot stone island dot com'>www.stoneisland.com</b> + <b role='link' aria-label='w w w dot stone island dot com'>www.stoneisland.com</b> </div> </div> </div> @@ -1359,8 +1368,8 @@ <script src="js/lib/blogs/BlogView.js"></script> <script src="js/lib/blogs/ArchiveView.js"></script> <script src="js/lib/blogs/HubView.js"></script> -<script src="js/lib/blogs/PageView.js"></script> <script src="js/lib/blogs/StoryView.js"></script> +<script src="js/lib/blogs/PageView.js"></script> <script src="js/lib/_router.js"></script> diff --git a/StoneIsland/platforms/ios/www/js/index.js b/StoneIsland/platforms/ios/www/js/index.js index b90f74b1..42cec6f1 100755 --- a/StoneIsland/platforms/ios/www/js/index.js +++ b/StoneIsland/platforms/ios/www/js/index.js @@ -12,26 +12,11 @@ var app = (function(){ sdk.init({ env: "production" }) } - accessibility.init(app.prebuild) // check if we can do native scrolling before build - } - - app.prebuild = function(){ - app.bind() - app.build() - - app.iscroll_options = { - mouseWheel: true, - scrollbars: true, - disablePointer: is_android ? true : false, // important to disable the pointer events that causes the issues - disableTouch: false, // false if you want the slider to be usable with touch devices - disableMouse: false // false if you want the slider to be usable with a mouse (desktop) - } - if (window.cordova) { - document.addEventListener('deviceready', app.ready, false) + document.addEventListener('deviceready', app.device_ready, false) } else { - app.ready() + app.device_ready() } } @@ -77,8 +62,24 @@ var app = (function(){ app.selector = new Selector () } + app.device_ready = function(){ + accessibility.init(app.ready) // check if we can do native scrolling before build + } + app.ready = function(){ console.log(">> READY") + + app.bind() + app.build() + + app.iscroll_options = { + mouseWheel: true, + scrollbars: true, + disablePointer: is_android ? true : false, // important to disable the pointer events that causes the issues + disableTouch: false, // false if you want the slider to be usable with touch devices + disableMouse: false // false if you want the slider to be usable with a mouse (desktop) + } + if (window.cordova) { document.addEventListener('pause', app.paused, false) document.addEventListener('resume', app.resumed, false) diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js index f10f7744..92427b6f 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js @@ -58,10 +58,9 @@ var ArchiveView = ScrollableView.extend({ // id title images[ uri label code caption ] this.data.forEach(function(row, index){ - var t = this.menu_template.replace(/{{title}}/, row.title) var $t = $(t) - $t.data("aria-label", stonewash(row.title.replace(/'/g, " '").trim())) + $t.data("aria-label", stonewash(row.title.replace(/'0/g, " 20").replace(/'9/g, " 19").trim())) $t.data("title", row.title) $t.data("index", index) this.$menu_items.append($t) @@ -86,7 +85,7 @@ var ArchiveView = ScrollableView.extend({ var $t = $("<div>") $t.addClass("row").addClass("loading") var t = this.row_template.replace(/{{image}}/, cell.uri) - .replace(/{{label}}/, cell.label) + .replace(/{{label}}/g, cell.label) .replace(/{{code}}/, cell.code) .replace(/{{caption}}/, cell.caption) $t.html(t) diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js index a0ee9dd0..d3b15f77 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js @@ -94,10 +94,18 @@ var HubView = ScrollableView.extend({ app.fullscreenViewer.show(url, url) }) $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Image gallery, use the arrows to scroll.") + if (accessibility.voiceOver) { + $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Image gallery, use the arrows to scroll.") + $(".gallery-target-" + row.id).click(function(e){ + e && e.preventDefault() + var url = gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + app.fullscreenViewer.show(url, url) + }) + } } else { // single image - var el = document.createElement("div") + var el = document.createElement(accessibility.voiceOver ? "a" : "div") if (row.image && row.image.length) { el.style.backgroundImage = "url(" + row.image[0].uri + ")" } @@ -112,16 +120,28 @@ var HubView = ScrollableView.extend({ $(".gallery-" + row.id).addClass("gallery-video-post") $(".gallery-" + row.id).attr('role', 'link') $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Tap to watch the video on Youtube") + // $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Tap to watch the video on Youtube") if (! row.image) { var url = row.link var ytid = (url.match(/v=([-_a-zA-Z0-9]{11})/i) || url.match(/youtu.be\/([-_a-zA-Z0-9]{11})/i) || url.match(/embed\/([-_a-zA-Z0-9]{11})/i))[1].split('&')[0]; e.style.backgroundImage = "url(https://i.ytimg.com/vi/" + ytid + "/maxresdefault.jpg" } + // $(".gallery-target-" + row.id).click(function(e){ + // e && e.preventDefault() + // window.open(row.link, '_system') + // }) + $(".gallery-target-" + row.id).remove() } else { - $(el).click(function(){ + $(el).click(function(e){ + e && e.preventDefault() app.fullscreenViewer.show(row.image[0].uri) }) $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Main image") + $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Main image.") + $(".gallery-target-" + row.id).click(function(e){ + e && e.preventDefault() + app.fullscreenViewer.show(row.image[0].uri) + }) } $t.find(".gallery-left").remove() $t.find(".gallery-right").remove() diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/accessibility.js b/StoneIsland/platforms/ios/www/js/lib/etc/accessibility.js index 8108e461..31ddaf23 100644 --- a/StoneIsland/platforms/ios/www/js/lib/etc/accessibility.js +++ b/StoneIsland/platforms/ios/www/js/lib/etc/accessibility.js @@ -17,8 +17,10 @@ var accessibility = (function() { return ready() } if ('MobileAccessibility' in window) { + console.log('init accessibility') accessibility.build(ready) } else { + console.log('MobileAccessibility not found') ready() } } diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js b/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js index 8641668f..855c37bd 100755 --- a/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js +++ b/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js @@ -17,12 +17,14 @@ var FooterView = View.extend({ if (cancel) { this.$ok.removeClass("wide") this.$cancel.show().html(cancel) + this.$cancel.attr('aria-label', cancel.toLowerCase()) } else { this.$ok.addClass("wide") this.$cancel.hide() } this.$ok.html(ok) + this.$ok.attr('aria-label', ok.toLowerCase()) this.$el.show() }, diff --git a/StoneIsland/platforms/ios/www/js/lib/products/GalleryView.js b/StoneIsland/platforms/ios/www/js/lib/products/GalleryView.js index d6f5723c..e84caa68 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/GalleryView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/GalleryView.js @@ -58,19 +58,40 @@ var GalleryView = View.extend({ draggable: true, }) - this.gallery.on('staticClick', function(e){ - var currentImage = gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + this.gallery.on('change', function(){ + var currentImage = this.gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") var partz = currentImage.split("_") var head = partz[0] var size = partz[1] var tail = partz[2] var end_partz = tail.split(/\./) var style = end_partz[0] - var largest_size = large_styles[style] - var hiresImage = [head, largest_size, tail].join("_") - app.fullscreenViewer.show(currentImage, hiresImage) + var label = YOOX_IMAGE_STYLE_LABELS[style] || "Image: Alternate view" + $("#product .gallery-target").attr('aria-label', label) }) + + this.gallery.on('staticClick', this.static_click.bind(this)) + + if (accessibility.voiceOver) { + $("#product .gallery-target").click(this.static_click.bind(this)) + $("#product .gallery-target").attr('aria-label', "Image: Front view") + } else { + $("#product .gallery-target").remove() + } }, + static_click: function(e){ + var currentImage = this.gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"") + var partz = currentImage.split("_") + var head = partz[0] + var size = partz[1] + var tail = partz[2] + var end_partz = tail.split(/\./) + var style = end_partz[0] + var largest_size = large_styles[style] + var hiresImage = [head, largest_size, tail].join("_") + app.fullscreenViewer.show(currentImage, hiresImage) + }, + touchstart: function(e){ }, touchmove: function(e){ @@ -82,7 +103,7 @@ var GalleryView = View.extend({ var YOOX_IMAGE_STYLE_ORDER = "ZZZ f r d e a b c g l".split(" ") var YOOX_IMAGE_STYLE_LABELS = { - f: 'Front view', - r: 'Rear view', + f: 'Image: Front view', + r: 'Image: Rear view', } function sort_image_styles (b,a){ return (YOOX_IMAGE_STYLE_ORDER.indexOf(b)) - (YOOX_IMAGE_STYLE_ORDER.indexOf(a)) }
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js index 62a6de18..f834b1c5 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js @@ -1,4 +1,3 @@ - var ProductView = ScrollableView.extend({ el: "#product", @@ -6,8 +5,10 @@ var ProductView = ScrollableView.extend({ events: { "click .fit": "scroll_to_bottom", "click .notAvailableInCanada": "scroll_to_bottom", - "click .size": "select_size", - "click .color": "select_color", + "change select[name=size]": "select_size", + "change select[name=color]": "select_color", + // "click .size": "select_size", + // "click .color": "select_color", "click .share": "share", "click .gallery-left": "gallery_left", "click .gallery-right": "gallery_right", @@ -22,8 +23,12 @@ var ProductView = ScrollableView.extend({ this.$type = this.$(".type") this.$price = this.$(".price") this.$size = this.$(".size") - this.$share = this.$(".share") + this.$sizeSelect = this.$(".size select") + this.$sizeLabel = this.$(".size .label") this.$color = this.$(".color") + this.$colorSelect = this.$(".color select") + this.$colorLabel = this.$(".color .label") + this.$share = this.$(".share") this.$body = this.$(".body") this.$fit = this.$(".fit") this.$fitHeader = this.$('.fitHeader') @@ -123,7 +128,7 @@ var ProductView = ScrollableView.extend({ var descriptions = this.get_descriptions(details) - var title = data['ModelNames'] + var title = data['ModelNames'] || "" var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" var details_description = descriptions['Details'] || "" @@ -132,7 +137,7 @@ var ProductView = ScrollableView.extend({ // body = body.replace(/<br>/g, "<br><br>").replace(/(<br>)+$/, "") var default_color_id = this.populate_selectors(data, details) - + var notAvailableInCanada = !! app.store.NotAvailableInCanada app.product.$notAvailableInCanada.toggle( notAvailableInCanada ) @@ -166,14 +171,8 @@ var ProductView = ScrollableView.extend({ this.size = size this.is_onesize = !! this.sizes[1] - - this.$size.show().html(size_label) - if (color_label) { - this.$color.html(color_label) - } - else { - this.$color.hide() - } + this.set_size_label(size_label) + this.set_color_label(color_label) } // console.log(color, color_label, size, size_label) @@ -233,6 +232,9 @@ var ProductView = ScrollableView.extend({ this.$sizing.hide() } + this.populate_sizes() + this.populate_colors() + this.deferScrollToTop() }, @@ -314,37 +316,74 @@ var ProductView = ScrollableView.extend({ return default_color }, - select_size: function(){ + populate_sizes: function() { + console.log(this.sold_out, this.notAvailable, this.is_onesize, this.item) if (this.sold_out) { return } if (this.notAvailable) { return } - if (this.is_onesize) { return this.select_color() } - if (this.item['Sizes'].length == 0) { return } - var sizes = Object.keys(this.sizes).map(function(key){ - return this.sizes[key] - }.bind(this)) - - app.selector.select("style", sizes, function(size){ - console.log(size) - this.size = size.value - this.$size.html(size.label) + // if (this.is_onesize) { return this.select_color() } + if (this.details['ModelSizes'].length == 0) { return } + + this.$sizeSelect.empty() + var sizes = Object.keys(this.sizes).forEach(function(key){ + var size = this.sizes[key] + var option = document.createElement('option') + option.value = size.value + option.innerHTML = size.label + this.$sizeSelect.append(option) }.bind(this)) }, - - select_color: function(){ + + populate_colors: function() { if (this.sold_out) { return } if (this.notAvailable) { return } - if (this.item['Colors'].length == 0) { return } - var colors = Object.keys(this.colors).map(function(key){ - return this.colors[key] - }.bind(this)) - app.selector.select("style", colors, function(color){ - this.code = color.code - this.$color.html(color.label) - this.gallery.populate( color.code, this.details['ImageTypes'] ) - this.gallery_right() + if (this.details['ModelColors'].length == 0) { return } + + this.$colorSelect.empty() + Object.keys(this.colors).forEach(function(key){ + var color = this.colors[key] + var option = document.createElement('option') + option.value = key + option.innerHTML = color.label + this.$colorSelect.append(option) }.bind(this)) }, + select_size: function(){ + console.log(this.colors) + var value = this.$sizeSelect.val() + var size = this.sizes[value] + console.log(size) + this.set_size_label(size.label) + this.size = size.value + }, + + select_color: function(){ + var value = this.$colorSelect.val() + var color = this.colors[value] + console.log(color) + this.code = color.code + this.set_color_label(color.label) + this.gallery.populate( color.code, this.details['ImageTypes'] ) + this.gallery_right() + }, + + set_size_label: function(size_label){ + this.$size.show() + this.$sizeLabel.html(size_label) + this.$size.attr('aria-label', 'Tap to select size. Current size: ' + size_label) + }, + + set_color_label: function(color_label){ + if (color_label) { + this.$color.show() + this.$colorLabel.html(color_label) + this.$color.attr('aria-label', 'Tap to select color. Current color: ' + color_label) + } + else { + this.$color.hide() + } + }, + // ADD TO CART save: function(){ if (this.sold_out) { return } diff --git a/StoneIsland/platforms/ios/www/js/vendor/util.js b/StoneIsland/platforms/ios/www/js/vendor/util.js index 27bdf008..c44dda79 100755 --- a/StoneIsland/platforms/ios/www/js/vendor/util.js +++ b/StoneIsland/platforms/ios/www/js/vendor/util.js @@ -25,7 +25,7 @@ function hex_string (rgb) { return "#" + rgb.map(Math.round).map(function(n){ va function parse_rgba_string (s) { return s.match(/(\d+)/g).slice(0,3) } function title_case (str) { - return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); + return (str || "").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); } function pluralize (n,s,ss) { return n + " " + s + ( n == 1 ? "" : (ss || "s") ) } function as_cash(n){ |
