1/*! 2 * Thumbnail helper for fancyBox 3 * version: 1.0.6 4 * @requires fancyBox v2.0 or later 5 * 6 * Usage: 7 * $(".fancybox").fancybox({ 8 * helpers : { 9 * thumbs: { 10 * width : 50, 11 * height : 50 12 * } 13 * } 14 * }); 15 * 16 * Options: 17 * width - thumbnail width 18 * height - thumbnail height 19 * source - function to obtain the URL of the thumbnail image 20 * position - 'top' or 'bottom' 21 * 22 */ 23(function($){var F=$.fancybox;F.helpers.thumbs={wrap:null,list:null,width:0,source:function(item){var href;if(item.element){href=$(item.element).find('img').attr('src')} 24if(!href&&item.type==='image'&&item.href){href=item.href} 25return href},init:function(opts,obj){var that=this,list,thumbWidth=opts.width||50,thumbHeight=opts.height||50,thumbSource=opts.source||this.source;list='';for(var n=0;n<obj.group.length;n++){list+='<li><a style="width:'+thumbWidth+'px;height:'+thumbHeight+'px;" href="javascript:jQuery.fancybox.jumpto('+n+');"></a></li>'} 26this.wrap=$('<div id="fancybox-thumbs"></div>').addClass(opts.position||'bottom').appendTo('body');this.list=$('<ul>'+list+'</ul>').appendTo(this.wrap);$.each(obj.group,function(i){var href=thumbSource(obj.group[i]);if(!href){return} 27$("<img />").load(function(){var width=this.width,height=this.height,widthRatio,heightRatio,parent;if(!that.list||!width||!height){return} 28widthRatio=width/thumbWidth;heightRatio=height/thumbHeight;parent=that.list.children().eq(i).find('a');if(widthRatio>=1&&heightRatio>=1){if(widthRatio>heightRatio){width=Math.floor(width/heightRatio);height=thumbHeight}else{width=thumbWidth;height=Math.floor(height/widthRatio)}} 29$(this).css({width:width,height:height,top:Math.floor(thumbHeight/2-height/2),left:Math.floor(thumbWidth/2-width/2)});parent.width(thumbWidth).height(thumbHeight);$(this).hide().appendTo(parent).fadeIn(300)}).attr('src',href)});this.width=this.list.children().eq(0).outerWidth(!0);this.list.width(this.width*(obj.group.length+1)).css('left',Math.floor($(window).width()*0.5-(obj.index*this.width+this.width*0.5)))},beforeLoad:function(opts,obj){if(obj.group.length<2){obj.helpers.thumbs=!1;return} 30obj.margin[opts.position==='top'?0:2]+=((opts.height||50)+15)},afterShow:function(opts,obj){if(this.list){this.onUpdate(opts,obj)}else{this.init(opts,obj)} 31this.list.children().removeClass('active').eq(obj.index).addClass('active')},onUpdate:function(opts,obj){if(this.list){this.list.stop(!0).animate({'left':Math.floor($(window).width()*0.5-(obj.index*this.width+this.width*0.5))},150)}},beforeClose:function(){if(this.wrap){this.wrap.remove()} 32this.wrap=null;this.list=null;this.width=0}}}(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.