4 lines
22 KiB
JavaScript
4 lines
22 KiB
JavaScript
|
/*! Magnific Popup - v1.0.0 - 2015-09-17
|
||
|
* http://dimsemenov.com/plugins/magnific-popup/
|
||
|
* Copyright (c) 2015 Dmitry Semenov; */
|
||
|
;(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof exports==="object"){a(require("jquery"))}else{a(window.jQuery||window.Zepto)}}}(function(B){var x="Close",G="BeforeClose",v="AfterClose",M="BeforeAppend",f="MarkupParse",k="Open",h="Change",C="mfp",d="."+C,H="mfp-ready",J="mfp-removing",e="mfp-prevent-close";var R,y=function(){},I=!!(window.jQuery),A,a=B(window),z,E,b,K;var i=function(V,W){R.ev.on(C+V+d,W)},n=function(Z,W,X,V){var Y=document.createElement("div");Y.className="mfp-"+Z;if(X){Y.innerHTML=X}if(!V){Y=B(Y);if(W){Y.appendTo(W)}}else{if(W){W.appendChild(Y)}}return Y},O=function(W,V){R.ev.triggerHandler(C+W,V);if(R.st.callbacks){W=W.charAt(0).toLowerCase()+W.slice(1);if(R.st.callbacks[W]){R.st.callbacks[W].apply(R,B.isArray(V)?V:[V])}}},D=function(V){if(V!==K||!R.currTemplate.closeBtn){R.currTemplate.closeBtn=B(R.st.closeMarkup.replace("%title%",R.st.tClose));K=V}return R.currTemplate.closeBtn},s=function(){if(!B.magnificPopup.instance){R=new y();R.init();B.magnificPopup.instance=R}},U=function(){var W=document.createElement("p").style,V=["ms","O","Moz","Webkit"];if(W.transition!==undefined){return true}while(V.length){if(V.pop()+"Transition" in W){return true}}return false};y.prototype={constructor:y,init:function(){var V=navigator.appVersion;R.isIE7=V.indexOf("MSIE 7.")!==-1;R.isIE8=V.indexOf("MSIE 8.")!==-1;R.isLowIE=R.isIE7||R.isIE8;R.isAndroid=(/android/gi).test(V);R.isIOS=(/iphone|ipad|ipod/gi).test(V);R.supportsTransition=U();R.probablyMobile=(R.isAndroid||R.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent));z=B(document);R.popupsCache={}},open:function(aa){var ab;if(aa.isObj===false){R.items=aa.items.toArray();R.index=0;var ac=aa.items,ad;for(ab=0;ab<ac.length;ab++){ad=ac[ab];if(ad.parsed){ad=ad.el[0]}if(ad===aa.el[0]){R.index=ab;break}}}else{R.items=B.isArray(aa.items)?aa.items:[aa.items];R.index=aa.index||0}if(R.isOpen){R.updateItemHTML();return}R.types=[];b="";if(aa.mainEl&&aa.mainEl.length){R.ev=aa.mainEl.eq(0)}else{R.ev=z}if(aa.key){if(!R.popupsCache[aa.key]){R.popupsCache[aa.key]={}}R.currTemplate=R.popupsCache[aa.key]}else{R.currTemplate={}}R.st=B.extend(true,{},B.magnificPopup.defaults,aa);R.fixedContentPos=R.st.fixedContentPos==="auto"?!R.probablyMobile:R.st.fixedContentPos;if(R.st.modal){R.st.closeOnContentClick=false;R.st.closeOnBgClick=false;R.st.showCloseBtn=false;R.st.enableEscapeKey=false}if(!R.bgOverlay){R.bgOverlay=n("bg").on("click"+d,function(){R.close()});R.wrap=n("wrap").attr("tabindex",-1).on("click"+d,function(af){if(R._checkIfClose(af.target)){R.close()}});R.container=n("container",R.wrap)}R.contentContainer=n("content");if(R.st.preloader){R.preloader=n("preloader",R.container,R.st.tLoading)}var Z=B.magnificPopup.modules;for(ab=0;ab<Z.length;ab++){var Y=Z[ab];Y=Y.charAt(0).toUpperCase()+Y.slice(1);R["init"+Y].call(R)}O("BeforeOpen");if(R.st.showCloseBtn){if(!R.st.closeBtnInside){R.wrap.append(D())}else{i(f,function(ai,ag,af,ah){af.close_replaceWith=D(ah.type)});b+=" mfp-close-btn-in"}}if(R.st.alignTop){b+=" mfp-align-top"}if(R.fixedContentPos){R.wrap.css({overflow:R.st.overflowY,overflowX:"hidden",overflowY:R.st.overflowY})}else{R.wrap.css({top:a.scrollTop(),position:"absolute"})}if(R.st.fixedBgPos===false||(R.st.fixedBgPos==="auto"&&!R.fixedContentPos)){R.bgOverlay.css({height:z.height(),position:"absolute"})}if(R.st.enableEscapeKey){z.on("keyup"+d,function(af){if(af.keyCode===27){R.close()}})}a.on("resize"+d,function(){R.updateSize()});if(!R.st.closeOnContentClick){b+=" mfp-auto-cursor"}if(b){R.wrap.addClass(b)}var V=R.wH=a.height();var X={};if(R.fixedContentPos){if(R._hasScrollBar(V)){var ae=R._getScrollbarSize();if(ae){X.marginRight=ae}}}if(R.fixedContentPos){if(!R.isIE7){X.overflow="hidden"}else{B("body, html").css("overflow","hidden")}}var W=R.st.mainClass;if(R.isIE7){W+=" mfp-ie7"}if(W){R._addClassToMFP(W)}R.updateItemHTML();O("BuildControls");B("html").css(X);R.bgOverlay.add(R.wrap).prependTo(R.st.prependTo||B(document.body));R._lastFocusedEl=document.activeElement;setTime
|