summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/blogs
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-10-16 02:22:53 +0200
committerJules Laplace <julescarbon@gmail.com>2019-10-16 02:22:53 +0200
commitc75e4f0b5fc83548e337af6c533036baec8c85c9 (patch)
tree71580d75dfb378951ace4a9dd620f32a0ec42cbb /StoneIsland/platforms/ios/www/js/lib/blogs
parent335e61243d45c4c2eb5d030a8ee5f85c2ddf35f3 (diff)
update
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/blogs')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js5
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/blogs/HubView.js24
2 files changed, 24 insertions, 5 deletions
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()