mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-15 03:17:40 +01:00
1 line
6.4 KiB
JavaScript
1 line
6.4 KiB
JavaScript
!function(e,t,n){function s(e,t){return typeof e===t}function r(){var e,t,n,r,o,i,a;for(var f in x)if(x.hasOwnProperty(f)){if(e=[],t=x[f],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(r=s(t.fn,"function")?t.fn():t.fn,o=0;o<e.length;o++)i=e[o],a=i.split("."),1===a.length?C[a[0]]=r:(!C[a[0]]||C[a[0]]instanceof Boolean||(C[a[0]]=new Boolean(C[a[0]])),C[a[0]][a[1]]=r),S.push((r?"":"no-")+a.join("-"))}}function o(e){var t=T.className,n=C._config.classPrefix||"";if(b&&(t=t.baseVal),C._config.enableJSClass){var s=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(s,"$1"+n+"js$2")}C._config.enableClasses&&(t+=" "+n+e.join(" "+n),b?T.className.baseVal=t:T.className=t)}function i(e,t){if("object"==typeof e)for(var n in e)_(e,n)&&i(n,e[n]);else{e=e.toLowerCase();var s=e.split("."),r=C[s[0]];if(2==s.length&&(r=r[s[1]]),"undefined"!=typeof r)return C;t="function"==typeof t?t():t,1==s.length?C[s[0]]=t:(!C[s[0]]||C[s[0]]instanceof Boolean||(C[s[0]]=new Boolean(C[s[0]])),C[s[0]][s[1]]=t),o([(t&&0!=t?"":"no-")+s.join("-")]),C._trigger(e,t)}return C}function a(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):b?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function f(){var e=t.body;return e||(e=a(b?"svg":"body"),e.fake=!0),e}function l(e,n,s,r){var o,i,l,u,c="modernizr",d=a("div"),p=f();if(parseInt(s,10))for(;s--;)l=a("div"),l.id=r?r[s]:c+(s+1),d.appendChild(l);return o=a("style"),o.type="text/css",o.id="s"+c,(p.fake?p:d).appendChild(o),p.appendChild(d),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(t.createTextNode(e)),d.id=c,p.fake&&(p.style.background="",p.style.overflow="hidden",u=T.style.overflow,T.style.overflow="hidden",T.appendChild(p)),i=n(d,e),p.fake?(p.parentNode.removeChild(p),T.style.overflow=u,T.offsetHeight):d.parentNode.removeChild(d),!!i}function u(e,t){return!!~(""+e).indexOf(t)}function c(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function d(t,s){var r=t.length;if("CSS"in e&&"supports"in e.CSS){for(;r--;)if(e.CSS.supports(c(t[r]),s))return!0;return!1}if("CSSSupportsRule"in e){for(var o=[];r--;)o.push("("+c(t[r])+":"+s+")");return o=o.join(" or "),l("@supports ("+o+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return n}function p(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function h(e,t,r,o){function i(){l&&(delete N.style,delete N.modElem)}if(o=!s(o,"undefined")&&o,!s(r,"undefined")){var f=d(e,r);if(!s(f,"undefined"))return f}for(var l,c,h,v,m,g=["modernizr","tspan"];!N.style;)l=!0,N.modElem=a(g.shift()),N.style=N.modElem.style;for(h=e.length,c=0;c<h;c++)if(v=e[c],m=N.style[v],u(v,"-")&&(v=p(v)),N.style[v]!==n){if(o||s(r,"undefined"))return i(),"pfx"!=t||v;try{N.style[v]=r}catch(y){}if(N.style[v]!=m)return i(),"pfx"!=t||v}return i(),!1}function v(e,t){return function(){return e.apply(t,arguments)}}function m(e,t,n){var r;for(var o in e)if(e[o]in t)return n===!1?e[o]:(r=t[e[o]],s(r,"function")?v(r,n||t):r);return!1}function g(e,t,n,r,o){var i=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+k.join(i+" ")+i).split(" ");return s(t,"string")||s(t,"undefined")?h(a,t,r,o):(a=(e+" "+R.join(i+" ")+i).split(" "),m(a,t,n))}function y(e,t,s){return g(e,n,n,t,s)}var x=[],w={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){x.push({name:e,fn:t,options:n})},addAsyncTest:function(e){x.push({name:null,fn:e})}},C=function(){};C.prototype=w,C=new C;var _,S=[],T=t.documentElement,b="svg"===T.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;_=s(e,"undefined")||s(e.call,"undefined")?function(e,t){return t in e&&s(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),w._l={},w.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),C.hasOwnProperty(e)&&setTimeout(function(){C._trigger(e,C[e])},0)},w._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,s;for(e=0;e<n.length;e++)(s=n[e])(t)},0),delete this._l[e]}},C._q.push(function(){w.addTest=i}),C.addTest("canvas",function(){var e=a("canvas");return!(!e.getContext||!e.getContext("2d"))}),C.addTest("canvastext",function(){return C.canvas!==!1&&"function"==typeof a("canvas").getContext("2d").fillText}),C.addTest("emoji",function(){if(!C.canvastext)return!1;var t=e.devicePixelRatio||1,n=12*t,s=a("canvas"),r=s.getContext("2d");return r.fillStyle="#f00",r.textBaseline="top",r.font="32px Arial",r.fillText("🐨",0,0),0!==r.getImageData(n,n,1,1).data[0]});var P=w._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];w._prefixes=P,C.addTest("csscalc",function(){var e="width:",t="calc(10px);",n=a("a");return n.style.cssText=e+P.join(t+e),!!n.style.length});var z=w.testStyles=l,E=function(){var e=navigator.userAgent,t=e.match(/applewebkit\/([0-9]+)/gi)&&parseFloat(RegExp.$1),n=e.match(/w(eb)?osbrowser/gi),s=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,r=t<533&&e.match(/android/gi);return n||r||s}();E?C.addTest("fontface",!1):z('@font-face {font-family:"font";src:url("https://")}',function(e,n){var s=t.getElementById("smodernizr"),r=s.sheet||s.styleSheet,o=r?r.cssRules&&r.cssRules[0]?r.cssRules[0].cssText:r.cssText||"":"",i=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);C.addTest("fontface",i)});var j="Moz O ms Webkit",k=w._config.usePrefixes?j.split(" "):[];w._cssomPrefixes=k;var A={elem:a("modernizr")};C._q.push(function(){delete A.elem});var N={style:A.elem.style};C._q.unshift(function(){delete N.style});var R=w._config.usePrefixes?j.toLowerCase().split(" "):[];w._domPrefixes=R,w.testAllProps=g,w.testAllProps=y;var q="CSS"in e&&"supports"in e.CSS,B="supportsCSS"in e;C.addTest("supports",q||B),C.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=C._config.usePrefixes;if(e&&(!t||"webkitPerspective"in T.style)){var n,s="#modernizr{width:0;height:0}";C.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",z(s+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),r(),o(S),delete w.addTest,delete w.addAsyncTest;for(var L=0;L<C._q.length;L++)C._q[L]();e.Modernizr=C}(window,document); |