1/* 2 * DC Flickr - jQuery Flickr 3 * Copyright (c) 2011 Design Chemical 4 * http://www.designchemical.com/blog/ 5 * 6 * Dual licensed under the MIT and GPL licenses: 7 * http://www.opensource.org/licenses/mit-license.php 8 * http://www.gnu.org/licenses/gpl.html 9 * 10 */ 11 12(function($){ 13 14 jQuery.fn.dcFlickr = function(options) { 15 16 //set default options 17 var defaults = { 18 base: 'http://api.flickr.com/services/feeds/', 19 api: 'photos_public.gne', 20 limit: 20, 21 q: { 22 lang: 'en-us', 23 format: 'json', 24 jsoncallback: '?' 25 }, 26 onLoad : function() {} 27 }; 28 29 //call the default otions 30 var options = jQuery.extend(defaults, options); 31 var url = defaults.base + defaults.api + '?'; 32 var qfirst = true; 33 34 for(var key in defaults.q){ 35 if(!qfirst) 36 url += '&'; 37 url += key + '=' + defaults.q[key]; 38 qfirst = false; 39 } 40 41 var $dcFlickr = this; 42 43 return $dcFlickr.each(function(options){ 44 45 var htmlString = ""; 46 limit = defaults.limit; 47 48 jQuery.getJSON(url, function(data){ 49 50 // Cycle each flickr image 51 jQuery.each(data.items, function(i,item){ 52 if(i < limit){ 53 // var source = item.media.m.replace(/_m\.jpg$/, ".jpg"); 54 var sourceSquare = (item.media.m).replace('_m.jpg', '_q.jpg'); 55 htmlString += '<div class="item col-xs-6 col-sm-4 col-md-2"><figure class="overlay overlay1"><a href="' + item.link + '" target="_blank"></a>'; 56 htmlString += '<img src="' + sourceSquare + '" alt="" />'; 57 htmlString += '<figcaption><i class="et-link from-top icon-xs"></i></figcaption></figure></div>'; 58 } 59 }); 60 61 // append html to object 62 $dcFlickr.html(htmlString); 63 64 }).success(function() { 65 // onLoad callback; 66 defaults.onLoad.call(this); 67 }); 68 }); 69 }; 70})(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.