Out of the box support for the following galleries and plugins...

And also don't forget...

**Actual Behavior**: - `What is the issue? (*)` - `What is the expected behavior?` **Versions**: (*) - `Freemius SDK Version:` - `WordPress Version:` - `PHP Version:` **Plugin / Theme**: (*) - `Name:` - `Slug:` - `Freemius ID:` **Additional Information**: - `Browser Type: (*)` - `Browser Version: (*)` - `OS: (*)` - `Stack Traces:` ---- **Note:** `(*)` indicates required information. Without this information, your issue may be auto-closed. > You can find your Freemius SDK version at `/freemius/start.php` > You can find your Freemius product ID in the Freemius dashboard: `SETTINGS -> INTEGRATION`. > Do not modify the titles or questions. Simply add your responses to the ends of the questions. Add more lines if needed. /* * nojquery-postmessage by Jeff Lee * a non-jQuery fork of: * * jQuery postMessage - v0.5 - 9/11/2009 * http://benalman.com/projects/jquery-postmessage-plugin/ * * Copyright (c) 2009 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ function NoJQueryPostMessageMixin(g,a){var b,h,e,d,f,c=1;if(window.postMessage){if(window.addEventListener){b=function(i){window.addEventListener("message",i,false)};h=function(i){window.removeEventListener("message",i,false)}}else{b=function(i){window.attachEvent("onmessage",i)};h=function(i){window.detachEvent("onmessage",i)}}this[g]=function(i,k,j){if(!k){return}j.postMessage(i,k.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))};this[a]=function(k,j,i){if(e){h(e);e=null}if(!k){return false}e=b(function(l){switch(Object.prototype.toString.call(j)){case"[object String]":if(j!==l.origin){return false}break;case"[object Function]":if(j(l.origin)){return false}break}k(l)})}}else{this[g]=function(i,k,j){if(!k){return}j.location=k.replace(/#.*$/,"")+"#"+(+new Date)+(c++)+"&"+i};this[a]=function(k,j,i){if(d){clearInterval(d);d=null}if(k){i=typeof j==="number"?j:typeof i==="number"?i:100;d=setInterval(function(){var m=document.location.hash,l=/^#?\d+&/;if(m!==f&&l.test(m)){f=m;k({data:m.replace(l,"")})}},i)}}}return this};Simple Install 1. Login to WordPress and go to Plugins > Add New > Upload 2. Upload foobox-free.zip and activate 3. FooBox should work out of the box with any linked images 4. Goto Settings > FooBox Settings to change the default configuration Manual Install 1. Upload the foobox-free folder to your /wp-content/plugins/ directory. 2. Activate the plugin through the 'Plugins' menu in WordPress. 3. FooBox should work out of the box with any WordPress Gallery 4. Goto Settings > FooBox Settings to change the default settings/**! * FooBox - A jQuery plugin for responsive lightboxes * @version 2.1.8 * @link http://fooplugins.com/plugins/foobox-jquery * @copyright Steven Usher & Brad Vincent 2014 * @license Released under the MIT license. * You are free to use FooBox jQuery in personal projects as long as this copyright header is left intact. */ !function(a,b,c,undefined){if(a&&b){b.FooBox={defaults:{affiliate:{enabled:!0,prefix:"Powered by ",url:"http://fooplugins.com/plugins/foobox/"},alwaysInit:!1,closeOnOverlayClick:!0,containerCssClass:"fbx-instance",countMessage:"item %index of %total",error:"Could not load the item",excludes:".fbx-link, .nofoobox",externalSelector:"a[data-foobox],input[data-foobox]",fitToScreen:!1,hideScrollbars:!0,loadDelay:0,loaderTimeout:600,modalClass:"",preload:!1,rel:null,resizeSpeed:300,selector:"a",showButtons:!0,showCount:!0,style:"fbx-rounded",theme:"fbx-light",transitionInSpeed:200,transitionOutSpeed:200,initCallback:null,loop:!0},version:"2.0.10",instances:[],ready:function(b){(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?b(a):setTimeout(function(){FooBox.ready(b)},1)}},FooBox.$=a,FooBox.format=function(a,b,c){var d,e,f=arguments[0];for(d=0;d-1||a.indexOf("crios")>-1,FooBox.browser.isChrome&&(FooBox.browser.css+=" fbx-chrome"),FooBox.browser.isSafari=a.indexOf("safari")>-1&&!FooBox.browser.isChrome,FooBox.browser.isSafari&&(FooBox.browser.css+=" fbx-safari",FooBox.browser.isLtSafari10=/constructor/i.test(b.HTMLElement)),FooBox.browser.isFirefox=c.indexOf("firefox")>-1,FooBox.browser.isFirefox&&(FooBox.browser.css+=" fbx-firefox");var e=c.indexOf("msie "),f=c.indexOf("trident/"),g=c.indexOf("edge/");if(FooBox.browser.isIE=e>-1||f>-1||g>-1,FooBox.browser.isIE){if(e>-1)FooBox.browser.version=parseInt(c.substring(e+5,c.indexOf(".",e)),10);else if(f>-1){var h=c.indexOf("rv:");FooBox.browser.version=parseInt(c.substring(h+3,c.indexOf(".",h)),10)}else g>-1&&(FooBox.browser.version=parseInt(c.substring(g+5,c.indexOf(".",g)),10));FooBox.browser.css=FooBox.format("fbx-ie fbx-ie{0}",FooBox.browser.version)}},supportsTransitions:function(){var a,b=document.body||document.documentElement,c=b.style,d="transition";if("string"==typeof c[d])return!0;a=["Moz","Webkit","Khtml","O","ms"],d=d.charAt(0).toUpperCase()+d.substr(1);for(var e=0;e0&&-1!==a.indexOf(b)},hasProperties:function(a){if("object"!=typeof a)return!1;var b;for(b in a)if(a.hasOwnProperty(b))return!0;return!1},get:function(a,b){if(FooBox.options.isMultipart(b,".")){var c=b.substring(0,b.indexOf(".")),d=b.substring(b.indexOf(".")+1);return a[c]=a[c]||{},FooBox.options.get(a[c],d)}return a[b]},set:function(a,b,c){if(FooBox.options.isMultipart(b,".")){var d=b.substring(0,b.indexOf(".")),e=b.substring(b.indexOf(".")+1);a[d]=a[d]||{},FooBox.options.set(a[d],e,c)}else a[b]=c},merge:function(a,b,c){var d,e=Array.prototype.slice.call(arguments);for(a=e.shift(),b=e.shift(),FooBox.options._merge(a,b),d=0;d'),e.element.append('
');var b=a('
');b.append('
'),b.append('
');var c=a('
');c.append(b),c.append(''),c.append(''),c.append(''),c.append(''),c.append(''),e.element.append('
'),e.element.append(c),e.FooBox.raise("foobox.setupHtml"),a("body").append(e.element)}},options:function(a){var b;e.element.removeClass().addClass("fbx-modal").addClass(FooBox.format("fbx-{0}",e.FooBox.id)).addClass(e.FooBox.element.data("style")||a.style).addClass(e.FooBox.element.data("theme")||a.theme).addClass(e.FooBox.element.data("modal-class")).addClass(a.modalClass).data("fbx_instance",e.FooBox),e.element.addClass(FooBox.browser.css),b=a.affiliate.enabled?"":"none",e.element.find(".fbx-credit").css("display",b),a.affiliate.enabled&&(e.element.find(".fbx-credit > a").attr("href",a.affiliate.url),e.element.find(".fbx-credit > a > em").text(a.affiliate.prefix)),b=a.showCount&&e.FooBox.items.multiple()?"":"none",e.element.find(".fbx-count").css("display",b),a.showButtons&&e.FooBox.items.multiple()||e.element.addClass("fbx-no-buttons"),e.FooBox.raise("foobox.setupOptions")},bind:function(){1==e.FooBox.options.closeOnOverlayClick&&e.element.off("click.foobox").on("click.foobox",function(b){1==e.FooBox.options.closeOnOverlayClick&&a(b.target).is(".fbx-modal")&&e.close()}),e.element.find(".fbx-close").off("click.foobox").on("click.foobox",function(a){a.preventDefault(),a.stopPropagation(),e.close()}).end().find(".fbx-prev").off("click.foobox").on("click.foobox",function(b){b.preventDefault(),b.stopPropagation(),a(this).hasClass("fbx-disabled")||e.prev()}).end().find(".fbx-next").off("click.foobox").on("click.foobox",function(b){b.preventDefault(),b.stopPropagation(),a(this).hasClass("fbx-disabled")||e.next()})}},this.prioritize=function(){FooBox.instances.length>1&&e.element.nextAll(".fbx-modal:last").after(e.element)},this.preload=function(){if(1==e.FooBox.options.preload){var a=e.FooBox.items.prev();a&&a.handler.preload(a);var b=e.FooBox.items.next();b&&b.handler.preload(b)}},this.show=function(b){function c(a){if(e.loaderTimeout.stop(),e.element.removeClass("fbx-loading"),e._busy=!1,d.error(a),!e.FooBox.raise("foobox.onError",{error:a}).isDefaultPrevented()){var c=e.FooBox.items.error(f.index);null!=c&&e.show(b)}}var f=e.FooBox.items.current();if(f){b=b||!1,e._first=b,e._busy=!0,e._closed=!1,a("body").addClass("fbx-active"),e.FooBox.options.hideScrollbars&&a("html").addClass("fbx-no-scroll"),1==f.error?e.element.addClass("fbx-error"):e.element.removeClass("fbx-error"),e.element.hasClass("fbx-show")||(e.prioritize(),e.element.addClass("fbx-loading").find(".fbx-inner").css({width:"100px",height:"100px","margin-top":"-50px","margin-left":"-50px"}));var g=e.element.find(".fbx-item-current"),h=e.element.find(".fbx-item-next");if(h.hide().css("opacity","0"),e.element.find(".fbx-count").text(e.FooBox.options.countMessage.replace("%index",""+(e.FooBox.items.indexes.current+1)).replace("%total",""+e.FooBox.items.array.length)),e.FooBox.raise("foobox.beforeLoad",{item:f}).isDefaultPrevented())return void(e._busy=!1);if(f.handler.hasChanged(f)){var i=f.index,j=f.element.get(0);f=f.handler.parse(f.element);var k=e.FooBox.raise("foobox.parseItem",{element:f.element,item:f});j.index=k.fb.item.index=i,e.FooBox.items.array[i]=k.fb.item}e.preload(),e.loaderTimeout.start(function(){e.element.addClass("fbx-loading")},e.FooBox.options.loaderTimeout),setTimeout(function(){e.checkForLoop(f),f.handler.load(f,h,function(a){return 1==e._closed?void(e._busy=!1):void e.transitionOut(g,function(){return 1==e._closed?void(e._busy=!1):void e.resize(a,h,function(){return 1==e._closed?void(e._busy=!1):(e.loaderTimeout.stop(),h.show(),void e.transitionIn(h,function(){return 1==e._closed?void(e._busy=!1):(h.add(g).toggleClass("fbx-item-next fbx-item-current"),g.empty(),void(e.element.hasClass("fbx-show")?(e.element.removeClass("fbx-loading"),e.FooBox.raise("foobox.afterLoad",{item:f}),e.triggerFooGalleryLayout(h),e._busy=!1):e.FooBox.raise("foobox.beforeShow",{item:f}).isDefaultPrevented()||(e.element.removeClass("fbx-loading").addClass("fbx-show"),e.FooBox.raise("foobox.afterShow",{item:f}),e.FooBox.raise("foobox.afterLoad",{item:f}),e.triggerFooGalleryLayout(h),e._busy=!1)))},c))},c)},c)},c)},e.FooBox.options.loadDelay)}},this.triggerFooGalleryLayout=function(c){b.FooGallery&&c.find(".foogallery").each(function(){var b=a(this).data("__FooGallery__");b&&b.initialized&&b.layout()})},this.checkForLoop=function(a){1!=e.FooBox.options.loop&&(e.element.find(".fbx-prev, .fbx-next").removeClass("fbx-disabled"),e.FooBox.items.is.first(a)&&e.element.find(".fbx-prev").addClass("fbx-disabled"),e.FooBox.items.is.last(a)&&e.element.find(".fbx-next").addClass("fbx-disabled"))},this.resize=function(b,c,d,f){try{if(0===b.width||0===b.height)return void(a.isFunction(f)&&f(FooBox.format("Invalid size supplied. Width = {0}, Height = {1}",b.width,b.height)));var g=e.FooBox.items.current(),h=new FooBox.Size(b.width,b.height),i=e.element.find(".fbx-inner"),j=e.element.find(".fbx-inner-spacer"),k=parseInt(j.css("padding-top"),0),l=parseInt(j.css("padding-bottom"),0),m=parseInt(j.css("padding-left"),0),n=parseInt(j.css("padding-right"),0),o=parseInt(i.css("border-top-width"),0),p=parseInt(i.css("border-bottom-width"),0),q=parseInt(i.css("border-left-width"),0),r=parseInt(i.css("border-right-width"),0),s=parseInt(i.css("padding-left"),0),t=k+l+2*s+o+p,u=m+n+2*s+q+r,v=new FooBox.Size(parseInt(i.css("width"),0),parseInt(i.css("height"),0)),w=new FooBox.Size(e.element.width()-u,e.element.height()-t),x=w.width/b.width;b.height*x>w.height&&(x=w.height/b.height),e.FooBox.options.fitToScreen===!0||1==g.proportion&&(b.height>w.height||b.width>w.width)?(b.height=Math.floor(b.height*x),b.width=Math.floor(b.width*x)):0==g.proportion&&(b.height>w.height&&(b.height=w.height),b.width>w.width&&(b.width=w.width)),b.height<100&&(b.height=100),b.width<100&&(b.width=100);var y=-(b.height/2+s+(p+o)/2+l/2-k/2),z=-(b.width/2+s+(r+q)/2+n/2-m/2);if(v.equalTo(b))i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d();else if(!e.FooBox.raise("foobox.beforeResize",{item:g,size:b,offset:{top:y,left:z},error:f,success:d}).isDefaultPrevented())if(y=-(b.height/2+s+(p+o)/2+l/2-k/2),z=-(b.width/2+s+(r+q)/2+n/2-m/2),e.element.hasClass("fbx-show"))if(FooBox.browser.supportsTransitions()){var A=e.FooBox.options.resizeSpeed/1e3,B="all "+A+"s ease-in-out";i.css({WebkitTransition:B,MozTransition:B,MsTransition:B,OTransition:B,transition:B}),i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),setTimeout(function(){i.css({WebkitTransition:"",MozTransition:"",MsTransition:"",OTransition:"",transition:""}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d(b)},e.FooBox.options.resizeSpeed)}else i.animate({height:b.height,width:b.width,"margin-top":y,"margin-left":z},e.FooBox.options.resizeSpeed,function(){e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d(b)});else i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d()}catch(C){a.isFunction(f)&&f(C)}},this.overflow=function(a,b,c,d){var f=d.find(".fbx-item");1==a.overflow&&(c.width<.8*b.width||c.height<.8*b.height)||1==a.overflow&&0==a.proportion&&(c.width0?(c.element.data("fbx_instance",c),c.options.containerCssClass&&c.element.addClass(c.options.containerCssClass),c.setup.bind(),c.modal.init(b,c.options),FooBox.handlers.call(c,"init",c.element,c.options),c.raise("foobox.initialized"),a.isFunction(c.options.initCallback)&&c.options.initCallback.call(c)):c.destroy()},this.reinit=function(a){c.options=FooBox.options.merge(c.options,a||{}),c.items.init(!0),c.items.array.length>0?(c.setup.bind(),c.modal.reinit(c.options),FooBox.handlers.call(c,"reinit",c.options),c.raise("foobox.reinitialized")):c.destroy()},this.destroy=function(){FooBox.addons.call(c,"destroy"),FooBox.handlers.call(c,"destroy"),c.items.destroy(),c.modal.destroy(),c.element.removeClass("fbx-instance fbx-item").data({fbx_instance:null,fbx_p_instance:null}),c.id==FooBox.instances.length?FooBox.instances.splice(c.id-1,1):FooBox.instances[c.id-1]=null,c.raise("foobox.destroy")},this.setup={bind:function(){a(c.options.externalSelector).off("click.fooboxExternal").on("click.fooboxExternal",function(b){b.preventDefault();var c=a(this).data("foobox"),d=a(c),e=d.data("fbx_instance")||d.data("fbx_p_instance");return d.length>0&&e instanceof FooBox.Instance&&e.modal instanceof FooBox.Modal&&e.modal.show(!0),!1})}},this.items={array:[],indexes:{prev:-1,current:0,next:1,direction:"*",set:function(a){var b=c.items.indexes.current;a=a||0,a=a>c.items.array.length-1?0:0>a?c.items.array.length-1:a;var d=a-1,e=a+1;c.items.indexes.current=a,c.items.indexes.prev=0>d?c.items.array.length-1:d,c.items.indexes.next=e>c.items.array.length-1?0:e,c.items.indexes.direction=c.items.indexes._direction(b,a,c.items.array.length-1)},_direction:function(a,b,c){return 0==b&&a==c?">":b==c&&0==a?"<":b>a?">":a>b?"<":"*"}},new_array:function(b){b=b||!1;var d,e,f,g=0;if(1==b){if(c.items.array.length>0){for(var h=0;h0){d.filter&&a.isArray(d.filter.items)&&(e=d.filter.items.slice(0));var f=a.map(e,function(a){return a.$anchor?a.$anchor.get(0):null});a(f).not(c.options.excludes).off("click.item").filter(function(){return c.items.add(this)}).on("click.item",c.items.clicked),c.element.on("click.item",".fbx-link",c.items.clicked)}else c.element.find(c.options.selector).not(c.options.excludes).off("click.item").filter(function(){return c.items.add(this)}).on("click.item",c.items.clicked),c.element.on("click.item",".fbx-link",c.items.clicked);c.items.rel()},destroy:function(){c.element.off("click.item",".fbx-link",c.items.clicked);var b,d;for(d=0;d0&&e<=c.items.array.length-1&&(d=c.items.array[e]),d},parse:function(b,d){b=FooBox.isjQuery(b)?b:a(b);for(var e,f,g=0;gb&&1==c.items.array[b].error)return c.items.array[b];var e,f,g=FooBox.handlers.get(c,"html"),h=!1;if(null==g&&(g=new d(c)),null!==c.options.error.match(/^#/i)&&a(c.options.error).length>0)e=a(c.options.error),h=!0;else{var i=FooBox.format('

{0}

',c.options.error);e=a(i)}return f=new FooBox.Item(g.type,e.get(0),g),f.selector=1==h?c.options.error:null,f.index=b,f.error=!0,f.title=e.data("title")||null,f.description=e.data("description")||null,f.width=e.data("width")||240||null,f.height=e.data("height")||240||null,f.content=1==h?null:e,f.fullscreen=!0,f.handler=g,c.items.array[b]=f,f},first:function(a){for(var b=null,d=0;d1},clicked:function(a){return a.preventDefault(),c.items.indexes.set(this.index),c.modal.show(!0),!1}},this},FooBox.open=function(b){var c,d=null;if("object"==typeof b){var e=document.createElement("a");a(e).foobox(b),d=a(e).data("fbx_instance")}else"number"==typeof b?c=b:(c=parseInt(b||0),c=isNaN(c)?0:c),c=c>FooBox.instances.length-1?FooBox.instances.length-1:0>c?0:c,d=FooBox.instances[c];return null!=d&&d.modal instanceof FooBox.Modal?(d.modal.show(!0),d):null},FooBox.close=function(){var a,b=[],c=null;for(a=0;a0&&a.maxHeight>0&&(a.width>a.maxWidth||a.height>a.maxHeight)){var c=a.width>a.height?a.maxWidth/a.width:a.maxHeight/a.height;a.width*=c,a.height*=c}return new b.Size(a.width,a.height)}return new b.Size(0,0)},this.hasChanged=function(a){if(b.isjQuery(a.element)){var c=d.FooBox.options.images.findUrl(d.FooBox,a.element);return a.url!=c}return!1}},b.handlers.register(b.ImageHandler,c)}(jQuery,window.FooBox),function(a,b){var c={keyboard:{enabled:!0,preventDefault:!1,stopPropagation:!1}};b.Keyboard=function(a){this.FooBox=a;var c=this;this.preinit=function(a){c.handlers.unbind(!0),a.on({"foobox.initialized foobox.reinitialized":c.handlers.initialized,"foobox.setupHtml":c.handlers.setupHtml})},this.destroy=function(){c.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&c.FooBox.element.off({"foobox.initialized foobox.reinitialized":c.handlers.initialized,"foobox.setupHtml":c.handlers.setupHtml}),c.FooBox.element.off("foobox.afterLoad",c.handlers.afterLoad),b.isjQuery(c.FooBox.modal.element)&&c.FooBox.modal.element.off("keydown.foobox",c.handlers.onKeydown)},initialized:function(){c.handlers.unbind(),1==c.FooBox.options.keyboard.enabled&&(c.FooBox.element.on("foobox.afterLoad",c.handlers.afterLoad),b.isjQuery(c.FooBox.modal.element)&&c.FooBox.modal.element.on("keydown.foobox",c.handlers.onKeydown))},setupHtml:function(a){a.fb.modal.attr("tabindex",0)},afterLoad:function(a){a.fb.modal.focus()},onKeydown:function(a){var b=c.FooBox.modal,d=c.FooBox.options.keyboard;b.element.hasClass("fbx-show")&&(b.element.hasClass("fbx-fullscreen-mode")||27!==a.which?c.FooBox.items.multiple()&&37===a.which?b.prev():c.FooBox.items.multiple()&&39===a.which&&b.next():b.close(),1==d.preventDefault&&a.preventDefault(),1==d.stopPropagation&&a.stopPropagation(),c.FooBox.raise("foobox.keydown",{keyCode:a.which}))}}},b.addons.register(b.Keyboard,c)}(jQuery,window.FooBox),function(a,b){var c={hideNavOnMobile:!1,resizeTimeout:300,breakpoints:{phone:812,tablet:1366},iosInterval:200};b.BPInfo=function(b){var c=a(window);this.width=c.width(),this.height=c.height(),this.orientation=this.width>this.height?"fbx-landscape":"fbx-portrait";var d,e=null;if(a.isArray(b))for(var f=0;f=c?(e=!0,d.iosRedraw()):(null==e||1==e)&&c>=h&&(e=!1,d.iosRedraw()),d.timers.ios.start(d.handlers.ios,d.FooBox.options.iosInterval)}},this.setup={breakpoints:function(){d.breakpoint.values=[],d.breakpoint.names="";for(var a in d.FooBox.options.breakpoints)d.FooBox.options.breakpoints.hasOwnProperty(a)&&(d.breakpoint.values.push({name:d.fixName(a),width:d.FooBox.options.breakpoints[a]}),d.breakpoint.names+=d.fixName(a)+" ");d.breakpoint.values.sort(function(a,b){return a.width-b.width})}},this.iosRedraw=function(){window.scrollTo(0,document.body.scrollTop),a(window).trigger("resize")},this.fixName=function(a){return/^fbx-[a-zA-Z0-9]/.test(a)?a:"fbx-"+a},this.style=function(){var a=new b.BPInfo(d.breakpoint.values),c=d.FooBox.modal.element;c.removeClass(d.breakpoint.names).removeClass("fbx-desktop fbx-landscape fbx-portrait").addClass(a.breakpoint).addClass(a.orientation),d.FooBox.options.hideNavOnMobile===!0?c.addClass("fbx-no-nav"):c.removeClass("fbx-no-nav")}},b.Responsive.metaCheck=function(){var b=a("meta[name=viewport]"),c=b.attr("content");if(b.length>0&&"string"==typeof c){for(var d=c.split(","),e=!1,f=!1,g=0;g",{"class":"fbx-caption"}),e=a("",{"class":"fbx-open-caption",html:"…"}).on("click.captions",d.handlers.toggleCaptions);"string"==typeof b.fb.options.modalClass&&-1!=b.fb.options.modalClass.indexOf("fbx-sticky-caption")?b.fb.modal.append(c,e):(b.fb.modal.find(".fbx-stage").append(c),b.fb.modal.find(".fbx-inner").append(e))},setupOptions:function(a){a.fb.modal.find(".fbx-caption").addClass(d.animation())},beforeClose:function(a){1!=a.fb.options.captions.onlyShowOnHover&&a.fb.modal.find(".fbx-caption").addClass("fbx-hide-caption")},beforeLoad:function(a){1!=a.fb.options.captions.onlyShowOnHover&&a.fb.modal.find(".fbx-caption").addClass(d.animation())},afterLoad:function(a){var b=a.fb.item;return!b||b.error||b.captionLoaded||(a.fb.instance.raise("foobox.alterCaption",{element:a.fb.element,item:b}),b.captionLoaded=!0),1==a.fb.options.captions.onlyShowOnHover?void d.update():void(0==a.fb.options.captions.onlyShowOnClick&&d.show())},onError:function(a){a.fb.modal.find(".fbx-caption").addClass(d.animation())},parseItem:function(c){var e=c.fb.options.captions;if(c.fb.item.captions&&0!=e.enabled){var f,g,h="";if(null!=c.fb.element){var i=a(c.fb.element).data("titleSource")||a(c.fb.instance.element).data("titleSource")||e.titleSource,j=a(c.fb.element).data("descSource")||a(c.fb.instance.element).data("descSource")||e.descSource;"none"!=i&&(f=c.fb.element.data("captionTitle")||c.fb.element.data("title")||d.text(c.fb.element,i)),"none"!=j&&(g=c.fb.element.data("captionDesc")||c.fb.element.data("description")||d.text(c.fb.element,j))}else f=c.fb.item.title,g=c.fb.item.description;f=null==f||"undefined"==typeof f?"":f+"",g=null==g||"undefined"==typeof g?"":g+"",f&&f==g&&(g=null),h="string"==typeof f&&f.length>0?b.format('
{0}
',f):h,h="string"==typeof g&&g.length>0?h+b.format('
{0}
',g):h,c.fb.item.title=f,c.fb.item.description=g,c.fb.item.caption=h,c.fb.instance.raise("foobox.createCaption",{element:c.fb.element,item:c.fb.item})}}},this.text=function(b,c){var e;switch(c){case"find":e=a.trim(b.data("enviraCaption")||b.data("title")||b.attr("title")||b.find("img:first").data("title")||b.find("img:first").data("alt")||b.find("img:first").attr("title")||b.find("img:first").attr("alt"));break;case"image_find":e=a.trim(b.find("img:first").data("title")||b.find("img:first").data("alt")||b.find("img:first").attr("title")||b.find("img:first").attr("alt"));break;case"image":e=a.trim(b.find("img:first").data("title")||b.find("img:first").attr("title"));break;case"image_alt":e=a.trim(b.find("img:first").data("alt")||b.find("img:first").attr("alt"));break;case"anchor":e=a.trim(b.data("enviraCaption")||b.data("title")||b.attr("title"));break;default:e=null}return d.FooBox.options.captions.prettify&&(e=d.prettifier(e)),e},this.animation=function(){switch(d.FooBox.options.captions.animation){case"fade":return"fbx-fade-caption";case"slide":return"fbx-slide-caption";default:return"fbx-hide-caption"}},this.hide=function(){var a=d.FooBox.items.current(),b=d.FooBox.modal.element.find(".fbx-caption");return d.FooBox.options.captions.enabled&&a.captions&&"string"==typeof a.caption&&0!=a.caption.length?(b.addClass(d.animation()),void d.FooBox.raise("foobox.captionsHide",{item:a})):void b.addClass("fbx-hide-caption")},this.show=function(){var a=d.FooBox,c=a.items.current(),e=a.modal.element.find(".fbx-caption");return!a.options.captions.enabled||!c.captions||"string"!=typeof c.caption||0==c.caption.length||a.modal.element.hasClass("fbx-captions-hidden")||b.isjQuery(c.element)&&c.element.hasClass("no-captions")?void e.addClass("fbx-hide-caption"):(d.update(),e.removeClass("fbx-fade-caption fbx-slide-caption fbx-hide-caption"),void d.FooBox.raise("foobox.captionsShow",{item:c}))},this.update=function(){var c=d.FooBox.items.current(),e=d.FooBox.modal.element.find(".fbx-caption");e.html(c.caption).find('a[href^="#"]').filter(function(){var c=a(this).attr("href"),d=a(c),e=d.data("fbx_instance")||d.data("fbx_p_instance");return d.length>0&&e instanceof b.Instance?(a(this).data("hrefTarget",d.get(0)),!0):!1}).off("click.captions").on("click.captions",function(c){c.preventDefault();var e=a(this).data("hrefTarget"),f=a(e).data("fbx_instance")||a(e).data("fbx_p_instance");return f instanceof b.Instance&&(d.FooBox.modal.close(),f.items.indexes.set(e.index),f.modal.show()),!1}),a("
",{"class":"fbx-close-caption",html:"×"}).on("click.captions",d.handlers.toggleCaptions).prependTo(e)},this.prettifier=function(a){return"string"!=typeof a?null:(a=a.replace(/\s*-\d+/g,"").replace(/\s*_\d+/g,"").replace(/-/g," ").replace(/_/g," "),a=a.replace(/\w\S*/g,function(a){return-1!=a.indexOf("#")?a:a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}))}},b.addons.register(b.Captions,c)}(jQuery,window.FooBox),function(a,b){var c={wordpress:{enabled:!1}};b.Wordpress=function(c){this.FooBox=c;var d=this;this.preinit=function(a){d.handlers.unbind(!0),a.on("foobox.createCaption",d.handlers.onCreateCaption)},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&d.FooBox.element.off("foobox.createCaption",d.handlers.onCreateCaption)},onCreateCaption:function(c){var d=c.fb.options,e=c.fb.instance.element,f=c.fb.item.element,g="",h=c.fb.item.title,i=c.fb.item.description;if(1==d.wordpress.enabled&&b.isjQuery(f)){var j=f.data("captionTitle")||f.data("title"),k=f.data("captionDesc")||f.data("description");if(e.hasClass("gallery"))d.captions.overrideTitle===!1&&(h=j||f.parents(".gallery-item:first").find(".wp-caption-text:first").html()||f.parents(".gallery-item:first").find(".gallery-caption:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.find("img").attr("alt")||i||"");else if(e.hasClass("wp-caption")||f.hasClass("wp-caption"))d.captions.overrideTitle===!1&&(h=j||f.find("img").attr("title")||f.parents(".wp-caption:first").find(".wp-caption-text:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.find("img").attr("alt")||i||"");else if(f.parents(".wp-caption:first").length>0)d.captions.overrideTitle===!1&&(h=j||f.parents(".wp-caption:first").find("img").attr("title")||f.parents(".wp-caption:first").find(".wp-caption-text:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.parents(".wp-caption:first").find("img").attr("alt")||i||"");else if(e.hasClass("tiled-gallery"))d.captions.overrideTitle===!1&&(h=j||f.parents(".tiled-gallery-item:first").find(".tiled-gallery-caption").html()||f.find("img").data("image-title")||f.find("img").attr("title")||h||""),d.captions.overrideDesc===!1&&(i=k||a.trim(f.find("img").data("image-description")).replace(/(^

)|(<\/p>$)/gi,"")||i||"");else{if(!e.hasClass("wp-block-gallery")&&!e.hasClass("wp-block-image"))return;d.captions.overrideTitle===!1&&(h=j||f.parents("figure:first").find("figcaption").html()||h||""),d.captions.overrideDesc===!1&&(i=k||i||"")}h+="",i+="",h=h||"",i=i||"";var l=a("

"),m=l.html(h).text(),n=l.html(i).text();(a.trim(h)==a.trim(i)||m==n)&&(i=null),g="string"==typeof h&&h.length>0?b.format('
{0}
',h):g,g="string"==typeof i&&i.length>0?g+b.format('
{0}
',i):g,c.fb.item.title=h,c.fb.item.description=i,c.fb.item.caption=g}}}},b.addons.register(b.Wordpress,c)}(jQuery,window.FooBox),function(a,b){var c={pan:{enabled:!0,showOverview:!0,position:"fbx-top-right"}};b.Pan=function(c){this.FooBox=c;var d,e,f,g,h=this,i=!1,j=!1,k=null,l=null,m=null,n=null,o=null,p=0;this.preinit=function(a){h.handlers.unbind(!0),a.on({"foobox.initialized foobox.reinitialized":h.handlers.initialized})},this.destroy=function(){h.handlers.unbind(!0)},this.setOverview=function(){var a=parseInt(n.css("max-width")),b=parseInt(n.css("max-height")),c=a/k.width,d=b/k.height;p=c>d?d:c;var e=k.width*p,f=k.height*p;n.width(e).height(f).css("background-image","url("+k.url+")")},this.setViewport=function(){var a=m.width(),b=m.height(),c=a*p,d=b*p;o.width(c).height(d)},this.disableCaptionImageClick=function(){var a=h.FooBox.modal.element,c=b.objects.get("addons",h.FooBox,function(a){return a instanceof b.Captions});c&&a.find(".fbx-item-current, .fbx-item-next").off("click.captions",c.handlers.toggleCaptions)},this.enableCaptionImageClick=function(){var a=h.FooBox.modal.element,c=b.objects.get("addons",h.FooBox,function(a){return a instanceof b.Captions});c&&a.find(".fbx-item-current, .fbx-item-next").on("click.captions",c.handlers.toggleCaptions)},this.handlers={unbind:function(a){a=a||!1,a&&h.FooBox.element.off({"foobox.initialized foobox.reinitialized":h.handlers.initialized}),h.FooBox.element.off({"foobox.afterLoad":h.handlers.onAfterLoad,"foobox.showOverflow":h.handlers.onShowOverflow,"foobox.hideOverflow foobox.beforeLoad":h.handlers.onHideOverflow}),h.FooBox.modal instanceof b.Modal&&b.isjQuery(h.FooBox.modal.element)&&h.FooBox.modal.element.find(".fbx-stage").off({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,mouseup:h.handlers.onMouseUp}).removeClass("fbx-pannable fbx-panning")},initialized:function(a){h.handlers.unbind(),a.fb.options.pan.enabled===!0&&h.FooBox.element.on({"foobox.close":h.handlers.onMouseUp,"foobox.afterLoad":h.handlers.onAfterLoad,"foobox.showOverflow":h.handlers.onShowOverflow,"foobox.hideOverflow foobox.beforeLoad":h.handlers.onHideOverflow})},onAfterLoad:function(a){i===!0&&"image"==a.fb.item.handler.type&&(h.setOverview(),h.setViewport())},onShowOverflow:function(b){"image"==b.fb.item.handler.type&&(i===!0?(h.setOverview(),h.setViewport()):(i=!0,h.disableCaptionImageClick(),k=b.fb.item,m=h.FooBox.modal.element.addClass("fbx-pannable-item").find(".fbx-stage").on({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,"mouseup mouseleave":h.handlers.onMouseUp}).addClass("fbx-pannable"),l=b.fb.container,b.fb.options.pan.showOverview===!0&&(n=a("
",{"class":"fbx-pan-overview"}).addClass(b.fb.options.pan.position).on("click",h.handlers.onOverviewClick).appendTo(m),o=a("
",{"class":"fbx-pan-viewport"}).appendTo(n),l.on("scroll",h.handlers.onScroll),h.setOverview(),h.setViewport())))},onHideOverflow:function(a){i===!0&&(i=!1,h.enableCaptionImageClick(),a.fb.options.pan.showOverview===!0&&n.remove(),l.off("scroll",h.handlers.onScroll),m.off({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,"mouseup mouseleave":h.handlers.onMouseUp}).removeClass("fbx-pannable fbx-panning"),h.FooBox.modal.element.removeClass("fbx-pannable-item"))},onMouseDown:function(a){if(i===!0){a.preventDefault(),m.addClass("fbx-panning");var b=l.get(0);j=!0,d=a.pageX,e=a.pageY,f=b.scrollLeft,g=b.scrollTop}},onMouseMove:function(a){if(j===!0&&i===!0){var b=l.get(0);b.scrollLeft=f-(a.pageX-d),b.scrollTop=g-(a.pageY-e)}},onMouseUp:function(){i===!0&&(j=!1,m.removeClass("fbx-panning"),d=0,e=0,f=0,g=0)},onScroll:function(){var a=l.get(0),b=a.scrollTop/k.height*100,c=a.scrollLeft/k.width*100;o.css({top:b+"%",left:c+"%"})},onOverviewClick:function(b){var c=a(this).offset(),d=(b.pageX-c.left)/p,e=(b.pageY-c.top)/p,f=d-l.width()/2,g=e-l.height()/2;l.animate({scrollTop:g,scrollLeft:f},300)}}},b.addons.register(b.Pan,c)}(jQuery,window.FooBox),function(a,b){var c={swipe:{enabled:!0,min:80}};b.Swipe=function(a){this.FooBox=a,this.isMoving=!1;var c,d=this;this.preinit=function(a){d.handlers.unbind(!0),a.on("foobox.initialized foobox.reinitialized",d.handlers.initialized)},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&d.FooBox.element.off("foobox.initialized foobox.reinitialized",d.handlers.initialized),d.FooBox.modal instanceof b.Modal&&b.isjQuery(d.FooBox.modal.element)&&d.FooBox.modal.element.off({touchstart:d.handlers.onTouchStart,touchmove:d.handlers.onTouchMove})},initialized:function(a){d.handlers.unbind(),a.fb.options.swipe.enabled===!0&&a.fb.modal.on("touchstart",d.handlers.onTouchStart)},onTouchStart:function(a){var b=a.originalEvent.touches||a.touches;1==b.length&&d.FooBox.items.multiple()&&(c=b[0].pageX,d.isMoving=!0,d.FooBox.modal.element.on("touchmove",d.handlers.onTouchMove))},onTouchMove:function(a){if(d.isMoving){var b=a.originalEvent.touches||a.touches,e=b[0].pageX,f=c-e;Math.abs(f)>=d.FooBox.options.swipe.min&&(d.cancelTouch(),f>0?(d.FooBox.raise("foobox.swipeRight"),d.FooBox.modal.next()):(d.FooBox.raise("foobox.swipeLeft"),d.FooBox.modal.prev()))}}},this.cancelTouch=function(){d.FooBox.modal.element.off("touchmove",d.handlers.onTouchMove),c=null,d.isMoving=!1}},b.addons.register(b.Swipe,c)}(jQuery,window.FooBox);