Skip to content

Instantly share code, notes, and snippets.

@SlexAxton
Created February 6, 2012 05:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SlexAxton/1750042 to your computer and use it in GitHub Desktop.
Save SlexAxton/1750042 to your computer and use it in GitHub Desktop.
h5bp cut mod+yepnope build Mod 2.5.1 with Yepnope 1.5.1
/* Modernizr 2.5.1 (Custom Build) | MIT & BSD
* Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
*/
;window.Modernizr=function(a,b,c){function C(a){i.cssText=a}function D(a,b){return C(m.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a)if(i[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),H(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)t[c[d]]=c[d]in j;return t.list&&(t.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,g,h,i=a.length;d<i;d++)j.setAttribute("type",g=a[d]),e=j.type!=="text",e&&(j.value=k,j.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(g)&&j.style.WebkitAppearance!==c?(f.appendChild(j),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(j,null).WebkitAppearance!=="textfield"&&j.offsetHeight!==0,f.removeChild(j)):/^(search|tel)$/.test(g)||(/^(url|email)$/.test(g)?e=j.checkValidity&&j.checkValidity()===!1:/^color$/.test(g)?(f.appendChild(j),f.offsetWidth,e=j.value!=k,f.removeChild(j)):e=j.value!=k)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.5.1",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j=b.createElement("input"),k=":)",l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v=u.slice,w,x=function(a,c,d,e){var h,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:g+(d+1),k.appendChild(j);return h=["&#173;","<style>",a,"</style>"].join(""),k.id=g,m.innerHTML+=h,m.appendChild(k),l||f.appendChild(m),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},y=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return x("@media "+b+" { #"+g+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e});var J=function(c,d){var f=c.join(""),g=d.length;x(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch||(j.touch&&j.touch.offsetTop)===9,e.csstransforms3d=(j.csstransforms3d&&j.csstransforms3d.offsetLeft)===9&&j.csstransforms3d.offsetHeight===3,e.generatedcontent=(j.generatedcontent&&j.generatedcontent.offsetHeight)>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",m.join("touch-enabled),("),g,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",m.join("transform-3d),("),g,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join(""),['#generatedcontent:after{content:"',k,'";visibility:hidden}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){return I("flexOrder")},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!E(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){try{var d=b.createElement("canvas"),e;e=!(!a.WebGLRenderingContext||!d.getContext("experimental-webgl")&&!d.getContext("webgl")),d=c}catch(f){e=!1}return e},r.touch=function(){return e.touch},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){return!!a.openDatabase},r.indexedDB=function(){return!!I("indexedDB",a)},r.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},r.websockets=function(){for(var b=-1,c=o.length;++b<c;)if(a[o[b]+"WebSocket"])return!0;return"WebSocket"in a},r.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(i.backgroundColor,"rgba")},r.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(i.backgroundColor,"rgba")||F(i.backgroundColor,"hsla")},r.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(i.background)},r.backgroundsize=function(){return I("backgroundSize")},r.borderimage=function(){return I("borderImage")},r.borderradius=function(){return I("borderRadius")},r.boxshadow=function(){return I("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){return D("opacity:.55"),/^0.55$/.test(i.opacity)},r.cssanimations=function(){return I("animationName")},r.csscolumns=function(){return I("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return C((a+"-webkit- ".split(" ").join(b+a)+m.join(c+a)).slice(0,-a.length)),F(i.backgroundImage,"gradient")},r.cssreflections=function(){return I("boxReflect")},r.csstransforms=function(){return!!I("transform")},r.csstransforms3d=function(){var a=!!I("perspective");return a&&"webkitPerspective"in f.style&&(a=e.csstransforms3d),a},r.csstransitions=function(){return I("transition")},r.fontface=function(){return e.fontface},r.generatedcontent=function(){return e.generatedcontent},r.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},r.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},r.localstorage=function(){try{return localStorage.setItem(g,g),localStorage.removeItem(g),!0}catch(a){return!1}},r.sessionstorage=function(){try{return sessionStorage.setItem(g,g),sessionStorage.removeItem(g),!0}catch(a){return!1}},r.webworkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(l.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(l.call(b.createElementNS(q.svg,"clipPath")))};for(var L in r)B(r,L)&&(w=L.toLowerCase(),e[w]=r[L](),u.push((e[w]?"":"no-")+w));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,f.className+=" "+(b?"":"no-")+a,e[a]=b}return e},C(""),h=j=null,function(a,b){var c=function(a,c,d){var e,f,g=b.body||(e=c.insertBefore(b.createElement("body"),c.firstChild));return g.insertBefore(a,g.firstChild),a.hidden=!0,f=(d?d(a,null):a.currentStyle).display==="none",g.removeChild(a),e&&c.removeChild(e),f}(b.createElement("a"),b.documentElement,a.getComputedStyle),d=function(a){return a.innerHTML="<x-element></x-element>",a.childNodes.length===1}(b.createElement("a")),e=Date.call,f="abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",g=a.html5||{};g={elements:typeof g.elements=="object"?g.elements:(g.elements||f).split(" "),shivCSS:g.shivCSS!==!1,shivMethods:g.shivMethods!==!1,shivDocument:function(a){if(!d&&!a.documentShived){var b=a.createElement,f=a.createDocumentFragment;for(var h=0,i=g.elements,j=i.length;h<j;++h)e.call(b,a,i[h]);a.createElement=function(c){var d=e.call(b,a,c);return g.shivMethods&&d.canHaveChildren&&!d.xmlns&&!d.tagUrn&&g.shivDocument(d.document),d},a.createDocumentFragment=function(){var b=e.call(f,a);return g.shivMethods?g.shivDocument(b):b}}var k=a.getElementsByTagName("head")[0];if(g.shivCSS&&!c&&k){var l=a.createElement("p");l.innerHTML="x<style>article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}</style>",k.insertBefore(l.lastChild,k.firstChild)}return a.documentShived=!0,a}},g.type="default",a.html5=g,g.shivDocument(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.mq=y,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=x,e.prefixed=function(a,b,c){return b?I(a,b,c):I(a,"pfx")},e}(this,this.document),function(a,b,c){function d(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function e(){var a=m.shift();n=1,a?a.t?j(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),e()):n=0}function f(a,c,f,g,h,i,l){function o(b){if(!s&&d(p.readyState)&&(u.r=s=1,!n&&e(),p.onload=p.onreadystatechange=null,b)){"img"!=a&&j(function(){r.removeChild(p)},50);for(var f in y[c])y[c].hasOwnProperty(f)&&y[c][f].onload()}}var l=l||B.errorTimeout,p={},s=0,t=0,u={t:f,s:c,e:h,a:i,x:l};1===y[c]&&(t=1,y[c]=[],p=b.createElement(a)),"object"==a?p.data=c:(p.src=c,p.type=a),p.width=p.height="0",p.onerror=p.onload=p.onreadystatechange=function(){o.call(this,t)},m.splice(g,0,u),"img"!=a&&(t||2===y[c]?(r.insertBefore(p,q?null:k),j(o,l)):y[c].push(p))}function g(a,b,c,d,g){return n=0,b=b||"j",v(a)?f("c"==b?t:s,a,b,this.i++,c,d,g):(m.splice(this.i++,0,a),1==m.length&&e()),this}function h(){var a=B;return a.loader={load:g,i:0},a}var i=b.documentElement,j=a.setTimeout,k=b.getElementsByTagName("script")[0],l={}.toString,m=[],n=0,o=function(){},p="MozAppearance"in i.style,q=p&&!!b.createRange().compareNode,r=q?i:k.parentNode;a.opera&&l.call(a.opera);var i=!!b.attachEvent,s=p?"object":i?"script":"img",t=i?"script":s,u=Array.isArray||function(a){return"[object Array]"==l.call(a)},v=function(a){return"string"==typeof a},w=function(a){return"[object Function]"==l.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function d(a,d,f,g,i){var j=b(a),k=j.autoCallback;j.url.split(".").pop().split("?").shift();if(!j.bypass){d&&(d=w(d)?d:d[a]||d[g]||d[a.split("/").pop().split("?")[0]]||e);if(j.instead)return j.instead(a,d,f,g,i);y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(w(d)||w(k))&&f.load(function(){h(),d&&d(j.origUrl,i,g),k&&k(j.origUrl,i,g),y[j.url]=2})}}function f(a,b){function c(a,c){if(a){if(v(a))c||(g=function(){var a=[].slice.call(arguments);h.apply(this,a),i()}),d(a,g,b,0,e);else if(Object(a)===a)for(k in j=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(k)&&(!c&&!--j&&(w(g)?g=function(){var a=[].slice.call(arguments);h.apply(this,a),i()}:g[k]=function(a){return function(){var b=[].slice.call(arguments);a.apply(this,b),i()}}(h[k])),d(a[k],g,b,k,e))}else!c&&i()}var e=!!a.test,f=a.load||a.both,g=a.callback||o,h=g,i=a.complete||o,j,k;c(e?a.yep:a.nope,!!f),f&&c(f)}var g,i,j=this.yepnope.loader;if(v(a))d(a,0,j,0);else if(u(a))for(g=0;g<a.length;g++)i=a[g],v(i)?d(i,0,j,0):u(i)?B(i):Object(i)===i&&f(i,j);else Object(a)===a&&f(a,j)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=h(),a.yepnope.executeStack=e,a.yepnope.injectJs=function(a,c,f,g,h,i){var l=b.createElement("script"),m,n,g=g||B.errorTimeout;l.src=a;for(n in f)l.setAttribute(n,f[n]);c=i?e:c||o,l.onreadystatechange=l.onload=function(){!m&&d(l.readyState)&&(m=1,c(),l.onload=l.onreadystatechange=null)},j(function(){m||(m=1,c(1))},g),h?l.onload():k.parentNode.insertBefore(l,k)},a.yepnope.injectCss=function(a,c,d,f,g,h){var f=b.createElement("link"),i,c=h?e:c||o;f.href=a,f.rel="stylesheet",f.type="text/css";for(i in d)f.setAttribute(i,d[i]);g||(k.parentNode.insertBefore(f,k),j(c,0))}}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment