mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
1 line
6.3 KiB
JavaScript
1 line
6.3 KiB
JavaScript
!function(e,t,n){function r(e,t){return typeof e===t}function s(){var e,t,n,s,o,i,a;for(var f in w)if(w.hasOwnProperty(f)){if(e=[],t=w[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(s=r(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]]=s:(!C[a[0]]||C[a[0]]instanceof Boolean||(C[a[0]]=new Boolean(C[a[0]])),C[a[0]][a[1]]=s),_.push((s?"":"no-")+a.join("-"))}}function o(e){var t=T.className,n=C._config.classPrefix||"";if(b&&(t=t.baseVal),C._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$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)S(e,n)&&i(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),s=C[r[0]];if(2==r.length&&(s=s[r[1]]),"undefined"!=typeof s)return C;t="function"==typeof t?t():t,1==r.length?C[r[0]]=t:(!C[r[0]]||C[r[0]]instanceof Boolean||(C[r[0]]=new Boolean(C[r[0]])),C[r[0]][r[1]]=t),o([(t&&0!=t?"":"no-")+r.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,r,s){var o,i,l,u,c="modernizr",d=a("div"),p=f();if(parseInt(r,10))for(;r--;)l=a("div"),l.id=s?s[r]:c+(r+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,r){var s=t.length;if("CSS"in e&&"supports"in e.CSS){for(;s--;)if(e.CSS.supports(c(t[s]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var o=[];s--;)o.push("("+c(t[s])+":"+r+")");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,s,o){function i(){l&&(delete k.style,delete k.modElem)}if(o=!r(o,"undefined")&&o,!r(s,"undefined")){var f=d(e,s);if(!r(f,"undefined"))return f}for(var l,c,h,v,g,m=["modernizr","tspan"];!k.style;)l=!0,k.modElem=a(m.shift()),k.style=k.modElem.style;for(h=e.length,c=0;c<h;c++)if(v=e[c],g=k.style[v],u(v,"-")&&(v=p(v)),k.style[v]!==n){if(o||r(s,"undefined"))return i(),"pfx"!=t||v;try{k.style[v]=s}catch(y){}if(k.style[v]!=g)return i(),"pfx"!=t||v}return i(),!1}function v(e,t){return function(){return e.apply(t,arguments)}}function g(e,t,n){var s;for(var o in e)if(e[o]in t)return n===!1?e[o]:(s=t[e[o]],r(s,"function")?v(s,n||t):s);return!1}function m(e,t,n,s,o){var i=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+j.join(i+" ")+i).split(" ");return r(t,"string")||r(t,"undefined")?h(a,t,s,o):(a=(e+" "+R.join(i+" ")+i).split(" "),g(a,t,n))}function y(e,t,r){return m(e,n,n,t,r)}var w=[],x={_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){w.push({name:e,fn:t,options:n})},addAsyncTest:function(e){w.push({name:null,fn:e})}},C=function(){};C.prototype=x,C=new C;var S,_=[],T=t.documentElement,b="svg"===T.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;S=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),x._l={},x.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)},x._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e<n.length;e++)(r=n[e])(t)},0),delete this._l[e]}},C._q.push(function(){x.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,r=a("canvas"),s=r.getContext("2d");return s.fillStyle="#f00",s.textBaseline="top",s.font="32px Arial",s.fillText("🐨",0,0),0!==s.getImageData(n,n,1,1).data[0]}),C.addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect);var P=x.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),r=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,s=t<533&&e.match(/android/gi);return n||s||r}();E?C.addTest("fontface",!1):P('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),s=r.sheet||r.styleSheet,o=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"",i=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);C.addTest("fontface",i)});var z="Moz O ms Webkit",j=x._config.usePrefixes?z.split(" "):[];x._cssomPrefixes=j;var N={elem:a("modernizr")};C._q.push(function(){delete N.elem});var k={style:N.elem.style};C._q.unshift(function(){delete k.style});var R=x._config.usePrefixes?z.toLowerCase().split(" "):[];x._domPrefixes=R,x.testAllProps=m,x.testAllProps=y;var A="CSS"in e&&"supports"in e.CSS,q="supportsCSS"in e;C.addTest("supports",A||q),C.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=C._config.usePrefixes;if(e&&(!t||"webkitPerspective"in T.style)){var n,r="#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}}",P(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),s(),o(_),delete x.addTest,delete x.addAsyncTest;for(var B=0;B<C._q.length;B++)C._q[B]();e.Modernizr=C}(window,document); |