grunt-modernizr
Advanced tools
Comparing version 0.1.5 to 0.1.6
/* Modernizr (Custom Build) | MIT & BSD | ||
* Build: http://modernizr.com/download/#-foo-random-csstransforms-css_displayrunin-mq-shiv-load-testprops-addtest-csstransforms3d-opacity-cssanimations-csstransitions-prefixed-input-touch-json-svg-flexbox-indexedDB-generatedcontent-fontface-contenteditable-contextmenu | ||
* Custom Tests: modernizr.test.js | ||
* Build: http://modernizr.com/download/#-shiv-load-cssclasses-opacity-prefixed-mq-svg-input-touch-csstransforms3d-cssanimations-csstransitions-csstransforms-json-flexbox-indexedDB-generatedcontent-fontface-contenteditable-contextmenu | ||
*/ | ||
; | ||
window.Modernizr = (function( window, document, undefined ) { | ||
var version = '2.6.2', | ||
Modernizr = {}, | ||
docElement = document.documentElement, | ||
mod = 'modernizr', | ||
modElem = document.createElement(mod), | ||
mStyle = modElem.style, | ||
inputElem = document.createElement('input') , | ||
smile = ':)', | ||
toString = {}.toString, | ||
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), | ||
omPrefixes = 'Webkit Moz O ms', | ||
cssomPrefixes = omPrefixes.split(' '), | ||
domPrefixes = omPrefixes.toLowerCase().split(' '), | ||
ns = {'svg': 'http://www.w3.org/2000/svg'}, | ||
tests = {}, | ||
inputs = {}, | ||
attrs = {}, | ||
classes = [], | ||
slice = classes.slice, | ||
featureName, | ||
injectElementWithStyles = function( rule, callback, nodes, testnames ) { | ||
var style, ret, node, docOverflow, | ||
div = document.createElement('div'), | ||
body = document.body, | ||
fakeBody = body || document.createElement('body'); | ||
if ( parseInt(nodes, 10) ) { | ||
while ( nodes-- ) { | ||
node = document.createElement('div'); | ||
node.id = testnames ? testnames[nodes] : mod + (nodes + 1); | ||
div.appendChild(node); | ||
} | ||
} | ||
style = ['­','<style id="s', mod, '">', rule, '</style>'].join(''); | ||
div.id = mod; | ||
(body ? div : fakeBody).innerHTML += style; | ||
fakeBody.appendChild(div); | ||
if ( !body ) { | ||
fakeBody.style.background = ''; | ||
fakeBody.style.overflow = 'hidden'; | ||
docOverflow = docElement.style.overflow; | ||
docElement.style.overflow = 'hidden'; | ||
docElement.appendChild(fakeBody); | ||
} | ||
ret = callback(div, rule); | ||
if ( !body ) { | ||
fakeBody.parentNode.removeChild(fakeBody); | ||
docElement.style.overflow = docOverflow; | ||
} else { | ||
div.parentNode.removeChild(div); | ||
} | ||
return !!ret; | ||
}, | ||
testMediaQuery = function( mq ) { | ||
var matchMedia = window.matchMedia || window.msMatchMedia; | ||
if ( matchMedia ) { | ||
return matchMedia(mq).matches; | ||
} | ||
var bool; | ||
injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) { | ||
bool = (window.getComputedStyle ? | ||
getComputedStyle(node, null) : | ||
node.currentStyle)['position'] == 'absolute'; | ||
}); | ||
return bool; | ||
}, | ||
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; | ||
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) { | ||
hasOwnProp = function (object, property) { | ||
return _hasOwnProperty.call(object, property); | ||
}; | ||
} | ||
else { | ||
hasOwnProp = function (object, property) { | ||
return ((property in object) && is(object.constructor.prototype[property], 'undefined')); | ||
}; | ||
} | ||
if (!Function.prototype.bind) { | ||
Function.prototype.bind = function bind(that) { | ||
var target = this; | ||
if (typeof target != "function") { | ||
throw new TypeError(); | ||
} | ||
var args = slice.call(arguments, 1), | ||
bound = function () { | ||
if (this instanceof bound) { | ||
var F = function(){}; | ||
F.prototype = target.prototype; | ||
var self = new F(); | ||
var result = target.apply( | ||
self, | ||
args.concat(slice.call(arguments)) | ||
); | ||
if (Object(result) === result) { | ||
return result; | ||
} | ||
return self; | ||
} else { | ||
return target.apply( | ||
that, | ||
args.concat(slice.call(arguments)) | ||
); | ||
} | ||
}; | ||
return bound; | ||
}; | ||
} | ||
function setCss( str ) { | ||
mStyle.cssText = str; | ||
} | ||
function setCssAll( str1, str2 ) { | ||
return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); | ||
} | ||
function is( obj, type ) { | ||
return typeof obj === type; | ||
} | ||
function contains( str, substr ) { | ||
return !!~('' + str).indexOf(substr); | ||
} | ||
function testProps( props, prefixed ) { | ||
for ( var i in props ) { | ||
var prop = props[i]; | ||
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) { | ||
return prefixed == 'pfx' ? prop : true; | ||
} | ||
} | ||
return false; | ||
} | ||
function testDOMProps( props, obj, elem ) { | ||
for ( var i in props ) { | ||
var item = obj[props[i]]; | ||
if ( item !== undefined) { | ||
if (elem === false) return props[i]; | ||
if (is(item, 'function')){ | ||
return item.bind(elem || obj); | ||
} | ||
return item; | ||
} | ||
} | ||
return false; | ||
} | ||
function testPropsAll( prop, prefixed, elem ) { | ||
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), | ||
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); | ||
if(is(prefixed, "string") || is(prefixed, "undefined")) { | ||
return testProps(props, prefixed); | ||
} else { | ||
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); | ||
return testDOMProps(props, prefixed, elem); | ||
} | ||
} tests['flexbox'] = function() { | ||
return testPropsAll('flexWrap'); | ||
}; | ||
tests['touch'] = function() { | ||
var bool; | ||
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { | ||
bool = true; | ||
} else { | ||
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) { | ||
bool = node.offsetTop === 9; | ||
}); | ||
} | ||
return bool; | ||
}; | ||
tests['opacity'] = function() { | ||
setCssAll('opacity:.55'); | ||
return (/^0.55$/).test(mStyle.opacity); | ||
}; | ||
tests['cssanimations'] = function() { | ||
return testPropsAll('animationName'); | ||
}; | ||
tests['csstransforms'] = function() { | ||
return !!testPropsAll('transform'); | ||
}; | ||
tests['csstransforms3d'] = function() { | ||
var ret = !!testPropsAll('perspective'); | ||
if ( ret && 'webkitPerspective' in docElement.style ) { | ||
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) { | ||
ret = node.offsetLeft === 9 && node.offsetHeight === 3; | ||
}); | ||
} | ||
return ret; | ||
}; | ||
tests['csstransitions'] = function() { | ||
return testPropsAll('transition'); | ||
}; | ||
tests['fontface'] = function() { | ||
var bool; | ||
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) { | ||
var style = document.getElementById('smodernizr'), | ||
sheet = style.sheet || style.styleSheet, | ||
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : ''; | ||
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0; | ||
}); | ||
return bool; | ||
}; | ||
tests['generatedcontent'] = function() { | ||
var bool; | ||
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) { | ||
bool = node.offsetHeight >= 3; | ||
}); | ||
return bool; | ||
}; | ||
tests['svg'] = function() { | ||
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; | ||
}; | ||
function webforms() { | ||
Modernizr['input'] = (function( props ) { | ||
for ( var i = 0, len = props.length; i < len; i++ ) { | ||
attrs[ props[i] ] = !!(props[i] in inputElem); | ||
} | ||
if (attrs.list){ | ||
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); | ||
} | ||
return attrs; | ||
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); | ||
} | ||
for ( var feature in tests ) { | ||
if ( hasOwnProp(tests, feature) ) { | ||
featureName = feature.toLowerCase(); | ||
Modernizr[featureName] = tests[feature](); | ||
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); | ||
} | ||
} | ||
Modernizr.input || webforms(); | ||
Modernizr.addTest = function ( feature, test ) { | ||
if ( typeof feature == 'object' ) { | ||
for ( var key in feature ) { | ||
if ( hasOwnProp( feature, key ) ) { | ||
Modernizr.addTest( key, feature[ key ] ); | ||
} | ||
} | ||
} else { | ||
feature = feature.toLowerCase(); | ||
if ( Modernizr[feature] !== undefined ) { | ||
return Modernizr; | ||
} | ||
test = typeof test == 'function' ? test() : test; | ||
if (typeof enableClasses !== "undefined" && enableClasses) { | ||
docElement.className += ' ' + (test ? '' : 'no-') + feature; | ||
} | ||
Modernizr[feature] = test; | ||
} | ||
return Modernizr; | ||
}; | ||
setCss(''); | ||
modElem = inputElem = null; | ||
;(function(window, document) { | ||
var options = window.html5 || {}; | ||
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; | ||
var saveClones = /^(?: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; | ||
var supportsHtml5Styles; | ||
var expando = '_html5shiv'; | ||
var expanID = 0; | ||
var expandoData = {}; | ||
var supportsUnknownElements; | ||
(function() { | ||
try { | ||
var a = document.createElement('a'); | ||
a.innerHTML = '<xyz></xyz>'; | ||
supportsHtml5Styles = ('hidden' in a); | ||
supportsUnknownElements = a.childNodes.length == 1 || (function() { | ||
(document.createElement)('a'); | ||
var frag = document.createDocumentFragment(); | ||
return ( | ||
typeof frag.cloneNode == 'undefined' || | ||
typeof frag.createDocumentFragment == 'undefined' || | ||
typeof frag.createElement == 'undefined' | ||
); | ||
}()); | ||
} catch(e) { | ||
supportsHtml5Styles = true; | ||
supportsUnknownElements = true; | ||
} | ||
}()); function addStyleSheet(ownerDocument, cssText) { | ||
var p = ownerDocument.createElement('p'), | ||
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; | ||
p.innerHTML = 'x<style>' + cssText + '</style>'; | ||
return parent.insertBefore(p.lastChild, parent.firstChild); | ||
} | ||
function getElements() { | ||
var elements = html5.elements; | ||
return typeof elements == 'string' ? elements.split(' ') : elements; | ||
} | ||
function getExpandoData(ownerDocument) { | ||
var data = expandoData[ownerDocument[expando]]; | ||
if (!data) { | ||
data = {}; | ||
expanID++; | ||
ownerDocument[expando] = expanID; | ||
expandoData[expanID] = data; | ||
} | ||
return data; | ||
} | ||
function createElement(nodeName, ownerDocument, data){ | ||
if (!ownerDocument) { | ||
ownerDocument = document; | ||
} | ||
if(supportsUnknownElements){ | ||
return ownerDocument.createElement(nodeName); | ||
} | ||
if (!data) { | ||
data = getExpandoData(ownerDocument); | ||
} | ||
var node; | ||
if (data.cache[nodeName]) { | ||
node = data.cache[nodeName].cloneNode(); | ||
} else if (saveClones.test(nodeName)) { | ||
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); | ||
} else { | ||
node = data.createElem(nodeName); | ||
} | ||
return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node; | ||
} | ||
function createDocumentFragment(ownerDocument, data){ | ||
if (!ownerDocument) { | ||
ownerDocument = document; | ||
} | ||
if(supportsUnknownElements){ | ||
return ownerDocument.createDocumentFragment(); | ||
} | ||
data = data || getExpandoData(ownerDocument); | ||
var clone = data.frag.cloneNode(), | ||
i = 0, | ||
elems = getElements(), | ||
l = elems.length; | ||
for(;i<l;i++){ | ||
clone.createElement(elems[i]); | ||
} | ||
return clone; | ||
} | ||
function shivMethods(ownerDocument, data) { | ||
if (!data.cache) { | ||
data.cache = {}; | ||
data.createElem = ownerDocument.createElement; | ||
data.createFrag = ownerDocument.createDocumentFragment; | ||
data.frag = data.createFrag(); | ||
} | ||
ownerDocument.createElement = function(nodeName) { | ||
if (!html5.shivMethods) { | ||
return data.createElem(nodeName); | ||
} | ||
return createElement(nodeName, ownerDocument, data); | ||
}; | ||
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + | ||
'var n=f.cloneNode(),c=n.createElement;' + | ||
'h.shivMethods&&(' + | ||
getElements().join().replace(/\w+/g, function(nodeName) { | ||
data.createElem(nodeName); | ||
data.frag.createElement(nodeName); | ||
return 'c("' + nodeName + '")'; | ||
}) + | ||
');return n}' | ||
)(html5, data.frag); | ||
} function shivDocument(ownerDocument) { | ||
if (!ownerDocument) { | ||
ownerDocument = document; | ||
} | ||
var data = getExpandoData(ownerDocument); | ||
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { | ||
data.hasCSS = !!addStyleSheet(ownerDocument, | ||
'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' + | ||
'mark{background:#FF0;color:#000}' | ||
); | ||
} | ||
if (!supportsUnknownElements) { | ||
shivMethods(ownerDocument, data); | ||
} | ||
return ownerDocument; | ||
} var html5 = { | ||
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video', | ||
'shivCSS': (options.shivCSS !== false), | ||
'supportsUnknownElements': supportsUnknownElements, | ||
'shivMethods': (options.shivMethods !== false), | ||
'type': 'default', | ||
'shivDocument': shivDocument, | ||
createElement: createElement, | ||
createDocumentFragment: createDocumentFragment | ||
}; window.html5 = html5; | ||
shivDocument(document); | ||
}(this, document)); | ||
Modernizr._version = version; | ||
Modernizr._prefixes = prefixes; | ||
Modernizr._domPrefixes = domPrefixes; | ||
Modernizr._cssomPrefixes = cssomPrefixes; | ||
Modernizr.mq = testMediaQuery; | ||
Modernizr.testProp = function(prop){ | ||
return testProps([prop]); | ||
}; | ||
Modernizr.testAllProps = testPropsAll; | ||
Modernizr.testStyles = injectElementWithStyles; | ||
Modernizr.prefixed = function(prop, obj, elem){ | ||
if(!obj) { | ||
return testPropsAll(prop, 'pfx'); | ||
} else { | ||
return testPropsAll(prop, obj, elem); | ||
} | ||
}; | ||
return Modernizr; | ||
})(this, this.document); | ||
(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.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 g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},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=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}})(this,document); | ||
Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0));}; | ||
Modernizr.testStyles(' #modernizr { display: run-in; } ', function(elem, rule){ | ||
var ret = (window.getComputedStyle ? | ||
getComputedStyle(elem, null).getPropertyValue('display') : | ||
elem.currentStyle['display']); | ||
Modernizr.addTest('display-runin', ret == 'run-in'); | ||
}); | ||
Modernizr.addTest('json', !!window.JSON && !!JSON.parse); | ||
Modernizr.addTest('contenteditable', | ||
'contentEditable' in document.documentElement); | ||
Modernizr.addTest( | ||
'contextmenu', | ||
('contextMenu' in document.documentElement && 'HTMLMenuItemElement' in window) | ||
); | ||
Modernizr.addTest("something", function () {}); | ||
; | ||
;window.Modernizr=function(e,t,n){function L(e){f.cssText=e}function A(e,t){return L(p.join(e+";")+(t||""))}function O(e,t){return typeof e===t}function M(e,t){return!!~(""+e).indexOf(t)}function _(e,t){for(var r in e){var i=e[r];if(!M(i,"-")&&f[i]!==n)return t=="pfx"?i:!0}return!1}function D(e,t,r){for(var i in e){var s=t[e[i]];if(s!==n)return r===!1?e[i]:O(s,"function")?s.bind(r||t):s}return!1}function P(e,t,n){var r=e.charAt(0).toUpperCase()+e.slice(1),i=(e+" "+v.join(r+" ")+r).split(" ");return O(t,"string")||O(t,"undefined")?_(i,t):(i=(e+" "+m.join(r+" ")+r).split(" "),D(i,t,n))}function H(){i.input=function(n){for(var r=0,i=n.length;r<i;r++)w[n[r]]=n[r]in l;return w.list&&(w.list=!!t.createElement("datalist")&&!!e.HTMLDataListElement),w}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "))}var r="2.6.2",i={},s=!0,o=t.documentElement,u="modernizr",a=t.createElement(u),f=a.style,l=t.createElement("input"),c=":)",h={}.toString,p=" -webkit- -moz- -o- -ms- ".split(" "),d="Webkit Moz O ms",v=d.split(" "),m=d.toLowerCase().split(" "),g={svg:"http://www.w3.org/2000/svg"},y={},b={},w={},E=[],S=E.slice,x,T=function(e,n,r,i){var s,a,f,l,c=t.createElement("div"),h=t.body,p=h||t.createElement("body");if(parseInt(r,10))while(r--)f=t.createElement("div"),f.id=i?i[r]:u+(r+1),c.appendChild(f);return s=["­",'<style id="s',u,'">',e,"</style>"].join(""),c.id=u,(h?c:p).innerHTML+=s,p.appendChild(c),h||(p.style.background="",p.style.overflow="hidden",l=o.style.overflow,o.style.overflow="hidden",o.appendChild(p)),a=n(c,e),h?c.parentNode.removeChild(c):(p.parentNode.removeChild(p),o.style.overflow=l),!!a},N=function(t){var n=e.matchMedia||e.msMatchMedia;if(n)return n(t).matches;var r;return T("@media "+t+" { #"+u+" { position: absolute; } }",function(t){r=(e.getComputedStyle?getComputedStyle(t,null):t.currentStyle)["position"]=="absolute"}),r},C={}.hasOwnProperty,k;!O(C,"undefined")&&!O(C.call,"undefined")?k=function(e,t){return C.call(e,t)}:k=function(e,t){return t in e&&O(e.constructor.prototype[t],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError;var r=S.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=n.prototype;var s=new e,o=n.apply(s,r.concat(S.call(arguments)));return Object(o)===o?o:s}return n.apply(t,r.concat(S.call(arguments)))};return i}),y.flexbox=function(){return P("flexWrap")},y.touch=function(){var n;return"ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch?n=!0:T(["@media (",p.join("touch-enabled),("),u,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(e){n=e.offsetTop===9}),n},y.opacity=function(){return A("opacity:.55"),/^0.55$/.test(f.opacity)},y.cssanimations=function(){return P("animationName")},y.csstransforms=function(){return!!P("transform")},y.csstransforms3d=function(){var e=!!P("perspective");return e&&"webkitPerspective"in o.style&&T("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t,n){e=t.offsetLeft===9&&t.offsetHeight===3}),e},y.csstransitions=function(){return P("transition")},y.fontface=function(){var e;return T('@font-face {font-family:"font";src:url("https://")}',function(n,r){var i=t.getElementById("smodernizr"),s=i.sheet||i.styleSheet,o=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"";e=/src/i.test(o)&&o.indexOf(r.split(" ")[0])===0}),e},y.generatedcontent=function(){var e;return T(["#",u,"{font:0/0 a}#",u,':after{content:"',c,'";visibility:hidden;font:3px/1 a}'].join(""),function(t){e=t.offsetHeight>=3}),e},y.svg=function(){return!!t.createElementNS&&!!t.createElementNS(g.svg,"svg").createSVGRect};for(var B in y)k(y,B)&&(x=B.toLowerCase(),i[x]=y[B](),E.push((i[x]?"":"no-")+x));return i.input||H(),i.addTest=function(e,t){if(typeof e=="object")for(var r in e)k(e,r)&&i.addTest(r,e[r]);else{e=e.toLowerCase();if(i[e]!==n)return i;t=typeof t=="function"?t():t,typeof s!="undefined"&&s&&(o.className+=" "+(t?"":"no-")+e),i[e]=t}return i},L(""),a=l=null,function(e,t){function l(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function c(){var e=g.elements;return typeof e=="string"?e.split(" "):e}function h(e){var t=a[e[o]];return t||(t={},u++,e[o]=u,a[u]=t),t}function p(e,n,s){n||(n=t);if(f)return n.createElement(e);s||(s=h(n));var o;return s.cache[e]?o=s.cache[e].cloneNode():i.test(e)?o=(s.cache[e]=s.createElem(e)).cloneNode():o=s.createElem(e),o.canHaveChildren&&!r.test(e)?s.frag.appendChild(o):o}function d(e,n){e||(e=t);if(f)return e.createDocumentFragment();n=n||h(e);var r=n.frag.cloneNode(),i=0,s=c(),o=s.length;for(;i<o;i++)r.createElement(s[i]);return r}function v(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return g.shivMethods?p(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+c().join().replace(/\w+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(g,t.frag)}function m(e){e||(e=t);var n=h(e);return g.shivCSS&&!s&&!n.hasCSS&&(n.hasCSS=!!l(e,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),f||v(e,n),e}var n=e.html5||{},r=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,i=/^(?: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,s,o="_html5shiv",u=0,a={},f;(function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",s="hidden"in e,f=e.childNodes.length==1||function(){t.createElement("a");var e=t.createDocumentFragment();return typeof e.cloneNode=="undefined"||typeof e.createDocumentFragment=="undefined"||typeof e.createElement=="undefined"}()}catch(n){s=!0,f=!0}})();var g={elements:n.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:n.shivCSS!==!1,supportsUnknownElements:f,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:m,createElement:p,createDocumentFragment:d};e.html5=g,m(t)}(this,t),i._version=r,i._prefixes=p,i._domPrefixes=m,i._cssomPrefixes=v,i.mq=N,i.testProp=function(e){return _([e])},i.testAllProps=P,i.testStyles=T,i.prefixed=function(e,t,n){return t?P(e,t,n):P(e,"pfx")},o.className=o.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(s?" js "+E.join(" "):""),i}(this,this.document),function(e,t,n){function r(e){return"[object Function]"==d.call(e)}function i(e){return"string"==typeof e}function s(){}function o(e){return!e||"loaded"==e||"complete"==e||"uninitialized"==e}function u(){var e=v.shift();m=1,e?e.t?h(function(){("c"==e.t?k.injectCss:k.injectJs)(e.s,0,e.a,e.x,e.e,1)},0):(e(),u()):m=0}function a(e,n,r,i,s,a,f){function l(t){if(!d&&o(c.readyState)&&(w.r=d=1,!m&&u(),c.onload=c.onreadystatechange=null,t)){"img"!=e&&h(function(){b.removeChild(c)},50);for(var r in T[n])T[n].hasOwnProperty(r)&&T[n][r].onload()}}var f=f||k.errorTimeout,c=t.createElement(e),d=0,g=0,w={t:r,s:n,e:s,a:a,x:f};1===T[n]&&(g=1,T[n]=[]),"object"==e?c.data=n:(c.src=n,c.type=e),c.width=c.height="0",c.onerror=c.onload=c.onreadystatechange=function(){l.call(this,g)},v.splice(i,0,w),"img"!=e&&(g||2===T[n]?(b.insertBefore(c,y?null:p),h(l,f)):T[n].push(c))}function f(e,t,n,r,s){return m=0,t=t||"j",i(e)?a("c"==t?E:w,e,t,this.i++,n,r,s):(v.splice(this.i++,0,e),1==v.length&&u()),this}function l(){var e=k;return e.loader={load:f,i:0},e}var c=t.documentElement,h=e.setTimeout,p=t.getElementsByTagName("script")[0],d={}.toString,v=[],m=0,g="MozAppearance"in c.style,y=g&&!!t.createRange().compareNode,b=y?c:p.parentNode,c=e.opera&&"[object Opera]"==d.call(e.opera),c=!!t.attachEvent&&!c,w=g?"object":c?"script":"img",E=c?"script":w,S=Array.isArray||function(e){return"[object Array]"==d.call(e)},x=[],T={},N={timeout:function(e,t){return t.length&&(e.timeout=t[0]),e}},C,k;k=function(e){function t(e){var e=e.split("!"),t=x.length,n=e.pop(),r=e.length,n={url:n,origUrl:n,prefixes:e},i,s,o;for(s=0;s<r;s++)o=e[s].split("="),(i=N[o.shift()])&&(n=i(n,o));for(s=0;s<t;s++)n=x[s](n);return n}function o(e,i,s,o,u){var a=t(e),f=a.autoCallback;a.url.split(".").pop().split("?").shift(),a.bypass||(i&&(i=r(i)?i:i[e]||i[o]||i[e.split("/").pop().split("?")[0]]),a.instead?a.instead(e,i,s,o,u):(T[a.url]?a.noexec=!0:T[a.url]=1,s.load(a.url,a.forceCSS||!a.forceJS&&"css"==a.url.split(".").pop().split("?").shift()?"c":n,a.noexec,a.attrs,a.timeout),(r(i)||r(f))&&s.load(function(){l(),i&&i(a.origUrl,u,o),f&&f(a.origUrl,u,o),T[a.url]=2})))}function u(e,t){function n(e,n){if(e){if(i(e))n||(f=function(){var e=[].slice.call(arguments);l.apply(this,e),c()}),o(e,f,t,0,u);else if(Object(e)===e)for(p in h=function(){var t=0,n;for(n in e)e.hasOwnProperty(n)&&t++;return t}(),e)e.hasOwnProperty(p)&&(!n&&!--h&&(r(f)?f=function(){var e=[].slice.call(arguments);l.apply(this,e),c()}:f[p]=function(e){return function(){var t=[].slice.call(arguments);e&&e.apply(this,t),c()}}(l[p])),o(e[p],f,t,p,u))}else!n&&c()}var u=!!e.test,a=e.load||e.both,f=e.callback||s,l=f,c=e.complete||s,h,p;n(u?e.yep:e.nope,!!a),a&&n(a)}var a,f,c=this.yepnope.loader;if(i(e))o(e,0,c,0);else if(S(e))for(a=0;a<e.length;a++)f=e[a],i(f)?o(f,0,c,0):S(f)?k(f):Object(f)===f&&u(f,c);else Object(e)===e&&u(e,c)},k.addPrefix=function(e,t){N[e]=t},k.addFilter=function(e){x.push(e)},k.errorTimeout=1e4,null==t.readyState&&t.addEventListener&&(t.readyState="loading",t.addEventListener("DOMContentLoaded",C=function(){t.removeEventListener("DOMContentLoaded",C,0),t.readyState="complete"},0)),e.yepnope=l(),e.yepnope.executeStack=u,e.yepnope.injectJs=function(e,n,r,i,a,f){var l=t.createElement("script"),c,d,i=i||k.errorTimeout;l.src=e;for(d in r)l.setAttribute(d,r[d]);n=f?u:n||s,l.onreadystatechange=l.onload=function(){!c&&o(l.readyState)&&(c=1,n(),l.onload=l.onreadystatechange=null)},h(function(){c||(c=1,n(1))},i),a?l.onload():p.parentNode.insertBefore(l,p)},e.yepnope.injectCss=function(e,n,r,i,o,a){var i=t.createElement("link"),f,n=a?u:n||s;i.href=e,i.rel="stylesheet",i.type="text/css";for(f in r)i.setAttribute(f,r[f]);o||(p.parentNode.insertBefore(i,p),h(n,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},Modernizr.addTest("contextmenu","contextMenu"in document.documentElement&&"HTMLMenuItemElement"in window),Modernizr.addTest("contenteditable","contentEditable"in document.documentElement),Modernizr.addTest("json",!!window.JSON&&!!JSON.parse); |
@@ -169,3 +169,3 @@ var Gruntifier = function (grunt, done, bust) { | ||
files = grunt.file.expandFiles(config.files); | ||
files = grunt.file.expand({filter: 'isFile'}, config.files); | ||
exclude = _defaults.excludeFiles.concat(config.excludeFiles); | ||
@@ -381,3 +381,3 @@ | ||
promise.when(this.xhr(communityRequests)).then(function (community) { | ||
customTests = grunt.file.expandFiles(config.customTests); | ||
customTests = grunt.file.expand({filter: 'isFile'}, config.customTests); | ||
@@ -384,0 +384,0 @@ if (customTests.length) { |
{ | ||
"name": "grunt-modernizr", | ||
"description": "Build out a lean, mean Modernizr machine.", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"homepage": "https://github.com/doctyper/grunt-modernizr", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
407922
4898