2 lines
8.8 KiB
JavaScript
2 lines
8.8 KiB
JavaScript
|
/* jquery.poptrox.js v2.4 | (c) n33 | n33.co | MIT licensed */
|
||
|
(function(e){var t="height",n="width",r="trigger",i="css",s="stopPropagation",o="position",u=!1,a="poptrox_close",f="fadeSpeed",l="length",c="text-align",h="popupNavPreviousSelector",p="poptrox_switch",d="stopSpinning",v="click",m="popupNavNextSelector",g="popupHeight",y="popupCaptionSelector",b=!0,w="popupCloserSelector",E="popupLoaderSelector",S=null,x="none",T="font-size",N="poptrox_previous",C="popupCaptionHeight",k="preventDefault",L="cursor",A="center",O="line-height",M="poptrox_reset",_="overflow",D="poptrox_next",P="popupTextColor",H="text-indent",B="fadeIn",j="pointer",F="object",I="poptrox_disableSelection",q="auto",R="color",U="absolute",z="load",W="#000000",X="px",V="usePopupNav",$="100%",J="relative",K="</div>",Q="0",G="popupWidth",Y='<div class="',Z="z-index",et="outline",tt="background",nt="startSpinning",rt="left",it="poptrox_open",st="40px",ot="popupLoaderText",ut="poptrox",at="popupCloserText",ft="update",lt="ignore",ct="usePopupEasyClose",ht="popupSelector",pt="soundcloud",dt="#FFFFFF",vt="display",mt="image",gt="hide",yt="useBodyOverflow",bt="overlayOpacity",wt="xfin",Et="type",St="youtube";e.fn[I]=function(){return e(this)[i]("user-select",x)[i]("-khtml-user-select",x)[i]("-moz-user-select",x)[i]("-o-user-select",x)[i]("-webkit-user-select",x)},e.fn[ut]=function(Mt){function tn(){var r,s,o,u,a,f;Ft=e(window)[n](),It=e(window)[t]()+Dt.windowHeightPad,r=Math.abs(Wt[n]()-Wt.outerWidth()),s=Math.abs(Wt[t]()-Wt.outerHeight()),o=Vt[n](),u=Vt[t](),a=Ft-Dt.windowMargin*2-r,f=It-Dt.windowMargin*2-s,Wt[i]("min-width",Dt[G])[i]("min-height",Dt[g]),Xt.children()[i]("max-width",a)[i]("max-height",f)}var _t,Dt,Pt,Ht,Bt,jt,Ft,It,qt,Rt,Ut,zt,Wt,Xt,Vt,$t,Jt,Kt,Qt,Gt,Yt,Zt,en;if(this[l]==0)return e(this);if(this[l]>1){for(_t=0;_t<this[l];_t++)e(this[_t])[ut](Mt);return e(this)}return Dt=e.extend({preload:u,baseZIndex:1e3,fadeSpeed:300,overlayColor:W,overlayOpacity:.6,overlayClass:"poptrox-overlay",windowMargin:50,windowHeightPad:0,selector:"a",parent:"body",popupSpeed:300,popupWidth:200,popupHeight:100,popupIsFixed:u,useBodyOverflow:u,usePopupEasyClose:b,usePopupLoader:b,usePopupCloser:b,usePopupCaption:u,usePopupNav:u,usePopupDefaultStyling:b,popupBackgroundColor:dt,popupTextColor:W,popupLoaderTextSize:"2em",popupCloserBackgroundColor:W,popupCloserTextColor:dt,popupCloserTextSize:"20px",popupPadding:10,popupCaptionHeight:60,popupCaptionTextSize:S,popupBlankCaptionText:"(untitled)",popupCloserText:"×",popupLoaderText:"••••",popupClass:"poptrox-popup",popupSelector:S,popupLoaderSelector:".loader",popupCloserSelector:".closer",popupCaptionSelector:".caption",popupNavPreviousSelector:".nav-previous",popupNavNextSelector:".nav-next",onPopupClose:S,onPopupOpen:S},Mt),Pt=e(this),Ht=e("body"),Bt=e(Y+Dt.overlayClass+'"></div>'),jt=e(window),qt=[],Rt=0,Ut=u,zt=new Array,Dt.usePopupLoader||(Dt[E]=S),Dt.usePopupCloser||(Dt[w]=S),Dt.usePopupCaption||(Dt[y]=S),Dt[V]||(Dt[h]=S,Dt[m]=S),Dt[ht]?Wt=e(Dt[ht]):Wt=e(Y+Dt.popupClass+'">'+(Dt[E]?'<div class="loader">'+Dt[ot]+K:"")+'<div class="pic"></div>'+(Dt[y]?'<div class="caption"></div>':"")+(Dt[w]?'<span class="closer">'+Dt[at]+"</span>":"")+(Dt[h]?'<div class="nav-previous"></div>':"")+(Dt[m]?'<div class="nav-next"></div>':"")+K),Xt=Wt.find(".pic"),Vt=e(),$t=Wt.find(Dt[E]),Jt=Wt.find(Dt[y]),Kt=Wt.find(Dt[w]),Qt=Wt.find(Dt[m]),Gt=Wt.find(Dt[h]),Yt=Qt.add(Gt),Dt.usePopupDefaultStyling&&(Wt[i](tt,Dt.popupBackgroundColor)[i](R,Dt[P])[i]("padding",Dt.popupPadding+X),Jt[l]>0&&(Wt[i]("padding-bottom",Dt[C]+X),Jt[i](o,U)[i](rt,Q)[i]("bottom",Q)[i](n,$)[i](c,A)[i](t,Dt[C]+X)[i](O,Dt[C]+X),Dt.popupCaptionTextSize&&Jt[i](T,popupCaptionTextSize)),Kt[l]>0&&Kt.html(Dt[at])[i](T,Dt.popupCloserTextSize)[i](tt,Dt.popupCloserBackgroundColor)[i](R,Dt.popupCloserTextColor)[i](vt,"block")[i](n,st)[i](t,st)[i](O,st)[i](c,A)[i](o,U)[i]("text-decoration",x)[i](et,Q)[i]("top",Q)[i]("right","-40px"),$t[l]>0&&$t.html("")[i](o,J)[i](T,Dt.popupLoaderTextSize).on(nt,function(){var n=e("<div>"+Dt[ot]+K);n[i](t,Math.floor(Dt[g]/2)+X)[i](_,"hidden")[i](O,Math.floor(Dt[g]/2)+X)[i](c,A)[i]("
|