![]() Server : LiteSpeed System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : claqxcrl ( 523) PHP Version : 8.1.32 Disable Function : NONE Directory : /home/claqxcrl/confenda.com/wp-content/plugins/gallery-photo-gallery/admin/js/ |
!function($){$.Mosaic=function(t,e){var i,a=this;a.el=t,a.$el=$(t),a.$el.data("Mosaic",a);var r,n=!1;a.init=function(){a.options=i=$.extend({},$.Mosaic.defaults,a.$el.data(),e),$(a.el).addClass("jQueryMosaic"),i.outerMargin&&$(a.el).css("padding",i.outerMargin),i.innerGap&&$(a.el).css("margin-bottom",1*i.innerGap),a.getItems().each(function(t,e){$(e).attr("width")&&$(e).width($(e).attr("width")),$(e).attr("height")&&$(e).height($(e).attr("height"))}),a.fit(),i.refitOnResize&&$(window).on("resize",null,null,function(){i.refitOnResizeDelay?(n&&clearTimeout(n),n=setTimeout(function(){a.fit()},i.refitOnResizeDelay)):a.fit()})},a.getItems=function(){return $("> div:not([data-no-mosaic=true]), > a:not([data-no-mosaic=true]), > img:not([data-no-mosaic=true])",a.el)},a.getItemAtIndex=function(t){return a.getItems()[t]?$(a.getItems()[t]):!1},a.getItemsSubset=function(t,e){var i=a.getItems();return t>i.length?!1:(t+e>i.length&&(e=i.length-t),i.slice(t,t+e))},a.isLastItemsSubset=function(t,e){var i=a.getItems();return t>i.length?!0:t+e>i.length?!0:!1},a.getItemWidth=function(t){return $(t).outerWidth()?$(t).outerWidth():$(t).attr("width")?$(t).attr("width"):void 0},a.getItemHeight=function(t){return $(t).outerHeight()?$(t).outerHeight():$(t).attr("height")?$(t).attr("height"):void 0},a.getItemAspectRatio=function(t){if($(t).data("aspect-ratio"))return $(t).data("aspect-ratio");if(a.getItemWidth(t)&&a.getItemHeight(t)){var e=a.getItemWidth(t)/a.getItemHeight(t);return $(t).data("aspect-ratio",e),e}return i.defaultAspectRatio},a.getItemWidthForGivenHeight=function(t,e){return e*a.getItemAspectRatio(t)},a.getItemHeightForGivenWidth=function(t,e){return e/a.getItemAspectRatio(t)},a.setItemSizeByGivenHeight=function(t,e,r){var n=Math.floor(a.getItemWidthForGivenHeight(t,e));if($(t).width(n+"px"),$(t).height(r?"auto":Math.floor(e)),i.highResImagesWidthThreshold)if(n>i.highResImagesWidthThreshold){var s=$(t).data("high-res-background-image-url");s&&!$(t).data("low-res-background-image-url")&&($(t).data("low-res-background-image-url",$(t).css("background-image")),$(t).css("background-image",'url("'+s+'")'),$(t).addClass("highRes")),$("img",t).add(t).each(function(t,e){var i=$(e).data("high-res-image-src");i&&!$(e).data("low-res-image-src")&&($(e).data("low-res-image-src",$(e).attr("src")),$(e).attr("src",i),$(e).addClass("highRes"))})}else{var o=$(t).data("low-res-background-image-url");o&&($(t).css("background-image",o),$(t).data("low-res-background-image-url",!1),$(t).removeClass("highRes")),$("img",t).add(t).each(function(t,e){var i=$(e).data("low-res-image-src");i&&($(e).attr("src",i),$(e).data("low-res-image-src",!1),$(e).removeClass("highRes"))})}return n},a.calculateHeightToFit=function(t){var e=0;return t.each(function(){e+=parseFloat(a.getItemAspectRatio(this))}),(r-i.innerGap*(t.length-1))/e},a.retrieveBaseWidth=function(){var t=parseFloat($(a.el).width());r=$.isNumeric(t)?t:0},a.fit=function(){if(a.retrieveBaseWidth(),i.responsiveWidthThreshold&&r<i.responsiveWidthThreshold)return void a.getItems().each(function(){var t=a.getItemHeightForGivenWidth(this,r);$(this).width(r),$(this).height($(this).data("only-force-height-when-necessary")?"auto":t),i.innerGap&&$(this).css("margin-bottom",i.innerGap)});for(var t,e,n=1,s=0,o=!1;;){if(t=a.getItemsSubset(s,n),a.isLastItemsSubset(s,n)){t.length&&a.fitItems(t);break}e=a.calculateHeightToFit(t),e>i.maxRowHeight?n++:(a.fitItems(t),s+=n,n=1,o=!0)}o||a.fitItems(a.getItems())},a.fitItems=function(t){var e=!1,n=a.calculateHeightToFit(t);if(n>i.maxRowHeight)switch(i.maxRowHeightPolicy){case"skip":return void t.each(function(){$(this).hide()});case"crop":n=i.maxRowHeight;break;case"oversize":var e=!0;break;case"tail":n=i.maxRowHeight;var s=!0}t.each(function(){$(this).show()});var o=0;if(t.each(function(r){o+=a.setItemSizeByGivenHeight(this,n,e&&$(this).data("only-force-height-when-necessary")),i.innerGap&&($(this).css("margin-right",r<t.length-1?i.innerGap:0),$(this).css("margin-bottom",i.innerGap))}),!s&&o!=r-(t.length-1)*i.innerGap){difference=r-(t.length-1)*i.innerGap-o;var h=t.last().width();t.last().width(h+difference)}},a.init()},$.Mosaic.defaults={maxRowHeight:400,refitOnResize:!0,refitOnResizeDelay:!1,defaultAspectRatio:1,maxRowHeightPolicy:"skip",highResImagesWidthThreshold:350,outerMargin:0,innerGap:0,responsiveWidthThreshold:!1},$.fn.Mosaic=function(options,params){return this.each(function(){var me=$(this).data("Mosaic");(typeof options).match("object|undefined")?new $.Mosaic(this,options):eval("me."+options)(params)})}}(jQuery);