jahresbericht2018/assets/js/compat/modernizr.js

1 line
11 KiB
JavaScript

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