diff options
Diffstat (limited to 'StoneIsland/www/js')
| -rwxr-xr-x | StoneIsland/www/js/lib/blogs/HubView.js | 1 | ||||
| -rwxr-xr-x | StoneIsland/www/js/lib/blogs/StoryView.js | 2 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/etc/accessibility.js | 5 | ||||
| -rwxr-xr-x | StoneIsland/www/js/lib/nav/AddressView.js | 2 | ||||
| -rwxr-xr-x | StoneIsland/www/js/lib/products/GalleryView.js | 9 |
5 files changed, 15 insertions, 4 deletions
diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js index b072a887..c12e656f 100755 --- a/StoneIsland/www/js/lib/blogs/HubView.js +++ b/StoneIsland/www/js/lib/blogs/HubView.js @@ -71,6 +71,7 @@ var HubView = ScrollableView.extend({ row.image.forEach(function(img){ var el = document.createElement("div") el.style.backgroundImage = "url(" + img.uri + ")" + el.setAttribute('aria-label', img.caption) el.className = "item" $gallery.append(el) }) diff --git a/StoneIsland/www/js/lib/blogs/StoryView.js b/StoneIsland/www/js/lib/blogs/StoryView.js index 7dcf8cd6..9ba17343 100755 --- a/StoneIsland/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/www/js/lib/blogs/StoryView.js @@ -67,7 +67,7 @@ var StoryView = ScrollableView.extend({ this.$img.stop().fadeTo(110,0.65, function() { $replace.attr("src", section.image.uri) - $replace.attr("alt", section.image.description) + $replace.attr("alt", section.image.caption) }).fadeTo(130,1) } diff --git a/StoneIsland/www/js/lib/etc/accessibility.js b/StoneIsland/www/js/lib/etc/accessibility.js new file mode 100644 index 00000000..5acb0723 --- /dev/null +++ b/StoneIsland/www/js/lib/etc/accessibility.js @@ -0,0 +1,5 @@ +$(function(){ + $("h1").each(function(el){ + $(el).attr('aria-label', "Page title: " + el.innerText) + }) +})
\ No newline at end of file diff --git a/StoneIsland/www/js/lib/nav/AddressView.js b/StoneIsland/www/js/lib/nav/AddressView.js index 6fe8416f..51511204 100755 --- a/StoneIsland/www/js/lib/nav/AddressView.js +++ b/StoneIsland/www/js/lib/nav/AddressView.js @@ -39,7 +39,7 @@ var AddressView = SerializableView.extend({ validate_fields: function(data, errors){ if (this.disabled) { return } if (this.checkPhone) { - var phone_number = data.Phone ? data.Phone.replace(/[^0-9]/g, "").replace(/^[01]+/)) : "" + var phone_number = data.Phone ? data.Phone.replace(/[^0-9]/g, "").replace(/^[01]+/) : "" var phone_length = phone_number.length if (phone_length === 0 || ! data.Phone) { errors.push([ "Phone", "Please enter your phone number." ]) diff --git a/StoneIsland/www/js/lib/products/GalleryView.js b/StoneIsland/www/js/lib/products/GalleryView.js index 0acd48c5..9c012598 100755 --- a/StoneIsland/www/js/lib/products/GalleryView.js +++ b/StoneIsland/www/js/lib/products/GalleryView.js @@ -39,7 +39,9 @@ var GalleryView = View.extend({ Object.keys(valid_styles).sort(sort_image_styles).forEach(function(style){ var id = valid_styles[style] + "_" + style - var t = this.template.replace(/{{image}}/, sdk.image(code, id)) + var t = this.template + .replace(/{{image}}/, sdk.image(code, id)) + .replace(/{{alt}}/, YOOX_IMAGE_STYLE_LABELS[style]) this.$el.append(t) }.bind(this)) @@ -79,5 +81,8 @@ 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', +} 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 |
