1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/webtrees_ynh.git synced 2024-09-03 18:26:37 +02:00
webtrees_ynh/sources/packages/modernizr-2.8.3/modernizr.min.js

1 line
No EOL
11 KiB
JavaScript

window.Modernizr=function(Y,Z,Q){function T(b,d){return typeof b===d}function N(e,h){for(var d in e){var g=e[d];if(!~(""+g).indexOf("-")&&W[g]!==Q){return"pfx"==h?g:!0}}return !1}function V(h,n,g){var k=h.charAt(0).toUpperCase()+h.slice(1),l=(h+" "+M.join(k+" ")+k).split(" ");if(T(n,"string")||T(n,"undefined")){n=N(l,n)}else{h:{l=(h+" "+K.join(k+" ")+k).split(" "),h=l;for(var m in h){if(k=n[h[m]],k!==Q){n=!1===g?h[m]:T(k,"function")?k.bind(g||n):k;break h}}n=!1}}return n}function c(){aa.input=function(e){for(var g=0,d=e.length;d>g;g++){L[e[g]]=!!(e[g] in X)}return L.list&&(L.list=!(!Z.createElement("datalist")||!Y.HTMLDataListElement)),L}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));aa.inputtypes=function(h){for(var n,e,l,m=0,k=h.length;k>m;m++){X.setAttribute("type",e=h[m]),(n="text"!==X.type)&&(X.value=j,X.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&X.style.WebkitAppearance!==Q?(U.appendChild(X),l=Z.defaultView,n=l.getComputedStyle&&"textfield"!==l.getComputedStyle(X,null).WebkitAppearance&&0!==X.offsetHeight,U.removeChild(X)):/^(search|tel)$/.test(e)||(n=/^(url|email)$/.test(e)?X.checkValidity&&!1===X.checkValidity():X.value!=j)),s[h[m]]=!!n}return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var u,f,aa={},U=Z.documentElement,ab=Z.createElement("modernizr"),W=ab.style,X=Z.createElement("input"),j=":)",o={}.toString,r=" -webkit- -moz- -o- -ms- ".split(" "),M=["Webkit","Moz","O","ms"],K=["webkit","moz","o","ms"],ab={},s={},L={},a=[],S=a.slice,R=function(y,w,x,t){var v,q,m,p,e=Z.createElement("div"),n=Z.body,z=n||Z.createElement("body");if(parseInt(x,10)){for(;x--;){m=Z.createElement("div"),m.id=t?t[x]:"modernizr"+(x+1),e.appendChild(m)}}return v=['&#173;<style id="smodernizr">',y,"</style>"].join(""),e.id="modernizr",(n?e:z).innerHTML+=v,z.appendChild(e),n||(z.style.background="",z.style.overflow="hidden",p=U.style.overflow,U.style.overflow="hidden",U.appendChild(z)),q=w(e,y),n?e.parentNode.removeChild(e):(z.parentNode.removeChild(z),U.style.overflow=p),!!q},i=function(){var b={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return function(g,d){d=d||Z.createElement(b[g]||"div");g="on"+g;var e=g in d;return e||(d.setAttribute||(d=Z.createElement("div")),d.setAttribute&&d.removeAttribute&&(d.setAttribute(g,""),e=T(d[g],"function"),T(d[g],"undefined")||(d[g]=Q),d.removeAttribute(g))),e}}(),P={}.hasOwnProperty;f=T(P,"undefined")||T(P.call,"undefined")?function(b,d){return d in b&&T(b.constructor.prototype[d],"undefined")}:function(b,d){return P.call(b,d)};Function.prototype.bind||(Function.prototype.bind=function(e){var h=this;if("function"!=typeof h){throw new TypeError}var d=S.call(arguments,1),g=function(){if(this instanceof g){var k=function(){};k.prototype=h.prototype;var k=new k,b=h.apply(k,d.concat(S.call(arguments)));return Object(b)===b?b:k}return h.apply(e,d.concat(S.call(arguments)))};return g});ab.flexbox=function(){return V("flexWrap")};ab.flexboxlegacy=function(){return V("boxDirection")};ab.canvas=function(){var b=Z.createElement("canvas");return !(!b.getContext||!b.getContext("2d"))};ab.canvastext=function(){return !(!aa.canvas||!T(Z.createElement("canvas").getContext("2d").fillText,"function"))};ab.webgl=function(){return !!Y.WebGLRenderingContext};ab.touch=function(){var b;return"ontouchstart" in Y||Y.DocumentTouch&&Z instanceof DocumentTouch?b=!0:R(["@media (",r.join("touch-enabled),("),"modernizr){#modernizr{top:9px;position:absolute}}"].join(""),function(d){b=9===d.offsetTop}),b};ab.geolocation=function(){return"geolocation" in navigator};ab.postmessage=function(){return !!Y.postMessage};ab.websqldatabase=function(){return !!Y.openDatabase};ab.indexedDB=function(){return !!V("indexedDB",Y)};ab.hashchange=function(){return i("hashchange",Y)&&(Z.documentMode===Q||7<Z.documentMode)};ab.history=function(){return !(!Y.history||!history.pushState)};ab.draganddrop=function(){var b=Z.createElement("div");return"draggable" in b||"ondragstart" in b&&"ondrop" in b};ab.websockets=function(){return"WebSocket" in Y||"MozWebSocket" in Y};ab.rgba=function(){W.cssText="background-color:rgba(150,255,150,.5)";return !!~(""+W.backgroundColor).indexOf("rgba")};ab.hsla=function(){W.cssText="background-color:hsla(120,40%,100%,.5)";return !!~(""+W.backgroundColor).indexOf("rgba")||!!~(""+W.backgroundColor).indexOf("hsla")};ab.multiplebgs=function(){W.cssText="background:url(https://),url(https://),red url(https://)";return/(url\s*\(.*?){3}/.test(W.background)};ab.backgroundsize=function(){return V("backgroundSize")};ab.borderimage=function(){return V("borderImage")};ab.borderradius=function(){return V("borderRadius")};ab.boxshadow=function(){return V("boxShadow")};ab.textshadow=function(){return""===Z.createElement("div").style.textShadow};ab.opacity=function(){var b=r.join("opacity:.55;")+"";W.cssText=b;return/^0.55$/.test(W.opacity)};ab.cssanimations=function(){return V("animationName")};ab.csscolumns=function(){return V("columnCount")};ab.cssgradients=function(){var b=("background-image:-webkit-gradient(linear,left top,right bottom,from(#9f9),to(white));background-image:"+r.join("linear-gradient(left top,#9f9, white);background-image:")).slice(0,-17);W.cssText=b;return !!~(""+W.backgroundImage).indexOf("gradient")};ab.cssreflections=function(){return V("boxReflect")};ab.csstransforms=function(){return !!V("transform")};ab.csstransforms3d=function(){var b=!!V("perspective");return b&&"webkitPerspective" in U.style&&R("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(d){b=9===d.offsetLeft&&3===d.offsetHeight}),b};ab.csstransitions=function(){return V("transition")};ab.fontface=function(){var b;return R('@font-face {font-family:"font";src:url("https://")}',function(g,d){var e=Z.getElementById("smodernizr"),e=(e=e.sheet||e.styleSheet)?e.cssRules&&e.cssRules[0]?e.cssRules[0].cssText:e.cssText||"":"";b=/src/i.test(e)&&0===e.indexOf(d.split(" ")[0])}),b};ab.generatedcontent=function(){var b;return R(['#modernizr{font:0/0 a}#modernizr:after{content:"',j,'";visibility:hidden;font:3px/1 a}'].join(""),function(d){b=3<=d.offsetHeight}),b};ab.video=function(){var e=Z.createElement("video"),g=!1;try{(g=!!e.canPlayType)&&(g=new Boolean(g),g.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),g.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),g.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(d){}return g};ab.audio=function(){var e=Z.createElement("audio"),g=!1;try{(g=!!e.canPlayType)&&(g=new Boolean(g),g.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),g.mp3=e.canPlayType("audio/mpeg;").replace(/^no$/,""),g.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),g.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(d){}return g};ab.localstorage=function(){try{return localStorage.setItem("modernizr","modernizr"),localStorage.removeItem("modernizr"),!0}catch(b){return !1}};ab.sessionstorage=function(){try{return sessionStorage.setItem("modernizr","modernizr"),sessionStorage.removeItem("modernizr"),!0}catch(b){return !1}};ab.webworkers=function(){return !!Y.Worker};ab.applicationcache=function(){return !!Y.applicationCache};ab.svg=function(){return !!Z.createElementNS&&!!Z.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect};ab.inlinesvg=function(){var b=Z.createElement("div");return b.innerHTML="<svg/>","http://www.w3.org/2000/svg"==(b.firstChild&&b.firstChild.namespaceURI)};ab.smil=function(){return !!Z.createElementNS&&/SVGAnimate/.test(o.call(Z.createElementNS("http://www.w3.org/2000/svg","animate")))};ab.svgclippaths=function(){return !!Z.createElementNS&&/SVGClipPath/.test(o.call(Z.createElementNS("http://www.w3.org/2000/svg","clipPath")))};for(var O in ab){f(ab,O)&&(u=O.toLowerCase(),aa[u]=ab[O](),a.push((aa[u]?"":"no-")+u))}aa.input||c();aa.addTest=function(e,g){if("object"==typeof e){for(var d in e){f(e,d)&&aa.addTest(d,e[d])}}else{if(e=e.toLowerCase(),aa[e]!==Q){return aa}g="function"==typeof g?g():g;U.className+=" "+(g?"":"no-")+e;aa[e]=g}return aa};W.cssText="";return ab=X=null,function(I,G){function H(){var b=J.elements;return"string"==typeof b?b.split(" "):b}function D(b){var d=ac[b[v]];return d||(d={},w++,b[v]=w,ac[w]=d),d}function F(h,d,l){if(d||(d=G),A){return d.createElement(h)}l||(l=D(d));var k;return k=l.cache[h]?l.cache[h].cloneNode():x.test(h)?(l.cache[h]=l.createElem(h)).cloneNode():l.createElem(h),!k.canHaveChildren||y.test(h)||k.tagUrn?k:l.frag.appendChild(k)}function E(b,d){d.cache||(d.cache={},d.createElem=b.createElement,d.createFrag=b.createDocumentFragment,d.frag=d.createFrag());b.createElement=function(e){return J.shivMethods?F(e,b,d):d.createElem(e)};b.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+H().join().replace(/[\w\-]+/g,function(e){return d.createElem(e),d.frag.createElement(e),'c("'+e+'")'})+");return n}")(J,d.frag)}function C(g){g||(g=G);var e=D(g);if(J.shivCSS&&!z&&!e.hasCSS){var l,k=g;l=k.createElement("p");k=k.getElementsByTagName("head")[0]||k.documentElement;l=(l.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>",k.insertBefore(l.lastChild,k.firstChild));e.hasCSS=!!l}return A||E(g,e),g}var z,A,B=I.html5||{},y=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,x=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,ac={};!function(){try{var h=G.createElement("a");h.innerHTML="<xyz></xyz>";z="hidden" in h;var g;if(!(g=1==h.childNodes.length)){G.createElement("a");var l=G.createDocumentFragment();g="undefined"==typeof l.cloneNode||"undefined"==typeof l.createDocumentFragment||"undefined"==typeof l.createElement}A=g}catch(k){A=z=!0}}();var J={elements:B.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==B.shivCSS,supportsUnknownElements:A,shivMethods:!1!==B.shivMethods,type:"default",shivDocument:C,createElement:F,createDocumentFragment:function(k,q){if(k||(k=G),A){return k.createDocumentFragment()}q=q||D(k);for(var p=q.frag.cloneNode(),n=0,m=H(),b=m.length;b>n;n++){p.createElement(m[n])}return p}};I.html5=J;C(G)}(this,Z),aa._version="2.8.3",aa._prefixes=r,aa._domPrefixes=K,aa._cssomPrefixes=M,aa.mq=function(e){var g=Y.matchMedia||Y.msMatchMedia;if(g){return g(e)&&g(e).matches||!1}var d;return R("@media "+e+" { #modernizr { position: absolute; } }",function(b){d="absolute"==(Y.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position}),d},aa.hasEvent=i,aa.testProp=function(b){return N([b])},aa.testAllProps=V,aa.testStyles=R,aa.prefixed=function(g,e,h){return e?V(g,e,h):V(g,"pfx")},U.className=U.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(" js "+a.join(" ")),aa}(this,this.document);