PageSourceSearch

https://lightroomkillertips.com/wp-content/cache/autoptimize/js/au…?ver=378c50d47de3f6b4df6b8ce396a0f4cf

js lightroomkillertips.com collected 2026-10-02 16:38:42 UTC 12,328 bytes, 53 lines download raw bytes

1(function($){$.fn.justifiedGallery=function(arg){var defaults={sizeRangeSuffixes:{'lt100':'_t','lt240':'_m','lt320':'_n','lt500':'','lt640':'_z','lt1024':'_b'},rowHeight:120,maxRowHeight:0,margins:1,lastRow:'nojustify',fixedHeight:false,captions:true,rel:null,target:null,extension:/\.[^.]+$/,refreshTime:250,randomize:false};function getSuffix(width,height,context){var longestSide;longestSide=(width>height)?width:height;if(longestSide<=100){return context.settings.sizeRangeSuffixes.lt100;}else if(longestSide<=240){return context.settings.sizeRangeSuffixes.lt240;}else if(longestSide<=320){return context.settings.sizeRangeSuffixes.lt320;}else if(longestSide<=500){return context.settings.sizeRangeSuffixes.lt500;}else if(longestSide<=640){return context.settings.sizeRangeSuffixes.lt640;}else{return context.settings.sizeRangeSuffixes.lt1024;}}
2function onEntryMouseEnterForCaption(sender){$(sender.currentTarget).find('.caption').stop().fadeTo(500,0.7);}
3function onEntryMouseLeaveForCaption(sender){$(sender.currentTarget).find('.caption').stop().fadeTo(500,0.0);}
4function displayEntry($entry,x,y,imgWidth,imgHeight,rowHeight,context){var $image=$entry.find('img');$image.css('width',imgWidth);$image.css('height',imgHeight);$image.css('margin-left',-imgWidth/2);$image.css('margin-top',-imgHeight/2);$entry.width(imgWidth);$entry.height(rowHeight);$entry.css('top',y);$entry.css('left',x);var imageSrc=$image.attr('src');var newImageSrc=imageSrc.replace(context.settings.extension,'').replace(context.usedSizeRangeRegExp,'')+
5getSuffix(imgWidth,imgHeight,context)+
6imageSrc.match(context.settings.extension)[0];$image.one('error',function(){$image.attr('src',$image.data('jg.originalSrc'));});$entry.stop().fadeTo(300,1,function(){if(imageSrc!==newImageSrc){$image.attr('src',newImageSrc);}});var captionMouseEvents=$entry.data('jg.captionMouseEvents');if(context.settings.captions===true){var $imgCaption=$entry.find('.caption');if($imgCaption.length===0){var caption=$image.attr('alt');if(typeof caption==='undefined')caption=$entry.attr('title');if(typeof caption!=='undefined'){$imgCaption=$('<div class="caption">'+caption+'</div>');$entry.append($imgCaption);}}
7if($imgCaption.length!==0&&typeof captionMouseEvents==='undefined'){captionMouseEvents={mouseenter:onEntryMouseEnterForCaption,mouseleave:onEntryMouseLeaveForCaption};$entry.on('mouseenter',captionMouseEvents.mouseenter);$entry.on('mouseleave',captionMouseEvents.mouseleave);$entry.data('jg.captionMouseEvents',captionMouseEvents);}}else{if(typeof captionMouseEvents!=='undefined'){$entry.off('mouseenter',captionMouseEvents.mouseenter);$entry.off('mouseleave',captionMouseEvents.mouseleave);$entry.removeData('jg.captionMouseEvents');}}}
8function prepareBuildingRow(context,isLastRow){var i,$entry,$image,stdImgW,newImgW,newImgH,justify=true;var minHeight=0;var availableWidth=context.galleryWidth;var extraW=availableWidth-context.buildingRow.width-
9((context.buildingRow.entriesBuff.length-1)*context.settings.margins);if(isLastRow&&context.settings.lastRow==='hide'&&(extraW/availableWidth>0.35)){for(i=0;i<context.buildingRow.entriesBuff.length;i++){$entry=context.buildingRow.entriesBuff[i];$entry.stop().fadeTo(0);}
10return-1;}
11if(isLastRow&&context.settings.lastRow==='nojustify'&&(extraW/availableWidth>0.35))justify=false;for(i=0;i<context.buildingRow.entriesBuff.length;i++){$image=context.buildingRow.entriesBuff[i].find('img');stdImgW=Math.ceil($image.data('jg.imgw')/($image.data('jg.imgh')/context.settings.rowHeight));if(justify){if(i<context.buildingRow.entriesBuff.length-1){newImgW=stdImgW+Math.ceil(stdImgW/context.buildingRow.width*extraW);}else{newImgW=availableWidth;}
12newImgH=Math.ceil(context.settings.rowHeight*(newImgW/stdImgW));if(context.settings.fixedHeight&&newImgH<context.settings.rowHeight){newImgW=stdImgW;newImgH=context.settings.rowHeight;}}else{newImgW=stdImgW;newImgH=context.settings.rowHeight;}
13$image.data('jg.imgw',newImgW);$image.data('jg.imgh',newImgH);availableWidth-=newImgW+((i<context.buildingRow.entriesBuff.length-1)?context.settings.margins:0);if(i===0||minHeight>newImgH)minHeight=newImgH;}
14if(context.settings.fixedHeight)minHeight=context.settings.rowHeight;return minHeight;}
15function rewind(context){context.lastAnalyzedIndex=-1;context.buildingRow.entriesBuff=[];context.buildingRow.width=0;context.offY=0;context.firstRowFlushed=false;}
16function flushRow(context,isLastRow){var $entry,$image,minHeight,offX=0;minHeight=prepareBuildingRow(context,isLastRow);if(isLastRow&&context.settings.lastRow==='hide'&&minHeight===-1){context.buildingRow.entriesBuff=[];context.buildingRow.width=0;return;}
17if(context.settings.maxRowHeight>0&&context.settings.maxRowHeight<minHeight)
18minHeight=context.settings.maxRowHeight;else if(context.settings.maxRowHeight===0&&(1.5*context.settings.rowHeight)<minHeight)
19minHeight=1.5*context.settings.rowHeight;for(var i=0;i<context.buildingRow.entriesBuff.length;i++){$entry=context.buildingRow.entriesBuff[i];$image=$entry.find('img');displayEntry($entry,offX,context.offY,$image.data('jg.imgw'),$image.data('jg.imgh'),minHeight,context);offX+=$image.data('jg.imgw')+context.settings.margins;}
20context.$gallery.height(context.offY+minHeight+
21(context.spinner.active?context.spinner.$el.innerHeight():0));if(!isLastRow){context.offY+=minHeight+context.settings.margins;context.buildingRow.entriesBuff=[];context.buildingRow.width=0;context.firstRowFlushed=true;context.$gallery.trigger('jg.rowflush');}}
22function checkWidth(context){context.checkWidthIntervalId=setInterval(function(){var galleryWidth=parseInt(context.$gallery.width(),10);if(context.galleryWidth!==galleryWidth){context.galleryWidth=galleryWidth;rewind(context);startImgAnalyzer(context,true);}},context.settings.refreshTime);}
23function startLoadingSpinnerAnimation(spinnerContext){clearInterval(spinnerContext.intervalId);spinnerContext.intervalId=setInterval(function(){if(spinnerContext.phase<spinnerContext.$points.length)
24spinnerContext.$points.eq(spinnerContext.phase).fadeTo(spinnerContext.timeslot,1);else
25spinnerContext.$points.eq(spinnerContext.phase-spinnerContext.$points.length).fadeTo(spinnerContext.timeslot,0);spinnerContext.phase=(spinnerContext.phase+1)%(spinnerContext.$points.length*2);},spinnerContext.timeslot);}
26function stopLoadingSpinnerAnimation(spinnerContext){clearInterval(spinnerContext.intervalId);spinnerContext.intervalId=null;}
27function stopImgAnalyzerStarter(context){context.yield.flushed=0;if(context.imgAnalyzerTimeout!==null)clearTimeout(context.imgAnalyzerTimeout);}
28function startImgAnalyzer(context,isForResize){stopImgAnalyzerStarter(context);context.imgAnalyzerTimeout=setTimeout(function(){analyzeImages(context,isForResize);},0.001);analyzeImages(context,isForResize);}
29function analyzeImages(context,isForResize){var isLastRow=context.firstRowFlushed;for(var i=context.lastAnalyzedIndex+1;i<context.entries.length;i++){var $entry=$(context.entries[i]);var $image=$entry.find('img');if($image.data('jg.loaded')===true){var newImgW=Math.ceil($image.data('jg.imgw')/($image.data('jg.imgh')/context.settings.rowHeight));isLastRow=context.firstRowFlushed&&(i>=context.entries.length-1);if(context.buildingRow.width+(context.settings.fixedHeight?newImgW:newImgW/2)+
30(context.buildingRow.entriesBuff.length-1)*context.settings.margins>context.galleryWidth){flushRow(context,isLastRow);if(++context.yield.flushed>=context.yield.every){startImgAnalyzer(context,isForResize);return;}}
31context.buildingRow.entriesBuff.push($entry);context.buildingRow.width+=newImgW;context.lastAnalyzedIndex=i;}else if($image.data('jg.loaded')!=='error'){return;}}
32if(context.buildingRow.entriesBuff.length>0)flushRow(context,isLastRow);if(context.spinner.active){context.spinner.active=false;context.$gallery.height(context.$gallery.height()-context.spinner.$el.innerHeight());context.spinner.$el.detach();stopLoadingSpinnerAnimation(context.spinner);}
33stopImgAnalyzerStarter(context);if(!isForResize)context.$gallery.trigger('jg.complete');else context.$gallery.trigger('jg.resize');}
34function checkSettings(context){function checkSuffixesRange(range){if(typeof context.settings.sizeRangeSuffixes[range]!=='string')
35throw'sizeRangeSuffixes.'+range+' must be a string';}
36function checkOrConvertNumber(setting){if(typeof context.settings[setting]==='string'){context.settings[setting]=parseInt(context.settings[setting],10);if(isNaN(context.settings[setting]))throw'invalid number for '+setting;}else if(typeof context.settings[setting]==='number'){if(isNaN(context.settings[setting]))throw'invalid number for '+setting;}else{throw setting+' must be a number';}}
37if(typeof context.settings.sizeRangeSuffixes!=='object')
38throw'sizeRangeSuffixes must be defined and must be an object';checkSuffixesRange('lt100');checkSuffixesRange('lt240');checkSuffixesRange('lt320');checkSuffixesRange('lt500');checkSuffixesRange('lt640');checkSuffixesRange('lt1024');checkOrConvertNumber('rowHeight');checkOrConvertNumber('maxRowHeight');checkOrConvertNumber('margins');if(context.settings.lastRow!=='nojustify'&&context.settings.lastRow!=='justify'&&context.settings.lastRow!=='hide'){throw'lastRow must be "nojustify", "justify" or "hide"';}
39if(typeof context.settings.fixedHeight!=='boolean'){throw'fixedHeight must be a boolean';}
40if(typeof context.settings.captions!=='boolean'){throw'captions must be a boolean';}
41checkOrConvertNumber('refreshTime');if(typeof context.settings.randomize!=='boolean'){throw'randomize must be a boolean';}}
42return this.each(function(index,gallery){var $gallery=$(gallery);$gallery.addClass('justified-gallery');var context=$gallery.data('jg.context');if(typeof context==='undefined'){if(typeof arg!=='undefined'&&arg!==null&&typeof arg!=='object')
43throw'The argument must be an object';var $spinner=$('<div class="spinner"><span></span><span></span><span></span></div>');context={settings:$.extend({},defaults,arg),imgAnalyzerTimeout:null,entries:null,buildingRow:{entriesBuff:[],width:0}
43,lastAnalyzedIndex:-1,firstRowFlushed:false,yield:{every:2,flushed:0},offY:0,spinner:{active:false,phase:0,timeslot:150,$el:$spinner,$points:$spinner.find('span'),intervalId:null},checkWidthIntervalId:null,galleryWidth:$gallery.width(),$gallery:$gallery};$gallery.data('jg.context',context);}else if(arg==='norewind'){}else{context.settings=$.extend({},context.settings,arg);rewind(context);}
44checkSettings(context);context.entries=$gallery.find('a').toArray();if(context.entries.length===0)return;if(context.settings.randomize){context.entries.sort(function(){return Math.random()*2-1;});$.each(context.entries,function(){$(this).appendTo($gallery);});}
45context.usedSizeRangeRegExp=new RegExp("("+
46context.settings.sizeRangeSuffixes.lt100+"|"+
47context.settings.sizeRangeSuffixes.lt240+"|"+
48context.settings.sizeRangeSuffixes.lt320+"|"+
49context.settings.sizeRangeSuffixes.lt500+"|"+
50context.settings.sizeRangeSuffixes.lt640+"|"+
51context.settings.sizeRangeSuffixes.lt1024+")$");if(context.settings.maxRowHeight>0&&context.settings.maxRowHeight<context.settings.rowHeight)
52context.settings.maxRowHeight=context.settings.rowHeight;var imagesToLoad=false;$.each(context.entries,function(index,entry){var $entry=$(entry);var $image=$entry.find('img');if($image.data('jg.loaded')!==true){$image.data('jg.loaded',false);imagesToLoad=true;if(context.spinner.active===false){context.spinner.active=true;$gallery.append(context.spinner.$el);$gallery.height(context.offY+context.spinner.$el.innerHeight());startLoadingSpinnerAnimation(context.spinner);}
53if(context.settings.rel!==null)$entry.attr('rel',context.settings.rel);if(context.settings.target!==null)$entry.attr('target',context.settings.target);var imageSrc=(typeof $image.data('safe-src')!=='undefined')?$image.data('safe-src'):$image.attr('src');$image.data('jg.originalSrc',imageSrc);$image.attr('src',imageSrc);var loadImg=new Image();var $loadImg=$(loadImg);$loadImg.one('load',function imgLoaded(){$image.off('load error');$image.data('jg.imgw',loadImg.width);$image.data('jg.imgh',loadImg.height);$image.data('jg.loaded',true);startImgAnalyzer(context,false);});$loadImg.one('error',function imgLoadError(){$image.off('load error');$image.data('jg.loaded','error');startImgAnalyzer(context,false);});loadImg.src=imageSrc;}});if(!imagesToLoad)startImgAnalyzer(context,false);checkWidth(context);});};}(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.