modernizr-2.6.2-respond-1.1.0.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999
  1. /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
  2. * Build: http://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-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
  3. */
  4. ;
  5. window.Modernizr = (function( window, document, undefined ) {
  6. var version = '2.6.2',
  7. Modernizr = {},
  8. enableClasses = true,
  9. docElement = document.documentElement,
  10. mod = 'modernizr',
  11. modElem = document.createElement(mod),
  12. mStyle = modElem.style,
  13. inputElem = document.createElement('input') ,
  14. smile = ':)',
  15. toString = {}.toString,
  16. prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
  17. omPrefixes = 'Webkit Moz O ms',
  18. cssomPrefixes = omPrefixes.split(' '),
  19. domPrefixes = omPrefixes.toLowerCase().split(' '),
  20. ns = {'svg': 'http://www.w3.org/2000/svg'},
  21. tests = {},
  22. inputs = {},
  23. attrs = {},
  24. classes = [],
  25. slice = classes.slice,
  26. featureName,
  27. injectElementWithStyles = function( rule, callback, nodes, testnames ) {
  28. var style, ret, node, docOverflow,
  29. div = document.createElement('div'),
  30. body = document.body,
  31. fakeBody = body || document.createElement('body');
  32. if ( parseInt(nodes, 10) ) {
  33. while ( nodes-- ) {
  34. node = document.createElement('div');
  35. node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
  36. div.appendChild(node);
  37. }
  38. }
  39. style = ['&#173;','<style id="s', mod, '">', rule, '</style>'].join('');
  40. div.id = mod;
  41. (body ? div : fakeBody).innerHTML += style;
  42. fakeBody.appendChild(div);
  43. if ( !body ) {
  44. fakeBody.style.background = '';
  45. fakeBody.style.overflow = 'hidden';
  46. docOverflow = docElement.style.overflow;
  47. docElement.style.overflow = 'hidden';
  48. docElement.appendChild(fakeBody);
  49. }
  50. ret = callback(div, rule);
  51. if ( !body ) {
  52. fakeBody.parentNode.removeChild(fakeBody);
  53. docElement.style.overflow = docOverflow;
  54. } else {
  55. div.parentNode.removeChild(div);
  56. }
  57. return !!ret;
  58. },
  59. testMediaQuery = function( mq ) {
  60. var matchMedia = window.matchMedia || window.msMatchMedia;
  61. if ( matchMedia ) {
  62. return matchMedia(mq).matches;
  63. }
  64. var bool;
  65. injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
  66. bool = (window.getComputedStyle ?
  67. getComputedStyle(node, null) :
  68. node.currentStyle)['position'] == 'absolute';
  69. });
  70. return bool;
  71. },
  72. isEventSupported = (function() {
  73. var TAGNAMES = {
  74. 'select': 'input', 'change': 'input',
  75. 'submit': 'form', 'reset': 'form',
  76. 'error': 'img', 'load': 'img', 'abort': 'img'
  77. };
  78. function isEventSupported( eventName, element ) {
  79. element = element || document.createElement(TAGNAMES[eventName] || 'div');
  80. eventName = 'on' + eventName;
  81. var isSupported = eventName in element;
  82. if ( !isSupported ) {
  83. if ( !element.setAttribute ) {
  84. element = document.createElement('div');
  85. }
  86. if ( element.setAttribute && element.removeAttribute ) {
  87. element.setAttribute(eventName, '');
  88. isSupported = is(element[eventName], 'function');
  89. if ( !is(element[eventName], 'undefined') ) {
  90. element[eventName] = undefined;
  91. }
  92. element.removeAttribute(eventName);
  93. }
  94. }
  95. element = null;
  96. return isSupported;
  97. }
  98. return isEventSupported;
  99. })(),
  100. _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
  101. if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
  102. hasOwnProp = function (object, property) {
  103. return _hasOwnProperty.call(object, property);
  104. };
  105. }
  106. else {
  107. hasOwnProp = function (object, property) {
  108. return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
  109. };
  110. }
  111. if (!Function.prototype.bind) {
  112. Function.prototype.bind = function bind(that) {
  113. var target = this;
  114. if (typeof target != "function") {
  115. throw new TypeError();
  116. }
  117. var args = slice.call(arguments, 1),
  118. bound = function () {
  119. if (this instanceof bound) {
  120. var F = function(){};
  121. F.prototype = target.prototype;
  122. var self = new F();
  123. var result = target.apply(
  124. self,
  125. args.concat(slice.call(arguments))
  126. );
  127. if (Object(result) === result) {
  128. return result;
  129. }
  130. return self;
  131. } else {
  132. return target.apply(
  133. that,
  134. args.concat(slice.call(arguments))
  135. );
  136. }
  137. };
  138. return bound;
  139. };
  140. }
  141. function setCss( str ) {
  142. mStyle.cssText = str;
  143. }
  144. function setCssAll( str1, str2 ) {
  145. return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
  146. }
  147. function is( obj, type ) {
  148. return typeof obj === type;
  149. }
  150. function contains( str, substr ) {
  151. return !!~('' + str).indexOf(substr);
  152. }
  153. function testProps( props, prefixed ) {
  154. for ( var i in props ) {
  155. var prop = props[i];
  156. if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
  157. return prefixed == 'pfx' ? prop : true;
  158. }
  159. }
  160. return false;
  161. }
  162. function testDOMProps( props, obj, elem ) {
  163. for ( var i in props ) {
  164. var item = obj[props[i]];
  165. if ( item !== undefined) {
  166. if (elem === false) return props[i];
  167. if (is(item, 'function')){
  168. return item.bind(elem || obj);
  169. }
  170. return item;
  171. }
  172. }
  173. return false;
  174. }
  175. function testPropsAll( prop, prefixed, elem ) {
  176. var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
  177. props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
  178. if(is(prefixed, "string") || is(prefixed, "undefined")) {
  179. return testProps(props, prefixed);
  180. } else {
  181. props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
  182. return testDOMProps(props, prefixed, elem);
  183. }
  184. } tests['flexbox'] = function() {
  185. return testPropsAll('flexWrap');
  186. }; tests['canvas'] = function() {
  187. var elem = document.createElement('canvas');
  188. return !!(elem.getContext && elem.getContext('2d'));
  189. };
  190. tests['canvastext'] = function() {
  191. return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
  192. };
  193. tests['webgl'] = function() {
  194. return !!window.WebGLRenderingContext;
  195. };
  196. tests['touch'] = function() {
  197. var bool;
  198. if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
  199. bool = true;
  200. } else {
  201. injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
  202. bool = node.offsetTop === 9;
  203. });
  204. }
  205. return bool;
  206. };
  207. tests['geolocation'] = function() {
  208. return 'geolocation' in navigator;
  209. };
  210. tests['postmessage'] = function() {
  211. return !!window.postMessage;
  212. };
  213. tests['websqldatabase'] = function() {
  214. return !!window.openDatabase;
  215. };
  216. tests['indexedDB'] = function() {
  217. return !!testPropsAll("indexedDB", window);
  218. };
  219. tests['hashchange'] = function() {
  220. return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
  221. };
  222. tests['history'] = function() {
  223. return !!(window.history && history.pushState);
  224. };
  225. tests['draganddrop'] = function() {
  226. var div = document.createElement('div');
  227. return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
  228. };
  229. tests['websockets'] = function() {
  230. return 'WebSocket' in window || 'MozWebSocket' in window;
  231. };
  232. tests['rgba'] = function() {
  233. setCss('background-color:rgba(150,255,150,.5)');
  234. return contains(mStyle.backgroundColor, 'rgba');
  235. };
  236. tests['hsla'] = function() {
  237. setCss('background-color:hsla(120,40%,100%,.5)');
  238. return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
  239. };
  240. tests['multiplebgs'] = function() {
  241. setCss('background:url(https://),url(https://),red url(https://)');
  242. return (/(url\s*\(.*?){3}/).test(mStyle.background);
  243. }; tests['backgroundsize'] = function() {
  244. return testPropsAll('backgroundSize');
  245. };
  246. tests['borderimage'] = function() {
  247. return testPropsAll('borderImage');
  248. };
  249. tests['borderradius'] = function() {
  250. return testPropsAll('borderRadius');
  251. };
  252. tests['boxshadow'] = function() {
  253. return testPropsAll('boxShadow');
  254. };
  255. tests['textshadow'] = function() {
  256. return document.createElement('div').style.textShadow === '';
  257. };
  258. tests['opacity'] = function() {
  259. setCssAll('opacity:.55');
  260. return (/^0.55$/).test(mStyle.opacity);
  261. };
  262. tests['cssanimations'] = function() {
  263. return testPropsAll('animationName');
  264. };
  265. tests['csscolumns'] = function() {
  266. return testPropsAll('columnCount');
  267. };
  268. tests['cssgradients'] = function() {
  269. var str1 = 'background-image:',
  270. str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
  271. str3 = 'linear-gradient(left top,#9f9, white);';
  272. setCss(
  273. (str1 + '-webkit- '.split(' ').join(str2 + str1) +
  274. prefixes.join(str3 + str1)).slice(0, -str1.length)
  275. );
  276. return contains(mStyle.backgroundImage, 'gradient');
  277. };
  278. tests['cssreflections'] = function() {
  279. return testPropsAll('boxReflect');
  280. };
  281. tests['csstransforms'] = function() {
  282. return !!testPropsAll('transform');
  283. };
  284. tests['csstransforms3d'] = function() {
  285. var ret = !!testPropsAll('perspective');
  286. if ( ret && 'webkitPerspective' in docElement.style ) {
  287. injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
  288. ret = node.offsetLeft === 9 && node.offsetHeight === 3;
  289. });
  290. }
  291. return ret;
  292. };
  293. tests['csstransitions'] = function() {
  294. return testPropsAll('transition');
  295. };
  296. tests['fontface'] = function() {
  297. var bool;
  298. injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
  299. var style = document.getElementById('smodernizr'),
  300. sheet = style.sheet || style.styleSheet,
  301. cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
  302. bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
  303. });
  304. return bool;
  305. };
  306. tests['generatedcontent'] = function() {
  307. var bool;
  308. injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
  309. bool = node.offsetHeight >= 3;
  310. });
  311. return bool;
  312. };
  313. tests['video'] = function() {
  314. var elem = document.createElement('video'),
  315. bool = false;
  316. try {
  317. if ( bool = !!elem.canPlayType ) {
  318. bool = new Boolean(bool);
  319. bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
  320. bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
  321. bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
  322. }
  323. } catch(e) { }
  324. return bool;
  325. };
  326. tests['audio'] = function() {
  327. var elem = document.createElement('audio'),
  328. bool = false;
  329. try {
  330. if ( bool = !!elem.canPlayType ) {
  331. bool = new Boolean(bool);
  332. bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
  333. bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
  334. bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
  335. bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
  336. elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
  337. }
  338. } catch(e) { }
  339. return bool;
  340. };
  341. tests['localstorage'] = function() {
  342. try {
  343. localStorage.setItem(mod, mod);
  344. localStorage.removeItem(mod);
  345. return true;
  346. } catch(e) {
  347. return false;
  348. }
  349. };
  350. tests['sessionstorage'] = function() {
  351. try {
  352. sessionStorage.setItem(mod, mod);
  353. sessionStorage.removeItem(mod);
  354. return true;
  355. } catch(e) {
  356. return false;
  357. }
  358. };
  359. tests['webworkers'] = function() {
  360. return !!window.Worker;
  361. };
  362. tests['applicationcache'] = function() {
  363. return !!window.applicationCache;
  364. };
  365. tests['svg'] = function() {
  366. return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
  367. };
  368. tests['inlinesvg'] = function() {
  369. var div = document.createElement('div');
  370. div.innerHTML = '<svg/>';
  371. return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
  372. };
  373. tests['smil'] = function() {
  374. return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
  375. };
  376. tests['svgclippaths'] = function() {
  377. return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
  378. };
  379. function webforms() {
  380. Modernizr['input'] = (function( props ) {
  381. for ( var i = 0, len = props.length; i < len; i++ ) {
  382. attrs[ props[i] ] = !!(props[i] in inputElem);
  383. }
  384. if (attrs.list){
  385. attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
  386. }
  387. return attrs;
  388. })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
  389. Modernizr['inputtypes'] = (function(props) {
  390. for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
  391. inputElem.setAttribute('type', inputElemType = props[i]);
  392. bool = inputElem.type !== 'text';
  393. if ( bool ) {
  394. inputElem.value = smile;
  395. inputElem.style.cssText = 'position:absolute;visibility:hidden;';
  396. if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
  397. docElement.appendChild(inputElem);
  398. defaultView = document.defaultView;
  399. bool = defaultView.getComputedStyle &&
  400. defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
  401. (inputElem.offsetHeight !== 0);
  402. docElement.removeChild(inputElem);
  403. } else if ( /^(search|tel)$/.test(inputElemType) ){
  404. } else if ( /^(url|email)$/.test(inputElemType) ) {
  405. bool = inputElem.checkValidity && inputElem.checkValidity() === false;
  406. } else {
  407. bool = inputElem.value != smile;
  408. }
  409. }
  410. inputs[ props[i] ] = !!bool;
  411. }
  412. return inputs;
  413. })('search tel url email datetime date month week time datetime-local number range color'.split(' '));
  414. }
  415. for ( var feature in tests ) {
  416. if ( hasOwnProp(tests, feature) ) {
  417. featureName = feature.toLowerCase();
  418. Modernizr[featureName] = tests[feature]();
  419. classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
  420. }
  421. }
  422. Modernizr.input || webforms();
  423. Modernizr.addTest = function ( feature, test ) {
  424. if ( typeof feature == 'object' ) {
  425. for ( var key in feature ) {
  426. if ( hasOwnProp( feature, key ) ) {
  427. Modernizr.addTest( key, feature[ key ] );
  428. }
  429. }
  430. } else {
  431. feature = feature.toLowerCase();
  432. if ( Modernizr[feature] !== undefined ) {
  433. return Modernizr;
  434. }
  435. test = typeof test == 'function' ? test() : test;
  436. if (typeof enableClasses !== "undefined" && enableClasses) {
  437. docElement.className += ' ' + (test ? '' : 'no-') + feature;
  438. }
  439. Modernizr[feature] = test;
  440. }
  441. return Modernizr;
  442. };
  443. setCss('');
  444. modElem = inputElem = null;
  445. ;(function(window, document) {
  446. var options = window.html5 || {};
  447. var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
  448. 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;
  449. var supportsHtml5Styles;
  450. var expando = '_html5shiv';
  451. var expanID = 0;
  452. var expandoData = {};
  453. var supportsUnknownElements;
  454. (function() {
  455. try {
  456. var a = document.createElement('a');
  457. a.innerHTML = '<xyz></xyz>';
  458. supportsHtml5Styles = ('hidden' in a);
  459. supportsUnknownElements = a.childNodes.length == 1 || (function() {
  460. (document.createElement)('a');
  461. var frag = document.createDocumentFragment();
  462. return (
  463. typeof frag.cloneNode == 'undefined' ||
  464. typeof frag.createDocumentFragment == 'undefined' ||
  465. typeof frag.createElement == 'undefined'
  466. );
  467. }());
  468. } catch(e) {
  469. supportsHtml5Styles = true;
  470. supportsUnknownElements = true;
  471. }
  472. }()); function addStyleSheet(ownerDocument, cssText) {
  473. var p = ownerDocument.createElement('p'),
  474. parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
  475. p.innerHTML = 'x<style>' + cssText + '</style>';
  476. return parent.insertBefore(p.lastChild, parent.firstChild);
  477. }
  478. function getElements() {
  479. var elements = html5.elements;
  480. return typeof elements == 'string' ? elements.split(' ') : elements;
  481. }
  482. function getExpandoData(ownerDocument) {
  483. var data = expandoData[ownerDocument[expando]];
  484. if (!data) {
  485. data = {};
  486. expanID++;
  487. ownerDocument[expando] = expanID;
  488. expandoData[expanID] = data;
  489. }
  490. return data;
  491. }
  492. function createElement(nodeName, ownerDocument, data){
  493. if (!ownerDocument) {
  494. ownerDocument = document;
  495. }
  496. if(supportsUnknownElements){
  497. return ownerDocument.createElement(nodeName);
  498. }
  499. if (!data) {
  500. data = getExpandoData(ownerDocument);
  501. }
  502. var node;
  503. if (data.cache[nodeName]) {
  504. node = data.cache[nodeName].cloneNode();
  505. } else if (saveClones.test(nodeName)) {
  506. node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
  507. } else {
  508. node = data.createElem(nodeName);
  509. }
  510. return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
  511. }
  512. function createDocumentFragment(ownerDocument, data){
  513. if (!ownerDocument) {
  514. ownerDocument = document;
  515. }
  516. if(supportsUnknownElements){
  517. return ownerDocument.createDocumentFragment();
  518. }
  519. data = data || getExpandoData(ownerDocument);
  520. var clone = data.frag.cloneNode(),
  521. i = 0,
  522. elems = getElements(),
  523. l = elems.length;
  524. for(;i<l;i++){
  525. clone.createElement(elems[i]);
  526. }
  527. return clone;
  528. }
  529. function shivMethods(ownerDocument, data) {
  530. if (!data.cache) {
  531. data.cache = {};
  532. data.createElem = ownerDocument.createElement;
  533. data.createFrag = ownerDocument.createDocumentFragment;
  534. data.frag = data.createFrag();
  535. }
  536. ownerDocument.createElement = function(nodeName) {
  537. if (!html5.shivMethods) {
  538. return data.createElem(nodeName);
  539. }
  540. return createElement(nodeName, ownerDocument, data);
  541. };
  542. ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
  543. 'var n=f.cloneNode(),c=n.createElement;' +
  544. 'h.shivMethods&&(' +
  545. getElements().join().replace(/\w+/g, function(nodeName) {
  546. data.createElem(nodeName);
  547. data.frag.createElement(nodeName);
  548. return 'c("' + nodeName + '")';
  549. }) +
  550. ');return n}'
  551. )(html5, data.frag);
  552. } function shivDocument(ownerDocument) {
  553. if (!ownerDocument) {
  554. ownerDocument = document;
  555. }
  556. var data = getExpandoData(ownerDocument);
  557. if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
  558. data.hasCSS = !!addStyleSheet(ownerDocument,
  559. 'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
  560. 'mark{background:#FF0;color:#000}'
  561. );
  562. }
  563. if (!supportsUnknownElements) {
  564. shivMethods(ownerDocument, data);
  565. }
  566. return ownerDocument;
  567. } var html5 = {
  568. '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',
  569. 'shivCSS': (options.shivCSS !== false),
  570. 'supportsUnknownElements': supportsUnknownElements,
  571. 'shivMethods': (options.shivMethods !== false),
  572. 'type': 'default',
  573. 'shivDocument': shivDocument,
  574. createElement: createElement,
  575. createDocumentFragment: createDocumentFragment
  576. }; window.html5 = html5;
  577. shivDocument(document);
  578. }(this, document));
  579. Modernizr._version = version;
  580. Modernizr._prefixes = prefixes;
  581. Modernizr._domPrefixes = domPrefixes;
  582. Modernizr._cssomPrefixes = cssomPrefixes;
  583. Modernizr.mq = testMediaQuery;
  584. Modernizr.hasEvent = isEventSupported;
  585. Modernizr.testProp = function(prop){
  586. return testProps([prop]);
  587. };
  588. Modernizr.testAllProps = testPropsAll;
  589. Modernizr.testStyles = injectElementWithStyles;
  590. Modernizr.prefixed = function(prop, obj, elem){
  591. if(!obj) {
  592. return testPropsAll(prop, 'pfx');
  593. } else {
  594. return testPropsAll(prop, obj, elem);
  595. }
  596. };
  597. docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
  598. (enableClasses ? ' js ' + classes.join(' ') : '');
  599. return Modernizr;
  600. })(this, this.document);
  601. /*yepnope1.5.4|WTFPL*/
  602. (function (a, b, c) {
  603. function d(a) {
  604. return "[object Function]" == o.call(a)
  605. }
  606. function e(a) {
  607. return "string" == typeof a
  608. }
  609. function f() {}
  610. function g(a) {
  611. return !a || "loaded" == a || "complete" == a || "uninitialized" == a
  612. }
  613. function h() {
  614. var a = p.shift();
  615. q = 1, a ? a.t ? m(function () {
  616. ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1)
  617. }, 0) : (a(), h()) : q = 0
  618. }
  619. function i(a, c, d, e, f, i, j) {
  620. function k(b) {
  621. if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) {
  622. "img" != a && m(function () {
  623. t.removeChild(l)
  624. }, 50);
  625. for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload()
  626. }
  627. }
  628. var j = j || B.errorTimeout,
  629. l = b.createElement(a),
  630. o = 0,
  631. r = 0,
  632. u = {
  633. t: d,
  634. s: c,
  635. e: f,
  636. a: i,
  637. x: j
  638. };
  639. 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 () {
  640. k.call(this, r)
  641. }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l))
  642. }
  643. function j(a, b, c, d, f) {
  644. 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
  645. }
  646. function k() {
  647. var a = B;
  648. return a.loader = {
  649. load: j,
  650. i: 0
  651. }, a
  652. }
  653. var l = b.documentElement,
  654. m = a.setTimeout,
  655. n = b.getElementsByTagName("script")[0],
  656. o = {}.toString,
  657. p = [],
  658. q = 0,
  659. r = "MozAppearance" in l.style,
  660. s = r && !! b.createRange().compareNode,
  661. t = s ? l : n.parentNode,
  662. l = a.opera && "[object Opera]" == o.call(a.opera),
  663. l = !! b.attachEvent && !l,
  664. u = r ? "object" : l ? "script" : "img",
  665. v = l ? "script" : u,
  666. w = Array.isArray || function (a) {
  667. return "[object Array]" == o.call(a)
  668. }, x = [],
  669. y = {}, z = {
  670. timeout: function (a, b) {
  671. return b.length && (a.timeout = b[0]), a
  672. }
  673. }, A, B;
  674. B = function (a) {
  675. function b(a) {
  676. var a = a.split("!"),
  677. b = x.length,
  678. c = a.pop(),
  679. d = a.length,
  680. c = {
  681. url: c,
  682. origUrl: c,
  683. prefixes: a
  684. }, e, f, g;
  685. for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
  686. for (f = 0; f < b; f++) c = x[f](c);
  687. return c
  688. }
  689. function g(a, e, f, g, h) {
  690. var i = b(a),
  691. j = i.autoCallback;
  692. 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 () {
  693. k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2
  694. })))
  695. }
  696. function h(a, b) {
  697. function c(a, c) {
  698. if (a) {
  699. if (e(a)) c || (j = function () {
  700. var a = [].slice.call(arguments);
  701. k.apply(this, a), l()
  702. }), g(a, j, b, 0, h);
  703. else if (Object(a) === a)
  704. for (n in m = function () {
  705. var b = 0,
  706. c;
  707. for (c in a) a.hasOwnProperty(c) && b++;
  708. return b
  709. }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () {
  710. var a = [].slice.call(arguments);
  711. k.apply(this, a), l()
  712. } : j[n] = function (a) {
  713. return function () {
  714. var b = [].slice.call(arguments);
  715. a && a.apply(this, b), l()
  716. }
  717. }(k[n])), g(a[n], j, b, n, h))
  718. } else !c && l()
  719. }
  720. var h = !! a.test,
  721. i = a.load || a.both,
  722. j = a.callback || f,
  723. k = j,
  724. l = a.complete || f,
  725. m, n;
  726. c(h ? a.yep : a.nope, !! i), i && c(i)
  727. }
  728. var i, j, l = this.yepnope.loader;
  729. if (e(a)) g(a, 0, l, 0);
  730. else if (w(a))
  731. 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);
  732. else Object(a) === a && h(a, l)
  733. }, B.addPrefix = function (a, b) {
  734. z[a] = b
  735. }, B.addFilter = function (a) {
  736. x.push(a)
  737. }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded", A = function () {
  738. b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete"
  739. }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function (a, c, d, e, i, j) {
  740. var k = b.createElement("script"),
  741. l, o, e = e || B.errorTimeout;
  742. k.src = a;
  743. for (o in d) k.setAttribute(o, d[o]);
  744. c = j ? h : c || f, k.onreadystatechange = k.onload = function () {
  745. !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null)
  746. }, m(function () {
  747. l || (l = 1, c(1))
  748. }, e), i ? k.onload() : n.parentNode.insertBefore(k, n)
  749. }, a.yepnope.injectCss = function (a, c, d, e, g, i) {
  750. var e = b.createElement("link"),
  751. j, c = i ? h : c || f;
  752. e.href = a, e.rel = "stylesheet", e.type = "text/css";
  753. for (j in d) e.setAttribute(j, d[j]);
  754. g || (n.parentNode.insertBefore(e, n), m(c, 0))
  755. }
  756. })(this, document);
  757. Modernizr.load = function () {
  758. yepnope.apply(window, [].slice.call(arguments, 0));
  759. };