Created
June 5, 2018 17:27
-
-
Save ChrisHammond/31ae2e279aa03d3b3326f7b91912a7c3 to your computer and use it in GitHub Desktop.
DNN Razor script for Flickr Group Stream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$.getJSON("https://api.flickr.com/services/feeds/groups_pool.gne?jsoncallback=?", | |
{ | |
lang: "en-us", | |
id: "1751534@N22", //CHANGE HERE | |
format: "json" | |
}, displayImages); | |
function displayImages(data) { | |
var htmlString = ""; | |
$.each(data.items, function(i,item){ | |
var sourceSquare = (item.media.m).replace("_m.jpg", "_s.jpg"); | |
var largeImage = (item.media.m).replace("_m.jpg", "_b.jpg"); | |
htmlString += '<a href="' + largeImage + '" '; | |
htmlString += ' data-gallery '; | |
htmlString += ' title="' + item.title + '"'; | |
//htmlString += ' data-ob_linkText="View on Flickr"'; | |
//htmlString += ' data-ob_link="' + item.link + '"'; | |
//htmlString += ' name="' + item.link + '"'; | |
//htmlString += ' data-ob_share="false"'; | |
htmlString += '>'; | |
htmlString += '<img title="' + item.title + '" src="' + sourceSquare; | |
htmlString += '" alt="'; | |
htmlString += item.title + '" />'; | |
htmlString += '</a>'; | |
}); | |
$('#btimages').html(htmlString + ""); | |
document.getElementById('btimages').onclick = function registerGallery(event) { | |
event = event || window.event; | |
var target = event.target || event.srcElement, | |
link = target.src ? target.parentNode : target, | |
options = { index: link, event: event }, | |
links = this.getElementsByTagName('a'); | |
blueimp.Gallery(links, options); | |
}; | |
} | |
}); | |
</script> | |
<div id="btimages"> </div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment