Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 14 lines (14 sloc) 23.4 KB
/*!
* fancyBox - jQuery Plugin
* version: 2.1.3 (Tue, 23 Oct 2012)
* @requires jQuery v1.6 or later
*
* Examples at http://fancyapps.com/fancybox/
* License: www.fancyapps.com/fancybox/#license
*
* Copyright 2012 Janis Skarnelis - janis@fancyapps.com
*
* Modified by Aram Kocharyan:
* http://ak.net84.net/crayon/initialising-fancybox-with-custom-objects
*/
window.fancyboxInit=function(k,n,i,g){var d=i(k),a=i(n),o=i[g]=function(){o.open.apply(this,arguments)},c=null,e=n.createTouch!==undefined,j=function(p){return p&&p.hasOwnProperty&&p instanceof i},b=function(p){return p&&i.type(p)==="string"},l=function(p){return b(p)&&p.indexOf("%")>0},h=function(p){return(p&&!(p.style.overflow&&p.style.overflow==="hidden")&&((p.clientWidth&&p.scrollWidth>p.clientWidth)||(p.clientHeight&&p.scrollHeight>p.clientHeight)))},m=function(r,q){var p=parseInt(r,10)||0;if(q&&l(r)){p=o.getViewport()[q]/100*p}return Math.ceil(p)},f=function(p,q){return m(p,q)+"px"};i.extend(o,{version:"2.1.3",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:true,autoHeight:false,autoWidth:false,autoResize:true,autoCenter:!e,fitToView:true,aspectRatio:false,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:true,closeBtn:true,closeClick:false,nextClick:false,mouseWheel:true,autoPlay:false,playSpeed:3000,preload:3,modal:false,loop:true,ajax:{dataType:"html",headers:{"X-fancyBox":true}},iframe:{scrolling:"auto",preload:true},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},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:true,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" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(i.browser.msie?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:true,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:true,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:true,title:true},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:false,isOpen:false,isOpened:false,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:false},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(q,p){if(!q){return}if(!i.isPlainObject(p)){p={}}if(false===o.close(true)){return}if(!i.isArray(q)){q=j(q)?i(q).get():[q]}i.each(q,function(v,w){var u={},r,z,x,y,t,A,s;if(i.type(w)==="object"){if(w.nodeType){w=i(w)}if(j(w)){u={href:w.data("fancybox-href")||w.attr("href"),title:w.data("fancybox-title")||w.attr("title"),isDom:true,element:w};if(i.metadata){i.extend(true,u,w.metadata())}}else{u=w}}r=p.href||u.href||(b(w)?w:null);z=p.title!==undefined?p.title:u.title||"";x=p.content||u.content;y=x?"html":(p.type||u.type);if(!y&&u.isDom){y=w.data("fancybox-type");if(!y){t=w.prop("class").match(/fancybox\.(\w+)/);y=t?t[1]:null}}if(b(r)){if(!y){if(o.isImage(r)){y="image"}else{if(o.isSWF(r)){y="swf"}else{if(r.charAt(0)==="#"){y="inline"}else{if(b(w)){y="html";x=w}}}}}if(y==="ajax"){A=r.split(/\s+/,2);r=A.shift();s=A.shift()}}if(!x){if(y==="inline"){if(r){x=i(b(r)?r.replace(/.*(?=#[^\s]+$)/,""):r)}else{if(u.isDom){x=w}}}else{if(y==="html"){x=r}else{if(!y&&!r&&u.isDom){y="inline";x=w}}}}i.extend(u,{href:r,type:y,content:x,title:z,selector:s});q[v]=u});o.opts=i.extend(true,{},o.defaults,p);if(p.keys!==undefined){o.opts.keys=p.keys?i.extend({},o.defaults.keys,p.keys):false}o.group=q;return o._start(o.opts.index)},cancel:function(){var p=o.coming;if(!p||false===o.trigger("onCancel")){return}o.hideLoading();if(o.ajaxLoad){o.ajaxLoad.abort()}o.ajaxLoad=null;if(o.imgPreload){o.imgPreload.onload=o.imgPreload.onerror=null}if(p.wrap){p.wrap.stop(true,true).trigger("onReset").remove()}o.coming=null;if(!o.current){o._afterZoomOut(p)}},close:function(p){o.cancel();if(false===o.trigger("beforeClose")){return}o.unbindEvents();if(!o.isActive){return}if(!o.isOpen||p===true){i(".fancybox-wrap").stop(true).trigger("onReset").remove();o._afterZoomOut()}else{o.isOpen=o.isOpened=false;o.isClosing=true;i(".fancybox-item, .fancybox-nav").remove();o.wrap.stop(true,true).removeClass("fancybox-opened");o.transitions[o.current.closeMethod]()}},play:function(r){var p=function(){clearTimeout(o.player.timer)},t=function(){p();if(o.current&&o.player.isActive){o.player.timer=setTimeout(o.next,o.current.playSpeed)}},q=function(){p();i("body").unbind(".player");o.player.isActive=false;o.trigger("onPlayEnd")},s=function(){if(o.current&&(o.current.loop||o.current.index<o.group.length-1)){o.player.isActive=true;i("body").bind({"afterShow.player onUpdate.player":t,"onCancel.player beforeClose.player":q,"beforeLoad.player":p});t();o.trigger("onPlayStart")}};if(r===true||(!o.player.isActive&&r!==false)){s()}else{q()}},next:function(q){var p=o.current;if(p){if(!b(q)){q=p.direction.next}o.jumpto(p.index+1,q,"next")}},prev:function(q){var p=o.current;if(p){if(!b(q)){q=p.direction.prev}o.jumpto(p.index-1,q,"prev")}},jumpto:function(q,s,p){var r=o.current;if(!r){return}q=m(q);o.direction=s||r.direction[(q>=r.index?"next":"prev")];o.router=p||"jumpto";if(r.loop){if(q<0){q=r.group.length+(q%r.group.length)}q=q%r.group.length}if(r.group[q]!==undefined){o.cancel();o._start(q)}},reposition:function(s,p){var r=o.current,q=r?r.wrap:null,t;if(q){t=o._getPosition(p);if(s&&s.type==="scroll"){delete t.position;q.stop(true,true).animate(t,200)}else{q.css(t);r.pos=i.extend({},r.dim,t)}}},update:function(r){var p=(r&&r.type),q=!p||p==="orientationchange";if(q){clearTimeout(c);c=null}if(!o.isOpen||c){return}c=setTimeout(function(){var s=o.current;if(!s||o.isClosing){return}o.wrap.removeClass("fancybox-tmp");if(q||p==="load"||(p==="resize"&&s.autoResize)){o._setDimension()}if(!(p==="scroll"&&s.canShrink)){o.reposition(r)}o.trigger("onUpdate");c=null},(q&&!e?0:300))},toggle:function(p){if(o.isOpen){o.current.fitToView=i.type(p)==="boolean"?p:!o.current.fitToView;if(e){o.wrap.removeAttr("style").addClass("fancybox-tmp");o.trigger("onUpdate")}o.update()}},hideLoading:function(){a.unbind(".loading");i("#fancybox-loading").remove()},showLoading:function(){var q,p;o.hideLoading();q=i('<div id="fancybox-loading"><div></div></div>').click(o.cancel).appendTo("body");a.bind("keydown.loading",function(r){if((r.which||r.keyCode)===27){r.preventDefault();o.cancel()}});if(!o.defaults.fixed){p=o.getViewport();q.css({position:"absolute",top:(p.h*0.5)+p.y,left:(p.w*0.5)+p.x})}},getViewport:function(){var p=(o.current&&o.current.locked)||false,q={x:d.scrollLeft(),y:d.scrollTop()};if(p){q.w=p[0].clientWidth;q.h=p[0].clientHeight}else{q.w=e&&k.innerWidth?k.innerWidth:d.width();q.h=e&&k.innerHeight?k.innerHeight:d.height()}return q},unbindEvents:function(){if(o.wrap&&j(o.wrap)){o.wrap.unbind(".fb")}a.unbind(".fb");d.unbind(".fb")},bindEvents:function(){var q=o.current,p;if(!q){return}d.bind("orientationchange.fb"+(e?"":" resize.fb")+(q.autoCenter&&!q.locked?" scroll.fb":""),o.update);p=q.keys;if(p){a.bind("keydown.fb",function(t){var r=t.which||t.keyCode,s=t.target||t.srcElement;if(r===27&&o.coming){return false}if(!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.metaKey&&!(s&&(s.type||i(s).is("[contenteditable]")))){i.each(p,function(u,v){if(q.group.length>1&&v[r]!==undefined){o[u](v[r]);t.preventDefault();return false}if(i.inArray(r,v)>-1){o[u]();t.preventDefault();return false}})}})}if(i.fn.mousewheel&&q.mouseWheel){o.wrap.bind("mousewheel.fb",function(w,x,s,r){var v=w.target||null,t=i(v),u=false;while(t.length){if(u||t.is(".fancybox-skin")||t.is(".fancybox-wrap")){break}u=h(t[0]);t=i(t).parent()}if(x!==0&&!u){if(o.group.length>1&&!q.canShrink){if(r>0||s>0){o.prev(r>0?"down":"left")}else{if(r<0||s<0){o.next(r<0?"up":"right")}}w.preventDefault()}}})}},trigger:function(q,s){var p,r=s||o.coming||o.current;if(!r){return}if(i.isFunction(r[q])){p=r[q].apply(r,Array.prototype.slice.call(arguments,1))}if(p===false){return false}if(r.helpers){i.each(r.helpers,function(u,t){if(t&&o.helpers[u]&&i.isFunction(o.helpers[u][q])){t=i.extend(true,{},o.helpers[u].defaults,t);o.helpers[u][q](t,r)}})}i.event.trigger(q+".fb")},isImage:function(p){return b(p)&&p.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(p){return b(p)&&p.match(/\.(swf)((\?|#).*)?$/i)},_start:function(q){var r={},v,p,s,t,u;q=m(q);v=o.group[q]||null;if(!v){return false}r=i.extend(true,{},o.opts,v);t=r.margin;u=r.padding;if(i.type(t)==="number"){r.margin=[t,t,t,t]}if(i.type(u)==="number"){r.padding=[u,u,u,u]}if(r.modal){i.extend(true,r,{closeBtn:false,closeClick:false,nextClick:false,arrows:false,mouseWheel:false,keys:null,helpers:{overlay:{closeClick:false}}})}if(r.autoSize){r.autoWidth=r.autoHeight=true}if(r.width==="auto"){r.autoWidth=true}if(r.height==="auto"){r.autoHeight=true}r.group=o.group;r.index=q;o.coming=r;if(false===o.trigger("beforeLoad")){o.coming=null;return}s=r.type;p=r.href;if(!s){o.coming=null;if(o.current&&o.router&&o.router!=="jumpto"){o.current.index=q;return o[o.router](o.direction)}return false}o.isActive=true;if(s==="image"||s==="swf"){r.autoHeight=r.autoWidth=false;r.scrolling="visible"}if(s==="image"){r.aspectRatio=true}if(s==="iframe"&&e){r.scrolling="scroll"}r.wrap=i(r.tpl.wrap).addClass("fancybox-"+(e?"mobile":"desktop")+" fancybox-type-"+s+" fancybox-tmp "+r.wrapCSS).appendTo(r.parent||"body");i.extend(r,{skin:i(".fancybox-skin",r.wrap),outer:i(".fancybox-outer",r.wrap),inner:i(".fancybox-inner",r.wrap)});i.each(["Top","Right","Bottom","Left"],function(x,w){r.skin.css("padding"+w,f(r.padding[x]))});o.trigger("onReady");if(s==="inline"||s==="html"){if(!r.content||!r.content.length){return o._error("content")}}else{if(!p){return o._error("href")}}if(s==="image"){o._loadImage()}else{if(s==="ajax"){o._loadAjax()}else{if(s==="iframe"){o._loadIframe()}else{o._afterLoad()}}}},_error:function(p){i.extend(o.coming,{type:"html",autoWidth:true,autoHeight:true,minWidth:0,minHeight:0,scrolling:"no",hasError:p,content:o.coming.tpl.error});o._afterLoad()},_loadImage:function(){var p=o.imgPreload=new Image();p.onload=function(){this.onload=this.onerror=null;o.coming.width=this.width;o.coming.height=this.height;o._afterLoad()};p.onerror=function(){this.onload=this.onerror=null;o._error("image")};p.src=o.coming.href;if(p.complete!==true){o.showLoading()}},_loadAjax:function(){var p=o.coming;o.showLoading();o.ajaxLoad=i.ajax(i.extend({},p.ajax,{url:p.href,error:function(q,r){if(o.coming&&r!=="abort"){o._error("ajax",q)}else{o.hideLoading()}},success:function(q,r){if(r==="success"){p.content=q;o._afterLoad()}}}))},_loadIframe:function(){var p=o.coming,q=i(p.tpl.iframe.replace(/\{rnd\}/g,new Date().getTime())).attr("scrolling",e?"auto":p.iframe.scrolling).attr("src",p.href);i(p.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(r){}});if(p.iframe.preload){o.showLoading();q.one("load",function(){i(this).data("ready",1);if(!e){i(this).bind("load.fb",o.update)}i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();o._afterLoad()})}p.content=q.appendTo(p.inner);if(!p.iframe.preload){o._afterLoad()}},_preloadImages:function(){var u=o.group,t=o.current,p=u.length,r=t.preload?Math.min(t.preload,p-1):0,s,q;for(q=1;q<=r;q+=1){s=u[(t.index+q)%p];if(s.type==="image"&&s.href){new Image().src=s.href}}},_afterLoad:function(){var q=o.coming,s=o.current,x="fancybox-placeholder",u,v,w,r,p,t;o.hideLoading();if(!q||o.isActive===false){return}if(false===o.trigger("afterLoad",q,s)){q.wrap.stop(true).trigger("onReset").remove();o.coming=null;return}if(s){o.trigger("beforeChange",s);s.wrap.stop(true).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()}o.unbindEvents();u=q;v=q.content;w=q.type;r=q.scrolling;i.extend(o,{wrap:u.wrap,skin:u.skin,outer:u.outer,inner:u.inner,current:u,previous:s});p=u.href;switch(w){case"inline":case"ajax":case"html":if(u.selector){v=i("<div>").html(v).find(u.selector)}else{if(j(v)){if(!v.data(x)){v.data(x,i('<div class="'+x+'"></div>').insertAfter(v).hide())}v=v.show().detach();u.wrap.bind("onReset",function(){if(i(this).find(v).length){v.hide().replaceAll(v.data(x)).data(x,false)}})}}break;case"image":v=u.tpl.image.replace("{href}",p);break;case"swf":v='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+p+'"></param>';t="";i.each(u.swf,function(y,z){v+='<param name="'+y+'" value="'+z+'"></param>';t+=" "+y+'="'+z+'"'});v+='<embed src="'+p+'" type="application/x-shockwave-flash" width="100%" height="100%"'+t+"></embed></object>";break}if(!(j(v)&&v.parent().is(u.inner))){u.inner.append(v)}o.trigger("beforeShow");u.inner.css("overflow",r==="yes"?"scroll":(r==="no"?"hidden":r));o._setDimension();o.reposition();o.isOpen=false;o.coming=null;o.bindEvents();if(!o.isOpened){i(".fancybox-wrap").not(u.wrap).stop(true).trigger("onReset").remove()}else{if(s.prevMethod){o.transitions[s.prevMethod]()}}o.transitions[o.isOpened?u.nextMethod:u.openMethod]();o._preloadImages()},_setDimension:function(){var S=o.getViewport(),O=0,U=false,W=false,A=o.wrap,M=o.skin,X=o.inner,J=o.current,K=J.width,H=J.height,D=J.minWidth,w=J.minHeight,Q=J.maxWidth,I=J.maxHeight,C=J.scrolling,u=J.scrollOutside?J.scrollbarWidth:0,G=J.margin,v=m(G[1]+G[3]),t=m(G[0]+G[2]),r,q,N,P,F,E,L,y,x,T,s,V,p,z,B;A.add(M).add(X).width("auto").height("auto").removeClass("fancybox-tmp");r=m(M.outerWidth(true)-M.width());q=m(M.outerHeight(true)-M.height());N=v+r;P=t+q;F=l(K)?(S.w-N)*m(K)/100:K;E=l(H)?(S.h-P)*m(H)/100:H;if(J.type==="iframe"){z=J.content;if(J.autoHeight&&z.data("ready")===1){try{if(z[0].contentWindow.document.location){X.width(F).height(9999);B=z.contents().find("body");if(u){B.css("overflow-x","hidden")}E=B.height()}}catch(R){}}}else{if(J.autoWidth||J.autoHeight){X.addClass("fancybox-tmp");if(!J.autoWidth){X.width(F)}if(!J.autoHeight){X.height(E)}if(J.autoWidth){F=X.width()}if(J.autoHeight){E=X.height()}X.removeClass("fancybox-tmp")}}K=m(F);H=m(E);x=F/E;D=m(l(D)?m(D,"w")-N:D);Q=m(l(Q)?m(Q,"w")-N:Q);w=m(l(w)?m(w,"h")-P:w);I=m(l(I)?m(I,"h")-P:I);L=Q;y=I;if(J.fitToView){Q=Math.min(S.w-N,Q);I=Math.min(S.h-P,I)}V=S.w-v;p=S.h-t;if(J.aspectRatio){if(K>Q){K=Q;H=m(K/x)}if(H>I){H=I;K=m(H*x)}if(K<D){K=D;H=m(K/x)}if(H<w){H=w;K=m(H*x)}}else{K=Math.max(D,Math.min(K,Q));if(J.autoHeight&&J.type!=="iframe"){X.width(K);H=X.height()}H=Math.max(w,Math.min(H,I))}if(J.fitToView){X.width(K).height(H);A.width(K+r);T=A.width();s=A.height();if(J.aspectRatio){while((T>V||s>p)&&K>D&&H>w){if(O++>19){break}H=Math.max(w,Math.min(I,H-10));K=m(H*x);if(K<D){K=D;H=m(K/x)}if(K>Q){K=Q;H=m(K/x)}X.width(K).height(H);A.width(K+r);T=A.width();s=A.height()}}else{K=Math.max(D,Math.min(K,K-(T-V)));H=Math.max(w,Math.min(H,H-(s-p)))}}if(u&&C==="auto"&&H<E&&(K+r+u)<V){K+=u}X.width(K).height(H);A.width(K+r);T=A.width();s=A.height();U=(T>V||s>p)&&K>D&&H>w;W=J.aspectRatio?(K<L&&H<y&&K<F&&H<E):((K<L||H<y)&&(K<F||H<E));i.extend(J,{dim:{width:f(T),height:f(s)},origWidth:F,origHeight:E,canShrink:U,canExpand:W,wPadding:r,hPadding:q,wrapSpace:s-M.outerHeight(true),skinSpace:M.height()-H});if(!z&&J.autoHeight&&H>w&&H<I&&!W){X.height("auto")}},_getPosition:function(r){var v=o.current,q=o.getViewport(),t=v.margin,s=o.wrap.width()+t[1]+t[3],p=o.wrap.height()+t[0]+t[2],u={position:"absolute",top:t[0],left:t[3]};if(v.autoCenter&&v.fixed&&!r&&p<=q.h&&s<=q.w){u.position="fixed"}else{if(!v.locked){u.top+=q.y;u.left+=q.x}}u.top=f(Math.max(u.top,u.top+((q.h-p)*v.topRatio)));u.left=f(Math.max(u.left,u.left+((q.w-s)*v.leftRatio)));return u},_afterZoomIn:function(){var p=o.current;if(!p){return}o.isOpen=o.isOpened=true;o.wrap.css("overflow","visible").addClass("fancybox-opened");o.update();if(p.closeClick||(p.nextClick&&o.group.length>1)){o.inner.css("cursor","pointer").bind("click.fb",function(q){if(!i(q.target).is("a")&&!i(q.target).parent().is("a")){q.preventDefault();o[p.closeClick?"close":"next"]()}})}if(p.closeBtn){i(p.tpl.closeBtn).appendTo(o.skin).bind(e?"touchstart.fb":"click.fb",function(q){q.preventDefault();o.close()})}if(p.arrows&&o.group.length>1){if(p.loop||p.index>0){i(p.tpl.prev).appendTo(o.outer).bind("click.fb",o.prev)}if(p.loop||p.index<o.group.length-1){i(p.tpl.next).appendTo(o.outer).bind("click.fb",o.next)}}o.trigger("afterShow");if(!p.loop&&p.index===p.group.length-1){o.play(false)}else{if(o.opts.autoPlay&&!o.player.isActive){o.opts.autoPlay=false;o.play()}}},_afterZoomOut:function(p){p=p||o.current;i(".fancybox-wrap").trigger("onReset").remove();i.extend(o,{group:{},opts:{},router:false,current:null,isActive:false,isOpened:false,isOpen:false,isClosing:false,wrap:null,skin:null,outer:null,inner:null});o.trigger("afterClose",p)}});o.transitions={getOrigPosition:function(){var s=o.current,q=s.element,v=s.orig,u={},p=50,w=50,t=s.hPadding,x=s.wPadding,r=o.getViewport();if(!v&&s.isDom&&q.is(":visible")){v=q.find("img:first");if(!v.length){v=q}}if(j(v)){u=v.offset();if(v.is("img")){p=v.outerWidth();w=v.outerHeight()}}else{u.top=r.y+(r.h-w)*s.topRatio;u.left=r.x+(r.w-p)*s.leftRatio}if(o.wrap.css("position")==="fixed"||s.locked){u.top-=r.y;u.left-=r.x}u={top:f(u.top-t*s.topRatio),left:f(u.left-x*s.leftRatio),width:f(p+x),height:f(w+t)};return u},step:function(q,r){var t,v,w,p=r.prop,s=o.current,u=s.wrapSpace,x=s.skinSpace;if(p==="width"||p==="height"){t=r.end===r.start?1:(q-r.start)/(r.end-r.start);if(o.isClosing){t=1-t}v=p==="width"?s.wPadding:s.hPadding;w=q-v;o.skin[p](m(p==="width"?w:w-(u*t)));o.inner[p](m(p==="width"?w:w-(u*t)-(x*t)))}},zoomIn:function(){var t=o.current,q=t.pos,r=t.openEffect,s=r==="elastic",p=i.extend({opacity:1},q);delete p.position;if(s){q=this.getOrigPosition();if(t.openOpacity){q.opacity=0.1}}else{if(r==="fade"){q.opacity=0.1}}o.wrap.css(q).animate(p,{duration:r==="none"?0:t.openSpeed,easing:t.openEasing,step:s?this.step:null,complete:o._afterZoomIn})},zoomOut:function(){var s=o.current,q=s.closeEffect,r=q==="elastic",p={opacity:0.1};if(r){p=this.getOrigPosition();if(s.closeOpacity){p.opacity=0.1}}o.wrap.animate(p,{duration:q==="none"?0:s.closeSpeed,easing:s.closeEasing,step:r?this.step:null,complete:o._afterZoomOut})},changeIn:function(){var u=o.current,r=u.nextEffect,q=u.pos,p={opacity:1},t=o.direction,v=200,s;q.opacity=0.1;if(r==="elastic"){s=t==="down"||t==="up"?"top":"left";if(t==="down"||t==="right"){q[s]=f(m(q[s])-v);p[s]="+="+v+"px"}else{q[s]=f(m(q[s])+v);p[s]="-="+v+"px"}}if(r==="none"){o._afterZoomIn()}else{o.wrap.css(q).animate(p,{duration:u.nextSpeed,easing:u.nextEasing,complete:function(){setTimeout(o._afterZoomIn,20)}})}},changeOut:function(){var r=o.previous,q=r.prevEffect,p={opacity:0.1},s=o.direction,t=200;if(q==="elastic"){p[s==="down"||s==="up"?"top":"left"]=(s==="up"||s==="left"?"-":"+")+"="+t+"px"}r.wrap.animate(p,{duration:q==="none"?0:r.prevSpeed,easing:r.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}};o.helpers.overlay={defaults:{closeClick:true,speedOut:200,showEarly:true,css:{},locked:!e,fixed:true},overlay:null,fixed:false,create:function(p){p=i.extend({},this.defaults,p);if(this.overlay){this.close()}this.overlay=i('<div class="fancybox-overlay"></div>').appendTo("body");this.fixed=false;if(p.fixed&&o.defaults.fixed){this.overlay.addClass("fancybox-overlay-fixed");this.fixed=true}},open:function(q){var p=this;q=i.extend({},this.defaults,q);if(this.overlay){this.overlay.unbind(".overlay").width("auto").height("auto")}else{this.create(q)}if(!this.fixed){d.bind("resize.overlay",i.proxy(this.update,this));this.update()}if(q.closeClick){this.overlay.bind("click.overlay",function(r){if(i(r.target).hasClass("fancybox-overlay")){if(o.isActive){o.close()}else{p.close()}}})}this.overlay.css(q.css).show()},close:function(){i(".fancybox-overlay").remove();d.unbind("resize.overlay");this.overlay=null;if(this.margin!==false){i("body").css("margin-right",this.margin);this.margin=false}if(this.el){this.el.removeClass("fancybox-lock")}},update:function(){var q="100%",p;this.overlay.width(q).height("100%");if(i.browser.msie){p=Math.max(n.documentElement.offsetWidth,n.body.offsetWidth);if(a.width()>p){q=a.width()}}else{if(a.width()>d.width()){q=a.width()}}this.overlay.width(q).height(a.height())},onReady:function(p,q){i(".fancybox-overlay").stop(true,true);if(!this.overlay){this.margin=a.height()>d.height()||i("body").css("overflow-y")==="scroll"?i("body").css("margin-right"):false;this.el=n.all&&!n.querySelector?i("html"):i("body");this.create(p)}if(p.locked&&this.fixed){q.locked=this.overlay.append(q.wrap);q.fixed=false}if(p.showEarly===true){this.beforeShow.apply(this,arguments)}},beforeShow:function(p,q){if(q.locked){this.el.addClass("fancybox-lock");if(this.margin!==false){i("body").css("margin-right",m(this.margin)+q.scrollbarWidth)}}this.open(p)},onUpdate:function(){if(!this.fixed){this.update()}},afterClose:function(p){if(this.overlay&&!o.isActive){this.overlay.fadeOut(p.speedOut,i.proxy(this.close,this))}}};o.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(q){var s=o.current,u=s.title,p=q.type,t,r;if(i.isFunction(u)){u=u.call(s.element,s)}if(!b(u)||i.trim(u)===""){return}t=i('<div class="fancybox-title fancybox-title-'+p+'-wrap">'+u+"</div>");switch(p){case"inside":r=o.skin;break;case"outside":r=o.wrap;break;case"over":r=o.inner;break;default:r=o.skin;t.appendTo("body");if(i.browser.msie){t.width(t.width())}t.wrapInner('<span class="child"></span>');o.current.margin[2]+=Math.abs(m(t.css("margin-bottom")));break}t[(q.position==="top"?"prependTo":"appendTo")](r)}};i.fn[g]=function(r){var q,s=i(this),p=this.selector||"",t=function(x){var w=i(this).blur(),u=q,v,y;if(!(x.ctrlKey||x.altKey||x.shiftKey||x.metaKey)&&!w.is(".fancybox-wrap")){v=r.groupAttr||"data-fancybox-group";y=w.attr(v);if(!y){v="rel";y=w.get(0)[v]}if(y&&y!==""&&y!=="nofollow"){w=p.length?i(p):s;w=w.filter("["+v+'="'+y+'"]');u=w.index(this)}r.index=u;if(o.open(w,r)!==false){x.preventDefault()}}};r=r||{};q=r.index||0;if(!p||r.live===false){s.unbind("click.fb-start").bind("click.fb-start",t)}else{a.undelegate(p,"click.fb-start").delegate(p+":not('.fancybox-item, .fancybox-nav')","click.fb-start",t)}this.filter("[data-fancybox-start=1]").trigger("click");return this};a.ready(function(){if(i.scrollbarWidth===undefined){i.scrollbarWidth=function(){var q=i('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),r=q.children(),p=r.innerWidth()-r.height(99).innerWidth();q.remove();return p}}if(i.support.fixedPosition===undefined){i.support.fixedPosition=(function(){var q=i('<div style="position:fixed;top:20px;"></div>').appendTo("body"),p=(q[0].offsetTop===20||q[0].offsetTop===15);q.remove();return p}())}i.extend(o.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")})})};
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.