1/* 2 * Flickrush 1.3 - A jQuery flickr plugin 3 * 4 * Copyright (c) 2010 Philip Beel (http://www.theodin.co.uk/) 5 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 6 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 7 * 8 * Revision: $Id: jquery.flickrush.js 2013-09-15 $ 9 * 10 */ 11(function ($) { 12 $.fn.flickrush = function (options) { 13 var defaults = { 14 limit: 3, 15 random: true, 16 id: "30005186@N02", 17 tags: false 18 }; 19 var options = $.extend(defaults, options), 20 flickrurl; 21 isSSL = location.protocol === "https:" ? true : false; 22 if (isSSL) flickrurl = "https://secure.flickr.com/services/feeds/photos_public.gne?format=json"; 23 else flickrurl = "http://api.flickr.com/services/feeds/photos_public.gne?format=json"; if (defaults.tags === true) flickrurl += "&tags=" + defaults.tags; 24 return this.each(function (options) { 25 var act = $(this), 26 apiCall = flickrurl; 27 $.getJSON(apiCall + "&id=" + defaults.id + "&jsoncallback=?", function (data) { 28 var flickrImage, integer, flickrImages = [], 29 i; 30 $.each(data.items, function (i, item) { 31 if (i <= defaults.limit - 1) { 32 ahref = $("<a></a>").attr({ 33 href: item.link 34 }); 35 flickrImage = $("<img/>").attr({ 36 src: item.media.m, 37 alt: item.tags 38 }); 39 container = $("<div></div>"); 40 41 overlay = $("<div></div>").attr({ 42 class: "overlay" 43 }); 44 container.append(flickrImage); 45 container.append(overlay); 46 ahref.append(container); 47 flickrImages.push(ahref) 48 } 49 }); 50 if (defaults.random === true) flickrImages.sort(function () { 51 return 0.5 - Math.random() 52 }); 53 for (var i = 0; i < flickrImages.length; i++) $(act).append(flickrImages[i]) 54 }) 55 }) 56 } 57})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.