modernizr-3.5.0.min.js 8.3 KB

123
  1. /* modernizr 3.5.0 (Custom Build) | MIT *
  2. * https://modernizr.com/download/?-cssanimations-csscolumns-customelements-flexbox-history-picture-pointerevents-postmessage-sizes-srcset-webgl-websockets-webworkers-addtest-domprefixes-hasevent-mq-prefixedcssvalue-prefixes-setclasses-testallprops-testprop-teststyles !*/
  3. !function(Q,aq,ag){function am(a,b){return typeof a===b}function ai(){var c,k,g,h,d,j,b;for(var f in J){if(J.hasOwnProperty(f)){if(c=[],k=J[f],k.name&&(c.push(k.name.toLowerCase()),k.options&&k.options.aliases&&k.options.aliases.length)){for(g=0;g<k.options.aliases.length;g++){c.push(k.options.aliases[g].toLowerCase())}}for(h=am(k.fn,"function")?k.fn():k.fn,d=0;d<c.length;d++){j=c[d],b=j.split("."),1===b.length?af[b[0]]=h:(!af[b[0]]||af[b[0]] instanceof Boolean||(af[b[0]]=new Boolean(af[b[0]])),af[b[0]][b[1]]=h),av.push((h?"":"no-")+b.join("-"))}}}}function Y(a){var d=ap.className,b=af._config.classPrefix||"";if(aw&&(d=d.baseVal),af._config.enableJSClass){var c=new RegExp("(^|\\s)"+b+"no-js(\\s|$)");d=d.replace(c,"$1"+b+"js$2")}af._config.enableClasses&&(d+=" "+b+a.join(" "+b),aw?ap.className.baseVal=d:ap.className=d)}function ao(a,f){if("object"==typeof a){for(var b in a){al(a,b)&&ao(b,a[b])}}else{a=a.toLowerCase();var d=a.split("."),c=af[d[0]];if(2==d.length&&(c=c[d[1]]),"undefined"!=typeof c){return af}f="function"==typeof f?f():f,1==d.length?af[d[0]]=f:(!af[d[0]]||af[d[0]] instanceof Boolean||(af[d[0]]=new Boolean(af[d[0]])),af[d[0]][d[1]]=f),Y([(f&&0!=f?"":"no-")+d.join("-")]),af._trigger(a,f)}return af}function D(){return"function"!=typeof aq.createElement?aq.createElement(arguments[0]):aw?aq.createElementNS.call(aq,"http://www.w3.org/2000/svg",arguments[0]):aq.createElement.apply(aq,arguments)}function ab(){var a=aq.body;return a||(a=D(aw?"svg":"body"),a.fake=!0),a}function at(g,k,t,l){var j,v,w,h,b="modernizr",a=D("div"),m=ab();if(parseInt(t,10)){for(;t--;){w=D("div"),w.id=l?l[t]:b+(t+1),a.appendChild(w)}}return j=D("style"),j.type="text/css",j.id="s"+b,(m.fake?m:a).appendChild(j),m.appendChild(a),j.styleSheet?j.styleSheet.cssText=g:j.appendChild(aq.createTextNode(g)),a.id=b,m.fake&&(m.style.background="",m.style.overflow="hidden",h=ap.style.overflow,ap.style.overflow="hidden",ap.appendChild(m)),v=k(a,g),m.fake?(m.parentNode.removeChild(m),ap.style.overflow=h,ap.offsetHeight):a.parentNode.removeChild(a),!!v}function V(a,b){return !!~(""+a).indexOf(b)}function K(a){return a.replace(/([A-Z])/g,function(b,c){return"-"+c.toLowerCase()}).replace(/^ms-/,"-ms-")}function I(f,b,d){var c;if("getComputedStyle" in Q){c=getComputedStyle.call(Q,f,b);var a=Q.console;if(null!==c){d&&(c=c.getPropertyValue(d))}else{if(a){var e=a.error?"error":"log";a[e].call(a,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}}else{c=!b&&f.currentStyle&&f.currentStyle[d]}return c}function ak(d,c){var b=d.length;if("CSS" in Q&&"supports" in Q.CSS){for(;b--;){if(Q.CSS.supports(K(d[b]),c)){return !0}}return !1}if("CSSSupportsRule" in Q){for(var a=[];b--;){a.push("("+K(d[b])+":"+c+")")}return a=a.join(" or "),at("@supports ("+a+") { #modernizr { position: absolute; } }",function(f){return"absolute"==I(f,null,"position")})}return ag}function ad(a){return a.replace(/([a-z])-([a-z])/g,function(b,d,c){return d+c.toUpperCase()}).replace(/^-/,"")}function X(j,x,r,n){function w(){y&&(delete ah.style,delete ah.modElem)}if(n=am(n,"undefined")?!1:n,!am(r,"undefined")){var p=ak(j,r);if(!am(p,"undefined")){return p}}for(var y,f,b,m,z,a=["modernizr","tspan","samp"];!ah.style&&a.length;){y=!0,ah.modElem=D(a.shift()),ah.style=ah.modElem.style}for(b=j.length,f=0;b>f;f++){if(m=j[f],z=ah.style[m],V(m,"-")&&(m=ad(m)),ah.style[m]!==ag){if(n||am(r,"undefined")){return w(),"pfx"==x?m:!0}try{ah.style[m]=r}catch(k){}if(ah.style[m]!=z){return w(),"pfx"==x?m:!0}}}return w(),!1}function au(a,b){return function(){return a.apply(b,arguments)}}function F(a,f,c){var d;for(var b in a){if(a[b] in f){return c===!1?a[b]:(d=f[a[b]],am(d,"function")?au(d,c||f):d)}}return !1}function W(c,j,f,g,d){var h=c.charAt(0).toUpperCase()+c.slice(1),b=(c+" "+aj.join(h+" ")+h).split(" ");return am(j,"string")||am(j,"undefined")?X(b,j,g,d):(b=(c+" "+ar.join(h+" ")+h).split(" "),F(b,j,f))}function ax(a,c,b){return W(a,ag,ag,c,b)}var J=[],G={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(a,c){var b=this;setTimeout(function(){c(b[a])},0)},addTest:function(a,c,b){J.push({name:a,fn:c,options:b})},addAsyncTest:function(a){J.push({name:null,fn:a})}},af=function(){};af.prototype=G,af=new af;var av=[],ap=aq.documentElement,aw="svg"===ap.nodeName.toLowerCase(),q="Moz O ms Webkit",ar=G._config.usePrefixes?q.toLowerCase().split(" "):[];G._domPrefixes=ar;var U=G._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];G._prefixes=U;var al;!function(){var a={}.hasOwnProperty;al=am(a,"undefined")||am(a.call,"undefined")?function(b,c){return c in b&&am(b.constructor.prototype[c],"undefined")}:function(c,b){return a.call(c,b)}}(),G._l={},G.on=function(a,b){this._l[a]||(this._l[a]=[]),this._l[a].push(b),af.hasOwnProperty(a)&&setTimeout(function(){af._trigger(a,af[a])},0)},G._trigger=function(a,c){if(this._l[a]){var b=this._l[a];setTimeout(function(){var d,f;for(d=0;d<b.length;d++){(f=b[d])(c)}},0),delete this._l[a]}},af._q.push(function(){G.addTest=ao});var aa=function(){function a(c,f){var d;return c?(f&&"string"!=typeof f||(f=D(f||"div")),c="on"+c,d=c in f,!d&&b&&(f.setAttribute||(f=D("div")),f.setAttribute(c,""),d="function"==typeof f[c],f[c]!==ag&&(f[c]=ag),f.removeAttribute(c)),d):!1}var b=!("onblur" in aq.documentElement);return a}();G.hasEvent=aa;var ay=function(){var a=Q.matchMedia||Q.msMatchMedia;return a?function(b){var c=a(b);return c&&c.matches||!1}:function(c){var b=!1;return at("@media "+c+" { #modernizr { position: absolute; } }",function(d){b="absolute"==(Q.getComputedStyle?Q.getComputedStyle(d,null):d.currentStyle).position}),b}}();G.mq=ay;var H=function(a,g){var c=!1,f=D("div"),d=f.style;if(a in d){var b=ar.length;for(d[a]=g,c=d[a];b--&&!c;){d[a]="-"+ar[b]+"-"+g,c=d[a]}}return""===c&&(c=!1),c};G.prefixedCSSValue=H;var aj=G._config.usePrefixes?q.split(" "):[];G._cssomPrefixes=aj;var ac={elem:D("modernizr")};af._q.push(function(){delete ac.elem});var ah={style:ac.elem.style};af._q.unshift(function(){delete ah.style}),G.testAllProps=W,G.testAllProps=ax;G.testProp=function(a,c,b){return X([a],ag,c,b)},G.testStyles=at;af.addTest("customelements","customElements" in Q),af.addTest("history",function(){var a=navigator.userAgent;return -1===a.indexOf("Android 2.")&&-1===a.indexOf("Android 4.0")||-1===a.indexOf("Mobile Safari")||-1!==a.indexOf("Chrome")||-1!==a.indexOf("Windows Phone")||"file:"===location.protocol?Q.history&&"pushState" in Q.history:!1}),af.addTest("pointerevents",function(){var a=!1,b=ar.length;for(a=af.hasEvent("pointerdown");b--&&!a;){aa(ar[b]+"pointerdown")&&(a=!0)}return a}),af.addTest("postmessage","postMessage" in Q),af.addTest("webgl",function(){var b=D("canvas"),a="probablySupportsContext" in b?"probablySupportsContext":"supportsContext";return a in b?b[a]("webgl")||b[a]("experimental-webgl"):"WebGLRenderingContext" in Q});var an=!1;try{an="WebSocket" in Q&&2===Q.WebSocket.CLOSING}catch(Z){}af.addTest("websockets",an),af.addTest("cssanimations",ax("animationName","a",!0)),function(){af.addTest("csscolumns",function(){var f=!1,h=ax("columnCount");try{f=!!h,f&&(f=new Boolean(f))}catch(g){}return f});for(var a,d,b=["Width","Span","Fill","Gap","Rule","RuleColor","RuleStyle","RuleWidth","BreakBefore","BreakAfter","BreakInside"],c=0;c<b.length;c++){a=b[c].toLowerCase(),d=ax("column"+b[c]),("breakbefore"===a||"breakafter"===a||"breakinside"==a)&&(d=d||ax(b[c])),af.addTest("csscolumns."+a,d)}}(),af.addTest("flexbox",ax("flexBasis","1px",!0)),af.addTest("picture","HTMLPictureElement" in Q),af.addAsyncTest(function(){var a,f,b,d=D("img"),c="sizes" in d;!c&&"srcset" in d?(f="data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw==",a="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b=function(){ao("sizes",2==d.width)},d.onload=b,d.onerror=b,d.setAttribute("sizes","9px"),d.srcset=a+" 1w,"+f+" 8w",d.src=a):ao("sizes",c)}),af.addTest("srcset","srcset" in D("img")),af.addTest("webworkers","Worker" in Q),ai(),Y(av),delete G.addTest,delete G.addAsyncTest;for(var ae=0;ae<af._q.length;ae++){af._q[ae]()}Q.Modernizr=af}(window,document);