Sid Gifari File Manager
🏠 Root
/
home1
/
immorth6
/
public_html
/
website_efd5428f
/
wp-content
/
plugins
/
easy-fancybox
/
fancybox
/
2.2.0
/
Editing: jquery.fancybox.min.js
!function(e,t,o,n){"use strict";var i=o("html"),a=o(e),r=o(t),l=o.fancybox=function(){l.open.apply(this,arguments)},s=navigator.userAgent.match(/msie/i),c=null,p="ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,d=function(e){return e&&e.hasOwnProperty&&e instanceof o},f=function(e){return e&&"string"===o.type(e)},h=function(e){return f(e)&&e.indexOf("%")>0},u=function(e,t){var o=parseInt(e,10)||0;return t&&h(e)&&(o=l.getViewport()[t]/100*o),Math.ceil(o)},g=function(e,t){return u(e,t)+"px"};o.extend(l,{version:"2.2.0",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:e.devicePixelRatio||1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!p,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,minVpWidth:320,minVpHeight:320,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,zoomClick:!1,mouseWheel:!0,swipe:p,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",allowfullscreen:!0,preload:!0},svg:{},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" allow="autoplay; encrypted-media;"'+(s?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">{error}</p>',close:`<a title="${DOMPurify.sanitize(e.efb_i18n&&e.efb_i18n.close||"Close")}" class="fancybox-item fancybox-close" href="javascript:;"></a>`,next:`<a title="${DOMPurify.sanitize(e.efb_i18n&&e.efb_i18n.next||"Next")}" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>`,prev:`<a title="${DOMPurify.sanitize(e.efb_i18n&&e.efb_i18n.prev||"Previous")}" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>`,loading:'<div id="fancybox-loading"><div></div></div>'},txt:{error:{content:"The requested content cannot be loaded.<br/>Please try again later.",image:"The requested image cannot be loaded.<br/>Please try again later.",ajax:"An AJAX error occurred.<br/>Please contact the site administrator.",href:"Missing media target URL.<br/>Please contact the site administrator."},close:e.efb_i18n&&e.efb_i18n.close||"Close",next:e.efb_i18n&&e.efb_i18n.next||"Next",prev:e.efb_i18n&&e.efb_i18n.prev||"Previous"},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:o.noop,beforeLoad:o.noop,afterLoad:o.noop,beforeShow:o.noop,afterShow:o.noop,beforeChange:o.noop,beforeClose:o.noop,afterClose:o.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(e,t){if(e){if(o.isPlainObject(t)||(t={}),!1!==l.close(!0))return o.isArray(e)||(e=d(e)?o(e).get():[e]),o.each(e,function(i,a){var r,s,c,p,h,u,g,m={};"object"===o.type(a)&&(a.nodeType&&(a=o(a)),d(a)?(m={href:a.data("fancybox-href")||a.attr("href"),title:o("<div/>").text(a.data("fancybox-title")||a.attr("title")||"").html(),isDom:!0,element:a},o.metadata&&o.extend(!0,m,a.metadata())):m=a),r=t.href||m.href||(f(a)?a:null),s=n!==t.title?t.title:m.title||"",(p=(c=t.content||m.content)?"html":t.type||m.type)||!m.isDom||(p=a.data("fancybox-type"))||(p=(h=a.prop("class").match(/fancybox\.(\w+)/))?h[1]:null),f(r)&&(!p&&(l.isImage(r)?p="image":l.isSVG(r)?p="svg":"#"===r.charAt(0)?p="inline":f(a)&&(p="html",c=a)),"ajax"===p&&(r=(u=r.split(/\s+/,2)).shift(),g=u.shift())),c||("inline"===p?r?c=o(f(r)?r.replace(/.*(?=#[^\s]+$)/,""):r):m.isDom&&(c=a):"html"===p?c=r:p||r||!m.isDom||(p="inline",c=a)),o.extend(m,{href:r,type:p,content:c,title:s,selector:g}),e[i]=m}),l.opts=o.extend(!0,{},l.defaults,t),n!==t.keys&&(l.opts.keys=!!t.keys&&o.extend({},l.defaults.keys,t.keys)),l.group=e,l._start(l.opts.index)}},cancel:function(){var e=l.coming;if(!e||!1!==l.trigger("onCancel"))l.hideLoading(),e&&(l.ajaxLoad&&l.ajaxLoad.abort(),l.ajaxLoad=null,l.imgPreload&&(l.imgPreload.onload=l.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),l.coming=null,l.current||l._afterZoomOut(e))},close:function(e){if(l.cancel(),!1!==l.trigger("beforeClose"))l.unbindEvents(),l.isActive&&(l.isOpen&&!0!==e?(l.isOpen=l.isOpened=!1,l.isClosing=!0,o(".fancybox-item, .fancybox-nav").remove(),l.wrap.stop(!0,!0).removeClass("fancybox-opened"),l.transitions[l.current.closeMethod]()):(o(".fancybox-wrap").stop(!0).trigger("onReset").remove(),l._afterZoomOut()))},play:function(e){var t=function(){clearTimeout(l.player.timer)},o=function(){t(),l.current&&l.player.isActive&&(l.player.timer=setTimeout(l.next,l.current.playSpeed))},n=function(){t(),r.off(".player"),l.player.isActive=!1,l.trigger("onPlayEnd")};!0!==e&&(l.player.isActive||!1===e)?n():l.current&&(l.current.loop||l.current.index<l.group.length-1)&&(l.player.isActive=!0,r.on({"onCancel.player beforeClose.player":n,"onUpdate.player":o,"beforeLoad.player":t}),o(),l.trigger("onPlayStart"))},swipe:function(e,t,o){e>o||t>o?(l.wrap.off("touchstart.fb touchmove.fb touchend.fb mouseup.fb mousedown.fb mousemove.fb mousewheel.fb"),l.next(t>o?"up":"left")):(e<-o||t<-o)&&(l.wrap.off("touchstart.fb touchmove.fb touchend.fb mouseup.fb mousedown.fb mousemove.fb mousewheel.fb"),l.prev(t<-o?"down":"right"))},next:function(e){var t=l.current;t&&(f(e)||(e=t.direction.next),l.jumpto(t.index+1,e,"next"))},prev:function(e){var t=l.current;t&&(f(e)||(e=t.direction.prev),l.jumpto(t.index-1,e,"prev"))},jumpto:function(e,t,o){var i=l.current;i&&(e=u(e),l.direction=t||i.direction[e>=i.index?"next":"prev"],l.router=o||"jumpto",i.loop&&(e<0&&(e=i.group.length+e%i.group.length),e%=i.group.length),n!==i.group[e]&&(l.cancel(),l.isJumping=!0,l._start(e)))},canScroll:function(e){let t=!1,n=o(e);for(;n.length;){var i;if(t||n.is(".fancybox-skin")||n.is(".fancybox-wrap"))break;t=(i=n[0])&&!(i.style.overflow&&"hidden"===i.style.overflow)&&(i.clientWidth&&i.scrollWidth>i.clientWidth||i.clientHeight&&i.scrollHeight>i.clientHeight),n=o(n).parent()}return t},reposition:function(e,t){var n,i=l.current,a=i?i.wrap:null;a&&(n=l._getPosition(t),e&&"scroll"===e.type?(delete n.position,a.stop(!0,!0).animate(n,200)):(a.css(n),i.pos=o.extend({},i.dim,n)))},update:function(e){var t=e&&e.originalEvent&&e.originalEvent.type,o=!t||"orientationchange"===t;o&&(clearTimeout(c),c=null),l.isOpen&&!c&&(c=setTimeout(function(){var n=l.current;n&&!l.isClosing&&(l.wrap.removeClass("fancybox-tmp"),(o||"load"===t||"resize"===t&&n.autoResize)&&l._setDimension(),"scroll"===t&&n.canShrink||l.reposition(e),n.zoomClick&&l.inner.css("cursor",n.canExpand?"zoom-in":"zoom-out"),l.trigger("onUpdate"),c=null)},o&&!p?0:300))},toggle:function(e){l.isOpen&&(l.current.fitToView="boolean"===o.type(e)?e:!l.current.fitToView,p&&(l.wrap.removeAttr("style").addClass("fancybox-tmp"),l.trigger("onUpdate")),l.update())},hideLoading:function(){r.off(".loading"),o("#fancybox-loading").remove()},showLoading:function(){var e,t;l.hideLoading(),e=o(l.opts.tpl.loading).on("click",l.cancel).appendTo("body"),r.on("keydown.loading",function(e){if(27===(e.which||e.keyCode))return l.cancel(),e.preventDefault(),!1}),l.defaults.fixed||(t=l.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x})),l.trigger("onLoading")},getViewport:function(){var t=l.current&&l.current.locked||!1,o={x:a.scrollLeft(),y:a.scrollTop()};return t&&t.length?(o.w=t[0].clientWidth,o.h=t[0].clientHeight):(o.w=p&&e.innerWidth?e.innerWidth:a.width(),o.h=p&&e.innerHeight?e.innerHeight:a.height()),o},unbindEvents:function(){l.wrap&&d(l.wrap)&&l.wrap.off(".fb"),r.off(".fb"),a.off(".fb")},bindEvents:function(){var e,t=l.current;t&&(a.on("orientationchange.fb"+(p?"":" resize.fb")+(t.autoCenter&&!t.locked?" scroll.fb":""),l.update),(e=t.keys)&&r.on("keydown.fb",function(i){var a=i.which||i.keyCode,r=i.target||i.srcElement;if(27===a&&l.coming)return!1;i.ctrlKey||i.altKey||i.shiftKey||i.metaKey||r&&(r.type||o(r).is("[contenteditable]"))||o.each(e,function(e,r){return t.group.length>1&&n!==r[a]?(l[e](r[a]),i.preventDefault(),!1):o.inArray(a,r)>-1?(l[e](),i.preventDefault(),!1):void 0})}),t.group.length>1&&(l.wrap.css("cursor","move"),l.wrap.on("mousedown.fb",function(e){let t={};e.preventDefault(),t.startX=void 0!==e.clientX?e.clientX:e.originalEvent.clientX,t.startY=void 0!==e.clientY?e.clientY:e.originalEvent.clientY,l.wrap.on("mousemove.fb",function(e){e.preventDefault(),t.endX=void 0!==e.clientX?e.clientX:e.originalEvent.clientX,t.endY=void 0!==e.clientY?e.clientY:e.originalEvent.clientY}),l.wrap.on("mouseup.fb",function(){l.wrap.off("mousemove.fb"),l.swipe(t.startX-t.endX,t.startY-t.endY,100)})}),t.swipe&&(l.wrap.on("touchstart.fb",function(e){let o=e.target||null,n={},i=void 0!==e.touches?e.touches.length:e.originalEvent.touches.length;!(t.canShrink||i>1||l.canScroll(o))&&(e.preventDefault(),n.startX=void 0!==e.touches?e.touches[0].clientX:e.originalEvent.touches[0].clientX,n.startY=void 0!==e.touches?e.touches[0].clientY:e.originalEvent.touches[0].clientY,l.wrap.on("touchmove.fb",function(e){if((i=void 0!==e.touches?e.touches.length:e.originalEvent.touches.length)>1)return;e.preventDefault();let t=void 0!==e.touches?e.touches[0].clientX:e.originalEvent.touches[0].clientX,o=void 0!==e.touches?e.touches[0].clientY:e.originalEvent.touches[0].clientY;l.swipe(n.startX-t,n.startY-o,100)}))}),l.wrap.on("touchend.fb",function(){l.wrap.off("touchmove.fb")})),o.fn.mousewheel&&t.mouseWheel&&l.wrap.on("mousewheel.fb",function(e,o,n,i){let a=e.target||null;!(t.canShrink||0===o||l.canScroll(a))&&(e.preventDefault(),l.swipe(-n,-i,0))})))},trigger:function(e,t){var n,i=t||l.coming||l.current;if(i){if(o.isFunction(i[e])&&(n=i[e].apply(i,Array.prototype.slice.call(arguments,1))),!1===n)return!1;i.helpers&&o.each(i.helpers,function(t,n){n&&l.helpers[t]&&o.isFunction(l.helpers[t][e])&&l.helpers[t][e](o.extend(!0,{},l.helpers[t].defaults,n),i)})}r.trigger(e)},isImage:function(e){return f(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSVG:function(e){return f(e)&&e.match(/\.(svg)((\?|#).*)?$/i)},_start:function(e){var t,n,i,a,r,s={};if(e=u(e),!(t=l.group[e]||null))return!1;if(a=(s=o.extend(!0,{},l.opts,t)).margin,r=s.padding,"number"===o.type(a)&&(s.margin=[a,a,a,a]),"number"===o.type(r)&&(s.padding=[r,r,r,r]),s.modal&&o.extend(!0,s,{closeBtn:!1,closeClick:!1,nextClick:!1,zoomClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),s.autoSize&&(s.autoWidth=s.autoHeight=!0),"auto"===s.width&&(s.autoWidth=!0),"auto"===s.height&&(s.autoHeight=!0),s.group=l.group,s.index=e,l.coming=s,!1===l.trigger("beforeLoad")){l.coming=null;return}if(i=s.type,n=s.href,!i)return l.coming=null,!!l.current&&!!l.router&&"jumpto"!==l.router&&(l.current.index=e,l[l.router](l.direction));if(l.isActive=!0,("image"===i||"svg"===i)&&(s.autoHeight=s.autoWidth=!1,s.scrolling="visible",s.aspectRatio=!0),"iframe"===i&&p&&(s.scrolling="scroll"),s.wrap=o(s.tpl.wrap).addClass("fancybox-"+(p?"mobile":"desktop")+" fancybox-type-"+i+" fancybox-tmp "+s.wrapCSS).appendTo(s.parent||"body"),o.extend(s,{skin:o(".fancybox-skin",s.wrap),outer:o(".fancybox-outer",s.wrap),inner:o(".fancybox-inner",s.wrap)}),o.each(["Top","Right","Bottom","Left"],function(e,t){s.skin.css("padding"+t,g(s.padding[e]))}),l.trigger("onReady"),"inline"===i||"html"===i){if(!s.content||!s.content.length)return l._error("content")}else if(!n)return l._error("href");"image"===i?l._loadImage():"ajax"===i?l._loadAjax():"iframe"===i?l._loadIframe():l._afterLoad()},_error:function(e){let t=l.coming.txt.error[e]||l.coming.txt.error.content;arguments.length>1&&(t=t+"<br/><br/>"+arguments[1]),o.extend(l.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",content:l.coming.tpl.error.replace(/\{error\}/g,t)}),l._afterLoad()},_loadImage:function(){var e=l.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,l.coming.width=this.width/l.opts.pixelRatio,l.coming.height=this.height/l.opts.pixelRatio,l._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,l._error("image")},e.src=l.coming.href,!0!==e.complete&&l.showLoading()},_loadAjax:function(){var e=l.coming;l.showLoading(),l.ajaxLoad=o.ajax(o.extend({},e.ajax,{url:e.href,error:function(e,t){l.coming&&"abort"!==t?l._error("ajax",e):l.hideLoading()},success:function(t,o){"success"===o&&(e.content=t,l._afterLoad())}}))},_loadIframe:function(){var e=l.coming,t=o(e.tpl.iframe.replace(/\{rnd\}/g,new Date().getTime())).attr({scrolling:p?"auto":e.iframe.scrolling,src:e.href,webkitallowfullscreen:e.iframe.allowfullscreen,mozallowfullscreen:e.iframe.allowfullscreen,allowfullscreen:e.iframe.allowfullscreen});o(e.wrap).on("onReset",function(){try{o(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}}),e.iframe.preload&&(l.showLoading(),t.one("load",function(){o(this).data("ready",1),p||o(this).on("load.fb",l.update),o(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),l._afterLoad()})),e.content=t.appendTo(e.inner),e.iframe.preload||l._afterLoad()},_preloadImages:function(){var e,t,o=l.group,n=l.current,i=o.length,a=n.preload?Math.min(n.preload,i-1):0;for(t=1;t<=a;t+=1)"image"===(e=o[(n.index+t)%i]).type&&e.href&&(new Image().src=e.href)},_afterLoad:function(){var e,t,n,i,a,r=l.coming,s=l.current,c="fancybox-placeholder";if(l.hideLoading(),r&&!1!==l.isActive){if(!1===l.trigger("afterLoad",r,s)){r.wrap.stop(!0).trigger("onReset").remove(),l.coming=null;return}switch(s&&(l.trigger("beforeChange",s),s.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),l.unbindEvents(),e=r,t=r.content,n=r.type,i=r.scrolling,o.extend(l,{wrap:e.wrap,skin:e.skin,outer:e.outer,inner:e.inner,current:e,previous:s}),a=e.href,n){case"image":t=e.tpl.image.replace(/\{href\}/g,a);break;case"svg":t='<object type="image/svg+xml" width="100%" height="100%" data="'+a+'"></object>';break;case"inline":case"ajax":case"html":e.selector?t=o("<div>").html(t).find(e.selector):d(t)&&(t.data(c)||t.data(c,t.clone().removeAttr("id").addClass(c).insertAfter(t)),t=t.detach(),e.wrap.on("onReset",function(){o(this).find(t).length&&t.replaceAll(t.data(c)).data(c,!1)}))}d(t)&&t.parent().is(e.inner)||e.inner.append(t),l.trigger("beforeShow"),e.inner.css("overflow","yes"===i?"scroll":"no"===i?"hidden":i),l._setDimension(),l.reposition(),l.isOpen=!1,l.coming=null,l.bindEvents(),l.isOpened?s.prevMethod&&l.transitions[s.prevMethod]():o(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),l.transitions[l.isOpened?e.nextMethod:e.openMethod](),l._preloadImages()}},_setDimension:function(){var e,t,n,i,a,r,s,c,p,d,f,m,v,y,x,w=l.getViewport(),b=0,$=!1,_=!1,k=l.wrap,C=l.skin,E=l.inner,S=l.current,W=S.width,O=S.height,P=S.minWidth,H=S.minHeight,L=S.maxWidth,T=S.maxHeight,R=S.scrolling,j=S.scrollOutside?S.scrollbarWidth:0,z=S.margin,A=u(z[1]+z[3]),V=u(z[0]+z[2]);if(k.add(C).add(E).width("auto").height("auto").removeClass("fancybox-tmp"),e=u(C.outerWidth(!0)-C.width()),t=u(C.outerHeight(!0)-C.height()),n=A+e,i=V+t,a=h(W)?(w.w-n)*u(W)/100:W,r=h(O)?(w.h-i)*u(O)/100:O,"iframe"===S.type){if(y=S.content,S.autoHeight&&y&&1===y.data("ready"))try{y[0].contentWindow.document.location&&(E.width(a).height(9999),x=y.contents().find("body"),j&&x.css("overflow-x","hidden"),r=x.outerHeight(!0))}catch(D){}}else(S.autoWidth||S.autoHeight)&&(E.addClass("fancybox-tmp"),S.autoWidth||E.width(a),S.autoHeight||E.height(r),S.autoWidth&&(a=E.width()),S.autoHeight&&(r=E.height()),E.removeClass("fancybox-tmp"));if(W=u(a),O=u(r),p=a/r,P=u(h(P)?u(P,"w")-n:P),L=u(h(L)?u(L,"w")-n:L),H=u(h(H)?u(H,"h")-i:H),T=u(h(T)?u(T,"h")-i:T),s=L,c=T,S.fitToView&&(L=Math.min(w.w-n,L),T=Math.min(w.h-i,T)),m=w.w-A,v=w.h-V,S.aspectRatio?(W>L&&(O=u((W=L)/p)),O>T&&(W=u((O=T)*p)),W<P&&(O=u((W=P)/p)),O<H&&(W=u((O=H)*p))):(W=Math.max(P,Math.min(W,L)),S.autoHeight&&"iframe"!==S.type&&(E.width(W),O=E.height()),O=Math.max(H,Math.min(O,T))),S.fitToView){if(E.width(W).height(O),k.width(W+e),d=k.width(),f=k.height(),S.aspectRatio)for(;(d>m||f>v)&&W>P&&O>H&&!(b++>19);)(W=u((O=Math.max(H,Math.min(T,O-10)))*p))<P&&(O=u((W=P)/p)),W>L&&(O=u((W=L)/p)),E.width(W).height(O),k.width(W+e),d=k.width(),f=k.height();else W=Math.max(P,Math.min(W,W-(d-m))),O=Math.max(H,Math.min(O,O-(f-v)))}j&&"auto"===R&&O<r&&W+e+j<m&&(W+=j),E.width(W).height(O),k.width(W+e),d=k.width(),f=k.height(),$=(d>m||f>v)&&W>P&&O>H,_=S.aspectRatio?W<s&&O<c&&W<a&&O<r:(W<s||O<c)&&(W<a||O<r),o.extend(S,{dim:{width:g(d),height:g(f)},origWidth:a,origHeight:r,canShrink:$,canExpand:_,wPadding:e,hPadding:t,wrapSpace:f-C.outerHeight(!0),skinSpace:C.height()-O}),!y&&S.autoHeight&&O>H&&O<T&&!_&&E.height("auto")},_getPosition:function(e){var t=l.current,o=l.getViewport(),n=t.margin,i=l.wrap.width()+n[1]+n[3],a=l.wrap.height()+n[0]+n[2],r={position:"absolute",top:n[0],left:n[3]};return t.autoCenter&&t.fixed&&!e&&a<=o.h&&i<=o.w?r.position="fixed":t.locked||(r.top+=o.y,r.left+=o.x),r.top=g(Math.max(r.top,r.top+(o.h-a)*t.topRatio)),r.left=g(Math.max(r.left,r.left+(o.w-i)*t.leftRatio)),r},_afterZoomIn:function(){var e=l.current;e&&(l.isOpen=l.isOpened=!0,l.wrap.css("overflow","visible").addClass("fancybox-opened").hide().show(0),l.update(),(e.zoomClick||e.closeClick||e.nextClick&&l.group.length>1)&&l.inner.css("cursor",e.zoomClick?e.canExpand?"zoom-in":"zoom-out":"pointer").on("click.fb",function(t){o(t.target).is("a")||o(t.target).parent().is("a")||(t.preventDefault(),l[e.zoomClick&&(e.canExpand||e.canShrink)?"toggle":e.closeClick?"close":"next"]())}),e.closeBtn&&o(e.tpl.close.replace(/\{close\}/g,e.txt.close)).appendTo(l.skin).on("click.fb touchend",function(e){e.preventDefault(),l.close()}),e.arrows&&l.group.length>1&&((e.loop||e.index>0)&&o(e.tpl.prev.replace(/\{prev\}/g,e.txt.prev)).appendTo(l.outer).on("click.fb touchend",l.prev),(e.loop||e.index<l.group.length-1)&&o(e.tpl.next.replace(/\{next\}/g,e.txt.next)).appendTo(l.outer).on("click.fb touchend",l.next)),l.trigger("afterShow"),e.loop||e.index!==e.group.length-1?l.opts.autoPlay&&!l.player.isActive&&(l.opts.autoPlay=!1,l.play(!0)):l.play(!1))},_afterZoomOut:function(e){e=e||l.current,o(".fancybox-wrap").trigger("onReset").remove(),o.extend(l,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),l.trigger("afterClose",e)}}),l.transitions={getOrigPosition:function(){var e=l.current,t=e.element,o=e.orig,n={},i=50,a=50,r=e.hPadding,s=e.wPadding,c=l.getViewport();return!o&&e.isDom&&t.is(":visible")&&!(o=t.find("img:first")).length&&(o=t),d(o)?(n=o.offset(),o.is("img")&&(i=o.outerWidth(),a=o.outerHeight())):(n.top=c.y+(c.h-a)*e.topRatio,n.left=c.x+(c.w-i)*e.leftRatio),("fixed"===l.wrap.css("position")||e.locked)&&(n.top-=c.y,n.left-=c.x),n={top:g(n.top-r*e.topRatio),left:g(n.left-s*e.leftRatio),width:g(i+s),height:g(a+r)}},step:function(e,t){var o,n,i,a=t.prop,r=l.current,s=r.wrapSpace,c=r.skinSpace;("width"===a||"height"===a)&&(o=t.end===t.start?1:(e-t.start)/(t.end-t.start),l.isClosing&&(o=1-o),i=e-(n="width"===a?r.wPadding:r.hPadding),l.skin[a](u("width"===a?i:i-s*o)),l.inner[a](u("width"===a?i:i-s*o-c*o)))},zoomIn:function(){var e=l.current,t=e.pos,n=e.openEffect,i="elastic"===n,a=o.extend({opacity:1},t);delete a.position,i?(t=this.getOrigPosition(),e.openOpacity&&(t.opacity=.1)):"fade"===n&&(t.opacity=.1),l.wrap.css(t).animate(a,{duration:"none"===n?0:e.openSpeed,easing:e.openEasing,step:i?this.step:null,complete:l._afterZoomIn})},zoomOut:function(){var e=l.current,t=e.closeEffect,o="elastic"===t,n={opacity:.1};o&&(n=this.getOrigPosition(),e.closeOpacity&&(n.opacity=.1)),l.wrap.animate(n,{duration:"none"===t?0:e.closeSpeed,easing:e.closeEasing,step:o?this.step:null,complete:l._afterZoomOut})},changeIn:function(){var e,t=l.current,o=t.nextEffect,n=t.pos,i={opacity:1},a=l.direction;n.opacity=.1,"elastic"===o&&(e="down"===a||"up"===a?"top":"left","down"===a||"right"===a?(n[e]=g(u(n[e])-200),i[e]="+=200px"):(n[e]=g(u(n[e])+200),i[e]="-=200px")),"none"===o?l._afterZoomIn():l.wrap.css(n).animate(i,{duration:t.nextSpeed,easing:t.nextEasing,complete:l._afterZoomIn})},changeOut:function(){var e=l.previous,t=e.prevEffect,n={opacity:.1},i=l.direction;"elastic"===t&&(n["down"===i||"up"===i?"top":"left"]=("up"===i||"left"===i?"-":"+")+"=200px"),e.wrap.animate(n,{duration:"none"===t?0:e.prevSpeed,easing:e.prevEasing,complete:function(){o(this).trigger("onReset").remove()}})}},l.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!p,fixed:!0},overlay:null,fixed:!1,el:o("html"),create:function(e){var t;e=o.extend({},this.defaults,e),this.overlay&&this.close(),t=l.coming?l.coming.parent:e.parent,this.overlay=o('<div class="fancybox-overlay"></div>').appendTo(t&&t.length?t:"body"),this.fixed=!1,e.fixed&&l.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=o.extend({},this.defaults,e),this.overlay?this.overlay.off(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(a.on("resize.overlay",o.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.on("click.overlay",function(e){if(o(e.target).hasClass("fancybox-overlay"))return l.isActive?l.close():t.close(),!1}),this.overlay.css(e.css).show()},close:function(){a.off("resize.overlay"),this.el.hasClass("fancybox-lock")&&(o(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),o(".fancybox-overlay").remove().hide(),o.extend(this,{overlay:null,fixed:!1})},update:function(){var e,o="100%";this.overlay.width(o).height("100%"),s?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),r.width()>e&&(o=r.width())):r.width()>a.width()&&(o=r.width()),this.overlay.width(o).height(r.height())},onReady:function(e,t){var n=this.overlay;o(".fancybox-overlay").stop(!0,!0),n||this.create(e),e.locked&&this.fixed&&t.fixed&&(t.locked=this.overlay.append(t.wrap),t.fixed=!1),!0===e.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){t.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&o("*:not(object)").filter(function(){return"fixed"===o(this).css("position")&&!o(this).hasClass("fancybox-overlay")&&!o(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=a.scrollTop(),this.scrollH=a.scrollLeft(),this.el.addClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!l.coming&&this.overlay.fadeOut(e.speedOut,o.proxy(this.close,this))}},l.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t,n,i=l.current,a=i.title,r=e.type;if(o.isFunction(a)&&(a=a.call(i.element,i)),f(a)&&""!==o.trim(a)){switch(t=o('<div class="fancybox-title fancybox-title-'+r+'-wrap">'+a+"</div>"),r){case"inside":n=l.skin;break;case"outside":n=l.wrap;break;case"over":n=l.inner;break;default:n=l.skin,t.appendTo("body"),s&&t.width(t.width()),t.wrapInner('<span class="child"></span>'),l.current.margin[2]+=Math.abs(u(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](n)}}},o.fn.fancybox=function(e){var t,n=o(this),i=this.selector||"",a=function(a){var r,s,c=o(this).blur(),p=t;if(!(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey)&&!c.is(".fancybox-wrap")){r=e.groupAttr||"data-fancybox-group",(s=c.attr(r))||(r="rel",s=c.get(0)[r]),s&&""!==s&&"nofollow"!==s&&(p=(c=(c=i.length?o(i):n).filter("["+r+'="'+s+'"]')).index(this)),e.index=p;var d=l.getViewport();if(e.minVpWidth&&d.w<e.minVpWidth||e.minVpHeight&&d.h<e.minVpHeight)return;if(!1!==l.open(c,e))return a.preventDefault(),!1}};return t=(e=e||{}).index||0,i&&!1!==e.live?r.undelegate(i,"click.fb-start").delegate(i+":not('.fancybox-item, .fancybox-nav')","click.fb-start",a):n.off("click.fb-start").on("click.fb-start",a),this.filter("[data-fancybox-start=1]").trigger("click"),this},r.ready(function(){var t,a,r,s;n===o.scrollbarWidth&&(o.scrollbarWidth=function(){var e=o('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),t=e.children(),n=t.innerWidth()-t.height(99).innerWidth();return e.remove(),n}),n===o.support.fixedPosition&&(o.support.fixedPosition=(s=20===(r=o('<div style="position:fixed;top:20px;"></div>').appendTo("body"))[0].offsetTop||15===r[0].offsetTop,r.remove(),s)),o.extend(l.defaults,{scrollbarWidth:o.scrollbarWidth(),fixed:o.support.fixedPosition,parent:o("body")}),t=o(e).width(),i.addClass("fancybox-lock-test"),a=o(e).width(),i.removeClass("fancybox-lock-test"),o("<style type='text/css'>.fancybox-margin{margin-right:"+(a-t)+"px;}</style>").appendTo("head")})}(window,document,jQuery);
Save
Cancel