summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/blogs/HubView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/blogs/HubView.js')
-rwxr-xr-xStoneIsland/www/js/lib/blogs/HubView.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js
index a0ee9dd0..d3b15f77 100755
--- a/StoneIsland/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/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()