Guide_Wii/assets/js/plugins/jquery.magnific-popup.js

2 lines
20 KiB
JavaScript
Raw Normal View History

2018-10-01 15:20:53 +02:00
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery||window.Zepto)}(function(d){var u,i,p,o,f,t,l="Close",c="BeforeClose",m="MarkupParse",g="Open",a="Change",n="mfp",h="."+n,v="mfp-ready",r="mfp-removing",s="mfp-prevent-close",e=function(){},y=!!window.jQuery,C=d(window),w=function(e,t){u.ev.on(n+e+h,t)},b=function(e,t,n,i){var o=document.createElement("div");return o.className="mfp-"+e,n&&(o.innerHTML=n),i?t&&t.appendChild(o):(o=d(o),t&&o.appendTo(t)),o},I=function(e,t){u.ev.triggerHandler(n+e,t),u.st.callbacks&&(e=e.charAt(0).toLowerCase()+e.slice(1),u.st.callbacks[e]&&u.st.callbacks[e].apply(u,d.isArray(t)?t:[t]))},x=function(e){return e===t&&u.currTemplate.closeBtn||(u.currTemplate.closeBtn=d(u.st.closeMarkup.replace("%title%",u.st.tClose)),t=e),u.currTemplate.closeBtn},k=function(){d.magnificPopup.instance||((u=new e).init(),d.magnificPopup.instance=u)};e.prototype={constructor:e,init:function(){var e=navigator.appVersion;u.isLowIE=u.isIE8=document.all&&!document.addEventListener,u.isAndroid=/android/gi.test(e),u.isIOS=/iphone|ipad|ipod/gi.test(e),u.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),u.probablyMobile=u.isAndroid||u.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),p=d(document),u.popupsCache={}},open:function(e){var t;if(!1===e.isObj){u.items=e.items.toArray(),u.index=0;var n,i=e.items;for(t=0;t<i.length;t++)if((n=i[t]).parsed&&(n=n.el[0]),n===e.el[0]){u.index=t;break}}else u.items=d.isArray(e.items)?e.items:[e.items],u.index=e.index||0;if(!u.isOpen){u.types=[],f="",e.mainEl&&e.mainEl.length?u.ev=e.mainEl.eq(0):u.ev=p,e.key?(u.popupsCache[e.key]||(u.popupsCache[e.key]={}),u.currTemplate=u.popupsCache[e.key]):u.currTemplate={},u.st=d.extend(!0,{},d.magnificPopup.defaults,e),u.fixedContentPos="auto"===u.st.fixedContentPos?!u.probablyMobile:u.st.fixedContentPos,u.st.modal&&(u.st.closeOnContentClick=!1,u.st.closeOnBgClick=!1,u.st.showCloseBtn=!1,u.st.enableEscapeKey=!1),u.bgOverlay||(u.bgOverlay=b("bg").on("click"+h,function(){u.close()}),u.wrap=b("wrap").attr("tabindex",-1).on("click"+h,function(e){u._checkIfClose(e.target)&&u.close()}),u.container=b("container",u.wrap)),u.contentContainer=b("content"),u.st.preloader&&(u.preloader=b("preloader",u.container,u.st.tLoading));var o=d.magnificPopup.modules;for(t=0;t<o.length;t++){var r=o[t];r=r.charAt(0).toUpperCase()+r.slice(1),u["init"+r].call(u)}I("BeforeOpen"),u.st.showCloseBtn&&(u.st.closeBtnInside?(w(m,function(e,t,n,i){n.close_replaceWith=x(i.type)}),f+=" mfp-close-btn-in"):u.wrap.append(x())),u.st.alignTop&&(f+=" mfp-align-top"),u.fixedContentPos?u.wrap.css({overflow:u.st.overflowY,overflowX:"hidden",overflowY:u.st.overflowY}):u.wrap.css({top:C.scrollTop(),position:"absolute"}),(!1===u.st.fixedBgPos||"auto"===u.st.fixedBgPos&&!u.fixedContentPos)&&u.bgOverlay.css({height:p.height(),position:"absolute"}),u.st.enableEscapeKey&&p.on("keyup"+h,function(e){27===e.keyCode&&u.close()}),C.on("resize"+h,function(){u.updateSize()}),u.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&u.wrap.addClass(f);var a=u.wH=C.height(),s={};if(u.fixedContentPos&&u._hasScrollBar(a)){var l=u._getScrollbarSize();l&&(s.marginRight=l)}u.fixedContentPos&&(u.isIE7?d("body, html").css("overflow","hidden"):s.overflow="hidden");var c=u.st.mainClass;return u.isIE7&&(c+=" mfp-ie7"),c&&u._addClassToMFP(c),u.updateItemHTML(),I("BuildControls"),d("html").css(s),u.bgOverlay.add(u.wrap).prependTo(u.st.prependTo||d(document.body)),u._lastFocusedEl=document.activeElement,setTimeout(function(){u.content?(u._addClassToMFP(v),u._setFocus()):u.bgOverlay.addClass(v),p.on("focusin"+h,u._onFocusIn)},16),u.isOpen=!0,u.updateSize(a),I(g),e}u.updateItemHTML()},close:function(){u.isOpen&&(I(c),u.isOpen=!1,u.st.removalDelay&&!u.isLowIE&&u.supportsTransition?(u._addClassToMFP(r),setTimeout(function(){u._close()},u.st.rem