1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
!function(e,t,n){function o(e,t){return typeof e===t}function i(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function r(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function a(t,n,o){var i;if("getComputedStyle"in e){i=getComputedStyle.call(e,t,n);var r=e.console;if(null!==i)o&&(i=i.getPropertyValue(o));else if(r){var a=r.error?"error":"log";r[a].call(r,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else i=!n&&t.currentStyle&&t.currentStyle[o];return i}function s(e,t){return e-1===t||e===t||e+1===t}function l(e){var t=E.className,n=b._config.classPrefix||"";if($&&(t=t.baseVal),b._config.enableJSClass){var o=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(o,"$1"+n+"js$2")}b._config.enableClasses&&(t+=" "+n+e.join(" "+n),$?E.className.baseVal=t:E.className=t)}function u(e,t){if("object"==typeof e)for(var n in e)z(e,n)&&u(n,e[n]);else{e=e.toLowerCase();var o=e.split("."),i=b[o[0]];if(2==o.length&&(i=i[o[1]]),void 0!==i)return b;t="function"==typeof t?t():t,1==o.length?b[o[0]]=t:(!b[o[0]]||b[o[0]]instanceof Boolean||(b[o[0]]=new Boolean(b[o[0]])),b[o[0]][o[1]]=t),l([(t&&0!=t?"":"no-")+o.join("-")]),b._trigger(e,t)}return b}function c(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):$?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function d(){var e=t.body;return e||(e=c($?"svg":"body"),e.fake=!0),e}function f(e,n,o,i){var r,a,s,l,u="modernizr",f=c("div"),p=d();if(parseInt(o,10))for(;o--;)s=c("div"),s.id=i?i[o]:u+(o+1),f.appendChild(s);return r=c("style"),r.type="text/css",r.id="s"+u,(p.fake?p:f).appendChild(r),p.appendChild(f),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(t.createTextNode(e)),f.id=u,p.fake&&(p.style.background="",p.style.overflow="hidden",l=E.style.overflow,E.style.overflow="hidden",E.appendChild(p)),a=n(f,e),p.fake?(p.parentNode.removeChild(p),E.style.overflow=l,E.offsetHeight):f.parentNode.removeChild(f),!!a}function p(e,t){return!!~(""+e).indexOf(t)}function h(t,o){var i=t.length;if("CSS"in e&&"supports"in e.CSS){for(;i--;)if(e.CSS.supports(r(t[i]),o))return!0;return!1}if("CSSSupportsRule"in e){for(var s=[];i--;)s.push("("+r(t[i])+":"+o+")");return s=s.join(" or "),f("@supports ("+s+") { #modernizr { position: absolute; } }",function(e){return"absolute"==a(e,null,"position")})}return n}function v(e,t){return function(){return e.apply(t,arguments)}}function m(e,t,n){var i;for(var r in e)if(e[r]in t)return n===!1?e[r]:(i=t[e[r]],o(i,"function")?v(i,n||t):i);return!1}function y(e,t,r,a){function s(){u&&(delete V.style,delete V.modElem)}if(a=!o(a,"undefined")&&a,!o(r,"undefined")){var l=h(e,r);if(!o(l,"undefined"))return l}for(var u,d,f,v,m,y=["modernizr","tspan","samp"];!V.style&&y.length;)u=!0,V.modElem=c(y.shift()),V.style=V.modElem.style;for(f=e.length,d=0;d<f;d++)if(v=e[d],m=V.style[v],p(v,"-")&&(v=i(v)),V.style[v]!==n){if(a||o(r,"undefined"))return s(),"pfx"!=t||v;try{V.style[v]=r}catch(e){}if(V.style[v]!=m)return s(),"pfx"!=t||v}return s(),!1}function g(e,t,n,i,r){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+k.join(a+" ")+a).split(" ");return o(t,"string")||o(t,"undefined")?y(s,t,i,r):(s=(e+" "+_.join(a+" ")+a).split(" "),m(s,t,n))}function w(e,t,o){return g(e,n,n,t,o)}var x=[],T={_version:"3.5.0",_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})}},b=function(){};b.prototype=T,b=new b,b.addTest("geolocation","geolocation"in navigator),b.addTest("history",function(){var t=navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1||"file:"===location.protocol)&&(e.history&&"pushState"in e.history)}),b.addTest("webaudio",function(){var t="webkitAudioContext"in e,n="AudioContext"in e;return b._config.usePrefixes?t||n:n}),b.addTest("filereader",!!(e.File&&e.FileList&&e.FileReader));var C=T._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];T._prefixes=C;var S=[],P="Moz O ms Webkit",_=T._config.usePrefixes?P.toLowerCase().split(" "):[];T._domPrefixes=_;var z;!function(){var e={}.hasOwnProperty;z=o(e,"undefined")||o(e.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}();var k=T._config.usePrefixes?P.split(" "):[];T._cssomPrefixes=k;var A=function(t){var o,i=C.length,r=e.CSSRule;if(void 0===r)return n;if(!t)return!1;if(t=t.replace(/^@/,""),(o=t.replace(/-/g,"_").toUpperCase()+"_RULE")in r)return"@"+t;for(var a=0;a<i;a++){var s=C[a];if(s.toUpperCase()+"_"+o in r)return"@-"+s.toLowerCase()+"-"+t}return!1};T.atRule=A;var E=t.documentElement,$="svg"===E.nodeName.toLowerCase();T._l={},T.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),b.hasOwnProperty(e)&&setTimeout(function(){b._trigger(e,b[e])},0)},T._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e;for(e=0;e<n.length;e++)n[e](t)},0),delete this._l[e]}},b._q.push(function(){T.addTest=u});var N=function(){function e(e,t){var i;return!!e&&(t&&"string"!=typeof t||(t=c(t||"div")),e="on"+e,i=e in t,!i&&o&&(t.setAttribute||(t=c("div")),t.setAttribute(e,""),i="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),i)}var o=!("onblur"in t.documentElement);return e}();T.hasEvent=N,b.addTest("hashchange",function(){return N("hashchange",e)!==!1&&(t.documentMode===n||t.documentMode>7)});var L=function(e,t){var n=!1,o=c("div"),i=o.style;if(e in i){var r=_.length;for(i[e]=t,n=i[e];r--&&!n;)i[e]="-"+_[r]+"-"+t,n=i[e]}return""===n&&(n=!1),n};T.prefixedCSSValue=L,b.addTest("audio",function(){var e=c("audio"),t=!1;try{t=!!e.canPlayType,t&&(t=new Boolean(t),t.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),t.mp3=e.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,""),t.opus=e.canPlayType('audio/ogg; codecs="opus"')||e.canPlayType('audio/webm; codecs="opus"').replace(/^no$/,""),t.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),t.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(e){}return t}),b.addTest("video",function(){var e=c("video"),t=!1;try{t=!!e.canPlayType,t&&(t=new Boolean(t),t.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),t.vp9=e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),t.hls=e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(e){}return t}),b.addTest("audioloop","loop"in c("audio"));var W=c("input"),B="autocomplete autofocus list placeholder max min multiple pattern required step".split(" "),I={};b.input=function(t){for(var n=0,o=t.length;n<o;n++)I[t[n]]=!!(t[n]in W);return I.list&&(I.list=!(!c("datalist")||!e.HTMLDataListElement)),I}(B);var O="search tel url email datetime date month week time datetime-local number range color".split(" "),j={};b.inputtypes=function(e){for(var o,i,r,a=e.length,s=0;s<a;s++)W.setAttribute("type",o=e[s]),r="text"!==W.type&&"style"in W,r&&(W.value="1)",W.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(o)&&W.style.WebkitAppearance!==n?(E.appendChild(W),i=t.defaultView,r=i.getComputedStyle&&"textfield"!==i.getComputedStyle(W,null).WebkitAppearance&&0!==W.offsetHeight,E.removeChild(W)):/^(search|tel)$/.test(o)||(r=/^(url|email)$/.test(o)?W.checkValidity&&W.checkValidity()===!1:"1)"!=W.value)),j[e[s]]=!!r;return j}(O);var M=function(){var t=e.matchMedia||e.msMatchMedia;return t?function(e){var n=t(e);return n&&n.matches||!1}:function(t){var n=!1;return f("@media "+t+" { #modernizr { position: absolute; } }",function(t){n="absolute"==(e.getComputedStyle?e.getComputedStyle(t,null):t.currentStyle).position}),n}}();T.mq=M;var R=T.testStyles=f;b.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{R(["@media (",C.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join(""),function(e){n=9===e.offsetTop})}return n}),R("#modernizr { height: 50vh; }",function(t){var n=parseInt(e.innerHeight/2,10),o=parseInt(a(t,null,"height"),10);b.addTest("cssvhunit",o==n)}),R("#modernizr1{width: 50vmax}#modernizr2{width:50px;height:50px;overflow:scroll}#modernizr3{position:fixed;top:0;left:0;bottom:0;right:0}",function(e){var t=e.childNodes[2],n=e.childNodes[1],o=e.childNodes[0],i=parseInt((n.offsetWidth-n.clientWidth)/2,10),r=o.clientWidth/100,l=o.clientHeight/100,u=parseInt(50*Math.max(r,l),10),c=parseInt(a(t,null,"width"),10);b.addTest("cssvmaxunit",s(u,c)||s(u,c-i))},3),R("#modernizr1{width: 50vm;width:50vmin}#modernizr2{width:50px;height:50px;overflow:scroll}#modernizr3{position:fixed;top:0;left:0;bottom:0;right:0}",function(e){var t=e.childNodes[2],n=e.childNodes[1],o=e.childNodes[0],i=parseInt((n.offsetWidth-n.clientWidth)/2,10),r=o.clientWidth/100,l=o.clientHeight/100,u=parseInt(50*Math.min(r,l),10),c=parseInt(a(t,null,"width"),10);b.addTest("cssvminunit",s(u,c)||s(u,c-i))},3),R("#modernizr { width: 50vw; }",function(t){var n=parseInt(e.innerWidth/2,10),o=parseInt(a(t,null,"width"),10);b.addTest("cssvwunit",o==n)});var q={elem:c("modernizr")};b._q.push(function(){delete q.elem});var V={style:q.elem.style};b._q.unshift(function(){delete V.style});T.testProp=function(e,t,o){return y([e],n,t,o)};T.testAllProps=g;var F=T.prefixed=function(e,t,n){return 0===e.indexOf("@")?A(e):(e.indexOf("-")!=-1&&(e=i(e)),t?g(e,t,n):g(e,"pfx"))};T.prefixedCSS=function(e){var t=F(e);return t&&r(t)};b.addTest("fullscreen",!(!F("exitFullscreen",t,!1)&&!F("cancelFullScreen",t,!1))),T.testAllProps=w,function(){b.addTest("csscolumns",function(){var e=!1,t=w("columnCount");try{e=!!t,e&&(e=new Boolean(e))}catch(e){}return e});for(var e,t,n=["Width","Span","Fill","Gap","Rule","RuleColor","RuleStyle","RuleWidth","BreakBefore","BreakAfter","BreakInside"],o=0;o<n.length;o++)e=n[o].toLowerCase(),t=w("column"+n[o]),"breakbefore"!==e&&"breakafter"!==e&&"breakinside"!=e||(t=t||w(n[o])),b.addTest("csscolumns."+e,t)}(),b.addTest("flexbox",w("flexBasis","1px",!0)),function(){var e,t,n,i,r,a,s;for(var l in x)if(x.hasOwnProperty(l)){if(e=[],t=x[l],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(i=o(t.fn,"function")?t.fn():t.fn,r=0;r<e.length;r++)a=e[r],s=a.split("."),1===s.length?b[s[0]]=i:(!b[s[0]]||b[s[0]]instanceof Boolean||(b[s[0]]=new Boolean(b[s[0]])),b[s[0]][s[1]]=i),S.push((i?"":"no-")+s.join("-"))}}(),delete T.addTest,delete T.addAsyncTest;for(var H=0;H<b._q.length;H++)b._q[H]();e.Modernizr=b}(window,document); |