JAVASCRIPT   22

html5shiv.js

Guest on 19th July 2021 04:49:14 PM

  1. /*
  2.  HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
  3. */
  4. (function(l, f) {
  5.     function m() {
  6.         var a = e.elements;
  7.         return "string" == typeof a ? a.split(" ") : a
  8.     }
  9.  
  10.     function i(a) {
  11.         var b = n[a[o]];
  12.         b || (b = {}, h++, a[o] = h, n[h] = b);
  13.         return b
  14.     }
  15.  
  16.     function p(a, b, c) {
  17.         b || (b = f);
  18.         if (g) return b.createElement(a);
  19.         c || (c = i(b));
  20.         b = c.cache[a] ? c.cache[a].cloneNode() : r.test(a) ? (c.cache[a] = c.createElem(a)).cloneNode() : c.createElem(a);
  21.         return b.canHaveChildren && !s.test(a) ? c.frag.appendChild(b) : b
  22.     }
  23.  
  24.     function t(a, b) {
  25.         if (!b.cache) b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment, b.frag = b.createFrag();
  26.         a.createElement = function(c) {
  27.             return !e.shivMethods ? b.createElem(c) : p(c, a, b)
  28.         };
  29.         a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + m().join().replace(/\w+/g, function(a) {
  30.             b.createElem(a);
  31.             b.frag.createElement(a);
  32.             return 'c("' + a + '")'
  33.         }) + ");return n}")(e, b.frag)
  34.     }
  35.  
  36.     function q(a) {
  37.         a || (a = f);
  38.         var b = i(a);
  39.         if (e.shivCSS && !j && !b.hasCSS) {
  40.             var c, d = a;
  41.             c = d.createElement("p");
  42.             d = d.getElementsByTagName("head")[0] || d.documentElement;
  43.             c.innerHTML = "x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
  44.             c = d.insertBefore(c.lastChild, d.firstChild);
  45.             b.hasCSS = !!c
  46.         }
  47.         g || t(a, b);
  48.         return a
  49.     }
  50.     var k = l.html5 || {},
  51.         s = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
  52.         r = /^(?: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,
  53.         j, o = "_html5shiv",
  54.         h = 0,
  55.         n = {},
  56.         g;
  57.     (function() {
  58.         try {
  59.             var a = f.createElement("a");
  60.             a.innerHTML = "<xyz></xyz>";
  61.             j = "hidden" in a;
  62.             var b;
  63.             if (!(b = 1 == a.childNodes.length)) {
  64.                 f.createElement("a");
  65.                 var c = f.createDocumentFragment();
  66.                 b = "undefined" == typeof c.cloneNode ||
  67.                     "undefined" == typeof c.createDocumentFragment || "undefined" == typeof c.createElement
  68.             }
  69.             g = b
  70.         } catch (d) {
  71.             g = j = !0
  72.         }
  73.     })();
  74.     var e = {
  75.         elements: k.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
  76.         version: "3.6.2pre",
  77.         shivCSS: !1 !== k.shivCSS,
  78.         supportsUnknownElements: g,
  79.         shivMethods: !1 !== k.shivMethods,
  80.         type: "default",
  81.         shivDocument: q,
  82.         createElement: p,
  83.         createDocumentFragment: function(a, b) {
  84.             a || (a = f);
  85.             if (g) return a.createDocumentFragment();
  86.             for (var b = b || i(a), c = b.frag.cloneNode(), d = 0, e = m(), h = e.length; d < h; d++) c.createElement(e[d]);
  87.             return c
  88.         }
  89.     };
  90.     l.html5 = e;
  91.     q(f)
  92. })(this, document);

Raw Paste


Login or Register to edit or fork this paste. It's free.