Edit File: themify.gallery.min.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,f=0;f<d;f++){var p=a[f];if(b.call(c,p,f,a))return{i:f,v:p}}return{i:-1,v:void 0}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a}; $jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var f=a[d];f in c||(c[f]={});c=c[f]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6-impl","es3");var ThemifyGallery={}; (function(a){ThemifyGallery={config:{fullscreen:themifyScript.lightbox.fullscreenSelector,lightbox:themifyScript.lightbox.lightboxSelector,lightboxGallery:themifyScript.lightbox.gallerySelector,lightboxContentImages:themifyScript.lightbox.lightboxContentImagesSelector,is_touch:a("body").hasClass("touch"),context:document},init:function(b){b&&"object"==typeof b&&a.extend(ThemifyGallery.config,b);if(b.extraLightboxArgs&&"object"==typeof b)for(var c in b.extraLightboxArgs)themifyScript.lightbox[c]=b.extraLightboxArgs[c]; this.parseArgs();this.doLightbox()},parseArgs:function(){a.each(themifyScript.lightbox,function(a,c){"false"==c||"true"==c?themifyScript.lightbox[a]="false"!=c:parseInt(c)?themifyScript.lightbox[a]=parseInt(c):parseFloat(c)&&(themifyScript.lightbox[a]=parseFloat(c))})},doLightbox:function(){var b=this.config.context,c={};if("undefined"!==typeof a.fn.magnificPopup&&"undefined"!==typeof themifyScript.lightbox.lightboxOn&&(a(b).on("click",ThemifyGallery.config.lightbox,function(b){var f;b.preventDefault(); if(!a(".mfp-wrap.mfp-gallery").length){var d=a(this),e=0<d.find("> a").length?d.find("> a").attr("href"):d.attr("href"),g=ThemifyGallery.getFileType(e);b=ThemifyGallery.isVideo(e);var h="inline"===g||"iframe"===g?[]:d.data("rel")?a('a[data-rel="'+d.data("rel")+'"]'):d.closest(".themify_builder_row, .loops-wrapper").find(".themify_lightbox > img").parent(),l=1<h.length?h.index(this):0,q="undefined"!==typeof a(this).children("img").prop("alt")?a(this).children("img").prop("alt"):a(this).prop("title"), m=b?"100%":ThemifyGallery.getParam("width",e)?ThemifyGallery.getParam("width",e):"94%",n=b?"100%":ThemifyGallery.getParam("height",e)?ThemifyGallery.getParam("height",e):"100%";-1===m.indexOf("%")&&(m+="px");-1===n.indexOf("%")&&(n+="px");if(b)if(ThemifyGallery.isYoutube(e)){if(f=ThemifyGallery.getCustomParams(e))c.youtube={id:"v=",index:"youtube.com/",src:"//www.youtube.com/embed/%id%"+f};e=ThemifyGallery.getYoutubePath(e)}else if(ThemifyGallery.isVimeo(e)){if(f=ThemifyGallery.getCustomParams(e))c.vimeo= {id:"/",index:"vimeo.com/",src:"//player.vimeo.com/video/%id%"+f};e=e.split("?")[0]}if(1<h.length&&-1!==l){var k=[];h.each(function(b,c){k.push({src:ThemifyGallery.getiFrameLink(a(c).prop("href")),title:"undefined"!==typeof a(c).find("img").prop("alt")?a(c).find("img").prop("alt"):"",type:ThemifyGallery.getFileType(a(c).prop("href"))})});k=k.reduce(function(a,b){0==a.filter(function(a){return b.src==a.src}).length&&a.push(b);return a},[])}else l=0,k={src:ThemifyGallery.getiFrameLink(e),title:q};f= /iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;g={items:k,type:g,iframe:{markup:'<div class="mfp-iframe-scaler" style="max-width: '+m+" !important; height: "+n+';"><div class="mfp-close"></div><div class="mfp-iframe-wrapper"><iframe class="mfp-iframe" '+(f?'scrolling="no" ':"")+'noresize="noresize" frameborder="0" allowfullscreen></iframe></div></div>',patterns:c},callbacks:{open:function(){var b=d.data("zoom-config"),c={};b&&(b=b.split("|"),"undefined"!==typeof b[0]&&(c.width=b[0]), "undefined"!==typeof b[1]&&(c.height=b[1]),a(this.content).parent().css(c))}}};1<h.length&&a.extend(g,{gallery:{enabled:!0}});0<d.find("img").length&&a.extend(g,{mainClass:"mfp-with-zoom",zoom:{enabled:!ThemifyGallery.config.is_touch,duration:300,easing:"ease-in-out",opener:function(){return d.find("img")}}});g.mainClass=b?g.mainClass+" video-frame":g.mainClass+" standard-frame";ThemifyGallery.isInIframe()?window.parent.jQuery.magnificPopup.open(g):a.magnificPopup.open(g,l)}}),a(themifyScript.lightbox.contentImagesAreas, b).each(function(){var b=[],c=[];themifyScript.lightbox.lightboxContentImages&&themifyScript.lightbox.lightboxGalleryOn&&a(ThemifyGallery.config.lightboxContentImages,a(this)).filter(function(){if(!a(this).parent().hasClass("gallery-icon")&&!a(this).hasClass("themify_lightbox")){c.push(a(this));a(this).prop("title");var d=0<a(this).next(".wp-caption-text").length?a(this).next(".wp-caption-text").html():a(this).children("img").prop("alt");b.push({src:a(this).prop("href"),title:d,type:"image"});return a(this)}}).each(function(d){if(0< c.length)a(this).on("click",function(c){c.preventDefault();var e=a(this);c={items:{src:b[d].src,title:b[d].title},type:"image"};0<e.find("img").length&&a.extend(c,{mainClass:"mfp-with-zoom",zoom:{enabled:!ThemifyGallery.config.is_touch,duration:300,easing:"ease-in-out",opener:function(){return e.find("img")}}});ThemifyGallery.isInIframe()?window.parent.jQuery.magnificPopup.open(c):a.magnificPopup.open(c)})})}),themifyScript.lightbox.lightboxGalleryOn))a("body").on("click",ThemifyGallery.config.lightboxGallery, function(b){if("image"===ThemifyGallery.getFileType(a(this).prop("href"))){b.preventDefault();var c=a(ThemifyGallery.config.lightboxGallery,a(this).closest(".module, .gallery")),d=[];c.each(function(){var b=a(this).prop("title");0<a(this).parent().next(".gallery-caption").length?b=a(this).parent().next(".wp-caption-text").html():0<a(this).children("img").length?b=a(this).children("img").prop("alt"):0<a(this).find(".gallery-caption").find(".entry-content").length&&(b=a(this).find(".gallery-caption").find(".entry-content").text()); d.push({src:a(this).prop("href"),title:b,type:"image"})});b={gallery:{enabled:!0},items:d,mainClass:"mfp-with-zoom",zoom:{enabled:!ThemifyGallery.config.is_touch,duration:300,easing:"ease-in-out",opener:function(b){b=a(c[b.index]);return b.is("img")?b:b.find("img")}}};ThemifyGallery.isInIframe()?window.parent.jQuery.magnificPopup.open(b,c.index(this)):a.magnificPopup.open(b,c.index(this))}})},countItems:function(b){var c=this.config.context;return"lightbox"===b?a(this.config.lightbox,c).length+a(this.config.lightboxGallery, c).length+a(ThemifyGallery.config.lightboxContentImages,c).length:a(this.config.fullscreen,c).length+a(ThemifyGallery.config.lightboxContentImages,c).length},isInIframe:function(){return"undefined"!==typeof ThemifyGallery.config.extraLightboxArgs?"undefined"!==typeof ThemifyGallery.config.extraLightboxArgs.displayIframeContentsInParent&&1==ThemifyGallery.config.extraLightboxArgs.displayIframeContentsInParent:!1},getFileType:function(b){return b.match(/\.(gif|jpg|jpeg|tiff|png)(\?fit=\d+(,|%2C)\d+)?$/i)? "image":b.match(/\bajax=true\b/i)?"ajax":"#"===b.substr(0,1)?"inline":"iframe"},isVideo:function(b){return ThemifyGallery.isYoutube(b)||ThemifyGallery.isVimeo(b)||b.match(/\b.mov\b/i)||b.match(/\b.swf\b/i)},isYoutube:function(b){return b.match(/youtube\.com\/watch/i)||b.match(/youtu\.be/i)},isVimeo:function(b){return b.match(/vimeo\.com/i)},getYoutubePath:function(b){return b.match(/youtu\.be/i)?"//youtube.com/watch?v="+b.match(/youtu\.be\/([^\?]*)/i)[1]:"//youtube.com/watch?v="+ThemifyGallery.getParam("v", b)},getiFrameLink:function(b){"iframe"===ThemifyGallery.getFileType(b)&&null===ThemifyGallery.isVideo(b)&&(b=Themify.UpdateQueryString("iframe","true",b));return b},getParam:function(b,a){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=(new RegExp("[\\?&]"+b+"=([^&#]*)")).exec(a);return null==c?"":c[1]},getCustomParams:function(a){a=(a=a.split("?")[1])?"&"+a.replace(/[\\?&]?(v|autoplay)=[^&#]*/g,"").replace(/^&/g,""):"";return"?autoplay=1"+a}}})(jQuery);
Back to File Manager