summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js12
1 files changed, 10 insertions, 2 deletions
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 b072a887..c4ebd716 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js
@@ -57,6 +57,8 @@ var HubView = ScrollableView.extend({
.replace(/{{date}}/, moment(row.date).format("MM.DD.YYYY"))
.replace(/{{title}}/, row.title)
.replace(/{{subtitle}}/, row.subtitle)
+ .replace(/{{cleantitle}}/, stonewash(row.title))
+ .replace(/{{cleansubtitle}}/, stonewash(row.subtitle))
.replace(/{{link}}/, row.link)
.replace(/{{body}}/, row.body.replace(/\n/g, "<br>"))
var $t = $(t)
@@ -71,6 +73,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)
})
@@ -107,6 +110,8 @@ var HubView = ScrollableView.extend({
play.className = "play"
$(".gallery-" + row.id).append(play)
$(".gallery-" + row.id).addClass("gallery-video-post")
+ $(".gallery-" + row.id).attr('role', 'link')
+ $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". 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];
@@ -125,6 +130,7 @@ var HubView = ScrollableView.extend({
store_link: function(){
app.router.go("store")
},
+
play_video: function(e){
var row = $(e.currentTarget).closest('.gallery-video-post').data("row")
window.open(row.link, '_system')
@@ -142,7 +148,9 @@ var HubView = ScrollableView.extend({
share: function(e){
var title = $(e.currentTarget).parent().find(".title").text()
console.log("share", title)
- window.plugins.socialsharing.share(title, null, null, "http://deeplink.me/www.stoneisland.com/hub" )
+ if (window.plugins && window.plugins.socialsharing) {
+ window.plugins.socialsharing.share(title, null, null, "http://deeplink.me/www.stoneisland.com/hub" )
+ }
},
})
@@ -169,7 +177,7 @@ var HubLoader = (function(){
if (item.image && item.image.length) {
loader = new Loader (HubLoader.build)
images = item.image.map(function(img){
- return img.uri.replace("http:","https:")
+ return img.uri.replace("http:", "https:")
}).filter(function(img){
return img.uri
})