]> git.mxchange.org Git - friendica.git/blob - view/theme/smoothly/js/modernizr.custom.2.5.3.js
Merge pull request #6644 from tobiasd/20190212-librejs
[friendica.git] / view / theme / smoothly / js / modernizr.custom.2.5.3.js
1 // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
2 // @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt
3 /* Modernizr 2.5.3 (Custom Build) | MIT & BSD
4  * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexbox_legacy-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-printshiv-mq-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
5  */
6 ;
7
8
9
10 window.Modernizr = (function( window, document, undefined ) {
11
12     var version = '2.5.3',
13
14     Modernizr = {},
15
16
17     docElement = document.documentElement,
18
19     mod = 'modernizr',
20     modElem = document.createElement(mod),
21     mStyle = modElem.style,
22
23     inputElem  = document.createElement('input')  ,
24
25     smile = ':)',
26
27     toString = {}.toString,
28
29     prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
30
31
32
33     omPrefixes = 'Webkit Moz O ms',
34
35     cssomPrefixes = omPrefixes.split(' '),
36
37     domPrefixes = omPrefixes.toLowerCase().split(' '),
38
39     ns = {'svg': 'http://www.w3.org/2000/svg'},
40
41     tests = {},
42     inputs = {},
43     attrs = {},
44
45     classes = [],
46
47     slice = classes.slice,
48
49     featureName, 
50
51
52     injectElementWithStyles = function( rule, callback, nodes, testnames ) {
53
54       var style, ret, node,
55           div = document.createElement('div'),
56                 body = document.body, 
57                 fakeBody = body ? body : document.createElement('body');
58
59       if ( parseInt(nodes, 10) ) {
60                       while ( nodes-- ) {
61               node = document.createElement('div');
62               node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
63               div.appendChild(node);
64           }
65       }
66
67                 style = ['&#173;','<style>', rule, '</style>'].join('');
68       div.id = mod;
69           (body ? div : fakeBody).innerHTML += style;
70       fakeBody.appendChild(div);
71       if(!body){
72                 fakeBody.style.background = "";
73           docElement.appendChild(fakeBody);
74       }
75
76       ret = callback(div, rule);
77         !body ? fakeBody.parentNode.removeChild(fakeBody) : div.parentNode.removeChild(div);
78
79       return !!ret;
80
81     },
82
83     testMediaQuery = function( mq ) {
84
85       var matchMedia = window.matchMedia || window.msMatchMedia;
86       if ( matchMedia ) {
87         return matchMedia(mq).matches;
88       }
89
90       var bool;
91
92       injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
93         bool = (window.getComputedStyle ?
94                   getComputedStyle(node, null) :
95                   node.currentStyle)['position'] == 'absolute';
96       });
97
98       return bool;
99
100      },
101  
102
103     isEventSupported = (function() {
104
105       var TAGNAMES = {
106         'select': 'input', 'change': 'input',
107         'submit': 'form', 'reset': 'form',
108         'error': 'img', 'load': 'img', 'abort': 'img'
109       };
110
111       function isEventSupported( eventName, element ) {
112
113         element = element || document.createElement(TAGNAMES[eventName] || 'div');
114         eventName = 'on' + eventName;
115
116             var isSupported = eventName in element;
117
118         if ( !isSupported ) {
119                 if ( !element.setAttribute ) {
120             element = document.createElement('div');
121           }
122           if ( element.setAttribute && element.removeAttribute ) {
123             element.setAttribute(eventName, '');
124             isSupported = is(element[eventName], 'function');
125
126                     if ( !is(element[eventName], 'undefined') ) {
127               element[eventName] = undefined;
128             }
129             element.removeAttribute(eventName);
130           }
131         }
132
133         element = null;
134         return isSupported;
135       }
136       return isEventSupported;
137     })(),
138
139
140     _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty;
141
142     if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
143       hasOwnProperty = function (object, property) {
144         return _hasOwnProperty.call(object, property);
145       };
146     }
147     else {
148       hasOwnProperty = function (object, property) { 
149         return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
150       };
151     }
152
153
154     if (!Function.prototype.bind) {
155       Function.prototype.bind = function bind(that) {
156
157         var target = this;
158
159         if (typeof target != "function") {
160             throw new TypeError();
161         }
162
163         var args = slice.call(arguments, 1),
164             bound = function () {
165
166             if (this instanceof bound) {
167
168               var F = function(){};
169               F.prototype = target.prototype;
170               var self = new F;
171
172               var result = target.apply(
173                   self,
174                   args.concat(slice.call(arguments))
175               );
176               if (Object(result) === result) {
177                   return result;
178               }
179               return self;
180
181             } else {
182
183               return target.apply(
184                   that,
185                   args.concat(slice.call(arguments))
186               );
187
188             }
189
190         };
191
192         return bound;
193       };
194     }
195
196     function setCss( str ) {
197         mStyle.cssText = str;
198     }
199
200     function setCssAll( str1, str2 ) {
201         return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
202     }
203
204     function is( obj, type ) {
205         return typeof obj === type;
206     }
207
208     function contains( str, substr ) {
209         return !!~('' + str).indexOf(substr);
210     }
211
212     function testProps( props, prefixed ) {
213         for ( var i in props ) {
214             if ( mStyle[ props[i] ] !== undefined ) {
215                 return prefixed == 'pfx' ? props[i] : true;
216             }
217         }
218         return false;
219     }
220
221     function testDOMProps( props, obj, elem ) {
222         for ( var i in props ) {
223             var item = obj[props[i]];
224             if ( item !== undefined) {
225
226                             if (elem === false) return props[i];
227
228                             if (is(item, 'function')){
229                                 return item.bind(elem || obj);
230                 }
231
232                             return item;
233             }
234         }
235         return false;
236     }
237
238     function testPropsAll( prop, prefixed, elem ) {
239
240         var ucProp  = prop.charAt(0).toUpperCase() + prop.substr(1),
241             props   = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
242
243             if(is(prefixed, "string") || is(prefixed, "undefined")) {
244           return testProps(props, prefixed);
245
246             } else {
247           props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
248           return testDOMProps(props, prefixed, elem);
249         }
250     }
251
252     var testBundle = (function( styles, tests ) {
253         var style = styles.join(''),
254             len = tests.length;
255
256         injectElementWithStyles(style, function( node, rule ) {
257             var style = document.styleSheets[document.styleSheets.length - 1],
258                                                     cssText = style ? (style.cssRules && style.cssRules[0] ? style.cssRules[0].cssText : style.cssText || '') : '',
259                 children = node.childNodes, hash = {};
260
261             while ( len-- ) {
262                 hash[children[len].id] = children[len];
263             }
264
265                        Modernizr['touch'] = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch || (hash['touch'] && hash['touch'].offsetTop) === 9; 
266              Modernizr['csstransforms3d'] = (hash['csstransforms3d'] && hash['csstransforms3d'].offsetLeft) === 9 && hash['csstransforms3d'].offsetHeight === 3;                  Modernizr['generatedcontent'] = (hash['generatedcontent'] && hash['generatedcontent'].offsetHeight) >= 1;                       Modernizr['fontface'] = /src/i.test(cssText) &&
267                                                                   cssText.indexOf(rule.split(' ')[0]) === 0;            }, len, tests);
268
269     })([
270                     '@font-face {font-family:"font";src:url("https://")}'                    ,['@media (',prefixes.join('touch-enabled),('),mod,')',
271                                 '{#touch{top:9px;position:absolute}}'].join('')            ,['@media (',prefixes.join('transform-3d),('),mod,')',
272                                 '{#csstransforms3d{left:9px;position:absolute;height:3px;}}'].join('')
273
274         ,['#generatedcontent:after{content:"',smile,'";visibility:hidden}'].join('')  
275     ],
276       [
277                 'fontface'                         ,'touch'                 ,'csstransforms3d'  
278         ,'generatedcontent' 
279
280     ]);    tests['flexbox'] = function() {
281       return testPropsAll('flexOrder');
282     };
283
284
285     tests['flexbox-legacy'] = function() {
286         return testPropsAll('boxDirection');
287     };
288
289
290     tests['canvas'] = function() {
291         var elem = document.createElement('canvas');
292         return !!(elem.getContext && elem.getContext('2d'));
293     };
294
295     tests['canvastext'] = function() {
296         return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
297     };    tests['touch'] = function() {
298         return Modernizr['touch'];
299     };
300
301     tests['geolocation'] = function() {
302         return !!navigator.geolocation;
303     };
304
305     tests['postmessage'] = function() {
306       return !!window.postMessage;
307     };
308
309
310     tests['websqldatabase'] = function() {
311       return !!window.openDatabase;
312     };
313
314     tests['indexedDB'] = function() {
315       return !!testPropsAll("indexedDB",window);
316     };
317
318     tests['hashchange'] = function() {
319       return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
320     };
321
322     tests['history'] = function() {
323       return !!(window.history && history.pushState);
324     };
325
326     tests['draganddrop'] = function() {
327         var div = document.createElement('div');
328         return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
329     };
330
331     tests['websockets'] = function() {
332         for ( var i = -1, len = cssomPrefixes.length; ++i < len; ){
333           if ( window[cssomPrefixes[i] + 'WebSocket'] ){
334             return true;
335           }
336         }
337         return 'WebSocket' in window;
338     };
339
340
341     tests['rgba'] = function() {
342         setCss('background-color:rgba(150,255,150,.5)');
343
344         return contains(mStyle.backgroundColor, 'rgba');
345     };
346
347     tests['hsla'] = function() {
348             setCss('background-color:hsla(120,40%,100%,.5)');
349
350         return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
351     };
352
353     tests['multiplebgs'] = function() {
354                 setCss('background:url(https://),url(https://),red url(https://)');
355
356             return /(url\s*\(.*?){3}/.test(mStyle.background);
357     };
358     tests['backgroundsize'] = function() {
359         return testPropsAll('backgroundSize');
360     };
361
362     tests['borderimage'] = function() {
363         return testPropsAll('borderImage');
364     };
365
366
367
368     tests['borderradius'] = function() {
369         return testPropsAll('borderRadius');
370     };
371
372     tests['boxshadow'] = function() {
373         return testPropsAll('boxShadow');
374     };
375
376     tests['textshadow'] = function() {
377         return document.createElement('div').style.textShadow === '';
378     };
379
380
381     tests['opacity'] = function() {
382                 setCssAll('opacity:.55');
383
384                     return /^0.55$/.test(mStyle.opacity);
385     };
386
387
388     tests['cssanimations'] = function() {
389         return testPropsAll('animationName');
390     };
391
392
393     tests['csscolumns'] = function() {
394         return testPropsAll('columnCount');
395     };
396
397
398     tests['cssgradients'] = function() {
399         var str1 = 'background-image:',
400             str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
401             str3 = 'linear-gradient(left top,#9f9, white);';
402
403         setCss(
404                        (str1 + '-webkit- '.split(' ').join(str2 + str1) 
405                        + prefixes.join(str3 + str1)).slice(0, -str1.length)
406         );
407
408         return contains(mStyle.backgroundImage, 'gradient');
409     };
410
411
412     tests['cssreflections'] = function() {
413         return testPropsAll('boxReflect');
414     };
415
416
417     tests['csstransforms'] = function() {
418         return !!testPropsAll('transform');
419     };
420
421
422     tests['csstransforms3d'] = function() {
423
424         var ret = !!testPropsAll('perspective');
425
426                         if ( ret && 'webkitPerspective' in docElement.style ) {
427
428                       ret = Modernizr['csstransforms3d'];
429         }
430         return ret;
431     };
432
433
434     tests['csstransitions'] = function() {
435         return testPropsAll('transition');
436     };
437
438
439
440     tests['fontface'] = function() {
441         return Modernizr['fontface'];
442     };
443
444     tests['generatedcontent'] = function() {
445         return Modernizr['generatedcontent'];
446     };
447     tests['video'] = function() {
448         var elem = document.createElement('video'),
449             bool = false;
450
451             try {
452             if ( bool = !!elem.canPlayType ) {
453                 bool      = new Boolean(bool);
454                 bool.ogg  = elem.canPlayType('video/ogg; codecs="theora"')      .replace(/^no$/,'');
455
456                 bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
457
458                 bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
459             }
460
461         } catch(e) { }
462
463         return bool;
464     };
465
466     tests['audio'] = function() {
467         var elem = document.createElement('audio'),
468             bool = false;
469
470         try { 
471             if ( bool = !!elem.canPlayType ) {
472                 bool      = new Boolean(bool);
473                 bool.ogg  = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
474                 bool.mp3  = elem.canPlayType('audio/mpeg;')               .replace(/^no$/,'');
475
476                                                     bool.wav  = elem.canPlayType('audio/wav; codecs="1"')     .replace(/^no$/,'');
477                 bool.m4a  = ( elem.canPlayType('audio/x-m4a;')            || 
478                               elem.canPlayType('audio/aac;'))             .replace(/^no$/,'');
479             }
480         } catch(e) { }
481
482         return bool;
483     };
484
485
486     tests['localstorage'] = function() {
487         try {
488             localStorage.setItem(mod, mod);
489             localStorage.removeItem(mod);
490             return true;
491         } catch(e) {
492             return false;
493         }
494     };
495
496     tests['sessionstorage'] = function() {
497         try {
498             sessionStorage.setItem(mod, mod);
499             sessionStorage.removeItem(mod);
500             return true;
501         } catch(e) {
502             return false;
503         }
504     };
505
506
507     tests['webworkers'] = function() {
508         return !!window.Worker;
509     };
510
511
512     tests['applicationcache'] = function() {
513         return !!window.applicationCache;
514     };
515
516
517     tests['svg'] = function() {
518         return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
519     };
520
521     tests['inlinesvg'] = function() {
522       var div = document.createElement('div');
523       div.innerHTML = '<svg/>';
524       return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
525     };
526
527     tests['smil'] = function() {
528         return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
529     };
530
531
532     tests['svgclippaths'] = function() {
533         return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
534     };
535
536     function webforms() {
537                                             Modernizr['input'] = (function( props ) {
538             for ( var i = 0, len = props.length; i < len; i++ ) {
539                 attrs[ props[i] ] = !!(props[i] in inputElem);
540             }
541             if (attrs.list){
542                                   attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
543             }
544             return attrs;
545         })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
546                             Modernizr['inputtypes'] = (function(props) {
547
548             for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
549
550                 inputElem.setAttribute('type', inputElemType = props[i]);
551                 bool = inputElem.type !== 'text';
552
553                                                     if ( bool ) {
554
555                     inputElem.value         = smile;
556                     inputElem.style.cssText = 'position:absolute;visibility:hidden;';
557
558                     if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
559
560                       docElement.appendChild(inputElem);
561                       defaultView = document.defaultView;
562
563                                         bool =  defaultView.getComputedStyle &&
564                               defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
565                                                                                   (inputElem.offsetHeight !== 0);
566
567                       docElement.removeChild(inputElem);
568
569                     } else if ( /^(search|tel)$/.test(inputElemType) ){
570                                                                                     } else if ( /^(url|email)$/.test(inputElemType) ) {
571                                         bool = inputElem.checkValidity && inputElem.checkValidity() === false;
572
573                     } else if ( /^color$/.test(inputElemType) ) {
574                                                                 docElement.appendChild(inputElem);
575                         docElement.offsetWidth;
576                         bool = inputElem.value != smile;
577                         docElement.removeChild(inputElem);
578
579                     } else {
580                                         bool = inputElem.value != smile;
581                     }
582                 }
583
584                 inputs[ props[i] ] = !!bool;
585             }
586             return inputs;
587         })('search tel url email datetime date month week time datetime-local number range color'.split(' '));
588         }
589     for ( var feature in tests ) {
590         if ( hasOwnProperty(tests, feature) ) {
591                                     featureName  = feature.toLowerCase();
592             Modernizr[featureName] = tests[feature]();
593
594             classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
595         }
596     }
597
598     Modernizr.input || webforms();    setCss('');
599     modElem = inputElem = null;
600
601
602     Modernizr._version      = version;
603
604     Modernizr._prefixes     = prefixes;
605     Modernizr._domPrefixes  = domPrefixes;
606     Modernizr._cssomPrefixes  = cssomPrefixes;
607
608     Modernizr.mq            = testMediaQuery;
609
610     Modernizr.hasEvent      = isEventSupported;
611
612     Modernizr.testProp      = function(prop){
613         return testProps([prop]);
614     };
615
616     Modernizr.testAllProps  = testPropsAll;
617
618
619     Modernizr.testStyles    = injectElementWithStyles;
620     return Modernizr;
621
622 })(this, this.document);
623 /*! HTML5 Shiv v3.4 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */
624 ;(function(window, document) {
625
626   /** Preset options */
627   var options = window.html5 || {};
628
629   /** Used to skip problem elements */
630   var reSkip = /^<|^(?:button|form|map|select|textarea)$/i;
631
632   /** Detect whether the browser supports default html5 styles */
633   var supportsHtml5Styles;
634
635   /** Detect whether the browser supports unknown elements */
636   var supportsUnknownElements;
637
638   (function() {
639     var a = document.createElement('a');
640
641     a.innerHTML = '<xyz></xyz>';
642
643     //if the hidden property is implemented we can assume, that the browser supports HTML5 Styles
644     supportsHtml5Styles = ('hidden' in a);
645     supportsUnknownElements = a.childNodes.length == 1 || (function() {
646       // assign a false positive if unable to shiv
647       try {
648         (document.createElement)('a');
649       } catch(e) {
650         return true;
651       }
652       var frag = document.createDocumentFragment();
653       return (
654         typeof frag.cloneNode == 'undefined' ||
655         typeof frag.createDocumentFragment == 'undefined' ||
656         typeof frag.createElement == 'undefined'
657       );
658     }());
659
660   }());
661
662   /*--------------------------------------------------------------------------*/
663
664   /**
665    * Creates a style sheet with the given CSS text and adds it to the document.
666    * @private
667    * @param {Document} ownerDocument The document.
668    * @param {String} cssText The CSS text.
669    * @returns {StyleSheet} The style element.
670    */
671   function addStyleSheet(ownerDocument, cssText) {
672     var p = ownerDocument.createElement('p'),
673         parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
674
675     p.innerHTML = 'x<style>' + cssText + '</style>';
676     return parent.insertBefore(p.lastChild, parent.firstChild);
677   }
678
679   /**
680    * Returns the value of `html5.elements` as an array.
681    * @private
682    * @returns {Array} An array of shived element node names.
683    */
684   function getElements() {
685     var elements = html5.elements;
686     return typeof elements == 'string' ? elements.split(' ') : elements;
687   }
688
689   /**
690    * Shivs the `createElement` and `createDocumentFragment` methods of the document.
691    * @private
692    * @param {Document|DocumentFragment} ownerDocument The document.
693    */
694   function shivMethods(ownerDocument) {
695     var cache = {},
696         docCreateElement = ownerDocument.createElement,
697         docCreateFragment = ownerDocument.createDocumentFragment,
698         frag = docCreateFragment();
699
700     ownerDocument.createElement = function(nodeName) {
701       // Avoid adding some elements to fragments in IE < 9 because
702       // * Attributes like `name` or `type` cannot be set/changed once an element
703       //   is inserted into a document/fragment
704       // * Link elements with `src` attributes that are inaccessible, as with
705       //   a 403 response, will cause the tab/window to crash
706       // * Script elements appended to fragments will execute when their `src`
707       //   or `text` property is set
708       var node = (cache[nodeName] || (cache[nodeName] = docCreateElement(nodeName))).cloneNode();
709       return html5.shivMethods && node.canHaveChildren && !reSkip.test(nodeName) ? frag.appendChild(node) : node;
710     };
711
712     ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
713       'var n=f.cloneNode(),c=n.createElement;' +
714       'h.shivMethods&&(' +
715         // unroll the `createElement` calls
716         getElements().join().replace(/\w+/g, function(nodeName) {
717           cache[nodeName] = docCreateElement(nodeName);
718           frag.createElement(nodeName);
719           return 'c("' + nodeName + '")';
720         }) +
721       ');return n}'
722     )(html5, frag);
723   }
724
725   /*--------------------------------------------------------------------------*/
726
727   /**
728    * Shivs the given document.
729    * @memberOf html5
730    * @param {Document} ownerDocument The document to shiv.
731    * @returns {Document} The shived document.
732    */
733   function shivDocument(ownerDocument) {
734     var shived;
735     if (ownerDocument.documentShived) {
736       return ownerDocument;
737     }
738     if (html5.shivCSS && !supportsHtml5Styles) {
739       shived = !!addStyleSheet(ownerDocument,
740         // corrects block display not defined in IE6/7/8/9
741         'article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
742         // corrects audio display not defined in IE6/7/8/9
743         'audio{display:none}' +
744         // corrects canvas and video display not defined in IE6/7/8/9
745         'canvas,video{display:inline-block;*display:inline;*zoom:1}' +
746         // corrects 'hidden' attribute and audio[controls] display not present in IE7/8/9
747         '[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}' +
748         // adds styling not present in IE6/7/8/9
749         'mark{background:#FF0;color:#000}'
750       );
751     }
752     if (!supportsUnknownElements) {
753       shived = !shivMethods(ownerDocument);
754     }
755     if (shived) {
756       ownerDocument.documentShived = shived;
757     }
758     return ownerDocument;
759   }
760
761   /*--------------------------------------------------------------------------*/
762
763   /**
764    * The `html5` object is exposed so that more elements can be shived and
765    * existing shiving can be detected on iframes.
766    * @type Object
767    * @example
768    *
769    * // options can be changed before the script is included
770    * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
771    */
772   var html5 = {
773
774     /**
775      * An array or space separated string of node names of the elements to shiv.
776      * @memberOf html5
777      * @type Array|String
778      */
779     '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',
780
781     /**
782      * A flag to indicate that the HTML5 style sheet should be inserted.
783      * @memberOf html5
784      * @type Boolean
785      */
786     'shivCSS': !(options.shivCSS === false),
787
788     /**
789      * A flag to indicate that the document's `createElement` and `createDocumentFragment`
790      * methods should be overwritten.
791      * @memberOf html5
792      * @type Boolean
793      */
794     'shivMethods': !(options.shivMethods === false),
795
796     /**
797      * A string to describe the type of `html5` object ("default" or "default print").
798      * @memberOf html5
799      * @type String
800      */
801     'type': 'default',
802
803     // shivs the document according to the specified `html5` object options
804     'shivDocument': shivDocument
805   };
806
807   /*--------------------------------------------------------------------------*/
808
809   // expose html5
810   window.html5 = html5;
811
812   // shiv the document
813   shivDocument(document);
814
815   /*------------------------------- Print Shiv -------------------------------*/
816
817   /** Used to filter media types */
818   var reMedia = /^$|\b(?:all|print)\b/;
819
820   /** Used to namespace printable elements */
821   var shivNamespace = 'html5shiv';
822
823   /** Detect whether the browser supports shivable style sheets */
824   var supportsShivableSheets = !supportsUnknownElements && (function() {
825     // assign a false negative if unable to shiv
826     var docEl = document.documentElement;
827     return !(
828       typeof document.namespaces == 'undefined' ||
829       typeof document.parentWindow == 'undefined' ||
830       typeof docEl.applyElement == 'undefined' ||
831       typeof docEl.removeNode == 'undefined' ||
832       typeof window.attachEvent == 'undefined'
833     );
834   }());
835
836   /*--------------------------------------------------------------------------*/
837
838   /**
839    * Wraps all HTML5 elements in the given document with printable elements.
840    * (eg. the "header" element is wrapped with the "html5shiv:header" element)
841    * @private
842    * @param {Document} ownerDocument The document.
843    * @returns {Array} An array wrappers added.
844    */
845   function addWrappers(ownerDocument) {
846     var node,
847         nodes = ownerDocument.getElementsByTagName('*'),
848         index = nodes.length,
849         reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'),
850         result = [];
851
852     while (index--) {
853       node = nodes[index];
854       if (reElements.test(node.nodeName)) {
855         result.push(node.applyElement(createWrapper(node)));
856       }
857     }
858     return result;
859   }
860
861   /**
862    * Creates a printable wrapper for the given element.
863    * @private
864    * @param {Element} element The element.
865    * @returns {Element} The wrapper.
866    */
867   function createWrapper(element) {
868     var node,
869         nodes = element.attributes,
870         index = nodes.length,
871         wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName);
872
873     // copy element attributes to the wrapper
874     while (index--) {
875       node = nodes[index];
876       node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue);
877     }
878     // copy element styles to the wrapper
879     wrapper.style.cssText = element.style.cssText;
880     return wrapper;
881   }
882
883   /**
884    * Shivs the given CSS text.
885    * (eg. header{} becomes html5shiv\:header{})
886    * @private
887    * @param {String} cssText The CSS text to shiv.
888    * @returns {String} The shived CSS text.
889    */
890   function shivCssText(cssText) {
891     var pair,
892         parts = cssText.split('{'),
893         index = parts.length,
894         reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'),
895         replacement = '$1' + shivNamespace + '\\:$2';
896
897     while (index--) {
898       pair = parts[index] = parts[index].split('}');
899       pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement);
900       parts[index] = pair.join('}');
901     }
902     return parts.join('{');
903   }
904
905   /**
906    * Removes the given wrappers, leaving the original elements.
907    * @private
908    * @params {Array} wrappers An array of printable wrappers.
909    */
910   function removeWrappers(wrappers) {
911     var index = wrappers.length;
912     while (index--) {
913       wrappers[index].removeNode();
914     }
915   }
916
917   /*--------------------------------------------------------------------------*/
918
919   /**
920    * Shivs the given document for print.
921    * @memberOf html5
922    * @param {Document} ownerDocument The document to shiv.
923    * @returns {Document} The shived document.
924    */
925   function shivPrint(ownerDocument) {
926     var shivedSheet,
927         wrappers,
928         namespaces = ownerDocument.namespaces,
929         ownerWindow = ownerDocument.parentWindow;
930
931     if (!supportsShivableSheets || ownerDocument.printShived) {
932       return ownerDocument;
933     }
934     if (typeof namespaces[shivNamespace] == 'undefined') {
935       namespaces.add(shivNamespace);
936     }
937
938     ownerWindow.attachEvent('onbeforeprint', function() {
939       var imports,
940           length,
941           sheet,
942           collection = ownerDocument.styleSheets,
943           cssText = [],
944           index = collection.length,
945           sheets = Array(index);
946
947       // convert styleSheets collection to an array
948       while (index--) {
949         sheets[index] = collection[index];
950       }
951       // concat all style sheet CSS text
952       while ((sheet = sheets.pop())) {
953         // IE does not enforce a same origin policy for external style sheets
954         if (!sheet.disabled && reMedia.test(sheet.media)) {
955           for (imports = sheet.imports, index = 0, length = imports.length; index < length; index++) {
956             sheets.push(imports[index]);
957           }
958           try {
959             cssText.push(sheet.cssText);
960           } catch(er){}
961         }
962       }
963       // wrap all HTML5 elements with printable elements and add the shived style sheet
964       cssText = shivCssText(cssText.reverse().join(''));
965       wrappers = addWrappers(ownerDocument);
966       shivedSheet = addStyleSheet(ownerDocument, cssText);
967     });
968
969     ownerWindow.attachEvent('onafterprint', function() {
970       // remove wrappers, leaving the original elements, and remove the shived style sheet
971       removeWrappers(wrappers);
972       shivedSheet.removeNode(true);
973     });
974
975     ownerDocument.printShived = true;
976     return ownerDocument;
977   }
978
979   /*--------------------------------------------------------------------------*/
980
981   // expose API
982   html5.type += ' print';
983   html5.shivPrint = shivPrint;
984
985   // shiv for print
986   shivPrint(document);
987
988 }(this, document));/*yepnope1.5.3|WTFPL*/
989 (function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?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)){a!="img"&&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={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?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),a!="img"&&(r||y[c]===2?(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(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&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&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},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,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,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),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(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 j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&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);
990 Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0));};
991 ;
992
993 // @license-end