JAVASCRIPT   21

modernizr js

Guest on 6th August 2022 01:08:55 AM

  1. /* Modernizr 2.0.6 (Custom Build) | MIT & BSD
  2.  * Build: http://www.modernizr.com/download/#-csstransforms-csstransforms3d-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes
  3.  */
  4. ;
  5. window.Modernizr = function(a, b, c) {
  6.     function C(a, b) {
  7.         var c = a.charAt(0).toUpperCase() + a.substr(1),
  8.             d = (a + " " + o.join(c + " ") + c).split(" ");
  9.         return B(d, b)
  10.     }
  11.  
  12.     function B(a, b) {
  13.         for (var d in a)
  14.             if (k[a[d]] !== c) return b == "pfx" ? a[d] : !0;
  15.         return !1
  16.     }
  17.  
  18.     function A(a, b) {
  19.         return !!~("" + a).indexOf(b)
  20.     }
  21.  
  22.     function z(a, b) {
  23.         return typeof a === b
  24.     }
  25.  
  26.     function y(a, b) {
  27.         return x(n.join(a + ";") + (b || ""))
  28.     }
  29.  
  30.     function x(a) {
  31.         k.cssText = a
  32.     }
  33.     var d = "2.0.6",
  34.         e = {},
  35.         f = !0,
  36.         g = b.documentElement,
  37.         h = b.head || b.getElementsByTagName("head")[0],
  38.         i = "modernizr",
  39.         j = b.createElement(i),
  40.         k = j.style,
  41.         l, m = Object.prototype.toString,
  42.         n = " -webkit- -moz- -o- -ms- -khtml- ".split(" "),
  43.         o = "Webkit Moz O ms Khtml".split(" "),
  44.         p = {},
  45.         q = {},
  46.         r = {},
  47.         s = [],
  48.         t = function(a, c, d, e) {
  49.             var f, h, j, k = b.createElement("div");
  50.             if (parseInt(d, 10))
  51.                 while (d--) j = b.createElement("div"), j.id = e ? e[d] : i + (d + 1), k.appendChild(j);
  52.             f = ["&shy;", "<style>", a, "</style>"].join(""), k.id = i, k.innerHTML += f, g.appendChild(k), h = c(k, a), k.parentNode.removeChild(k);
  53.             return !!h
  54.         },
  55.         u, v = {}.hasOwnProperty,
  56.         w;
  57.     !z(v, c) && !z(v.call, c) ? w = function(a, b) {
  58.         return v.call(a, b)
  59.     } : w = function(a, b) {
  60.         return b in a && z(a.constructor.prototype[b], c)
  61.     };
  62.     var D = function(a, c) {
  63.         var d = a.join(""),
  64.             f = c.length;
  65.         t(d, function(a, c) {
  66.             var d = b.styleSheets[b.styleSheets.length - 1],
  67.                 g = d.cssRules && d.cssRules[0] ? d.cssRules[0].cssText : d.cssText || "",
  68.                 h = a.childNodes,
  69.                 i = {};
  70.             while (f--) i[h[f].id] = h[f];
  71.             e.csstransforms3d = i.csstransforms3d.offsetLeft === 9
  72.         }, f, c)
  73.     }([, ["@media (", n.join("transform-3d),("), i, ")", "{#csstransforms3d{left:9px;position:absolute}}"].join("")], [, "csstransforms3d"]);
  74.     p.csstransforms = function() {
  75.         return !!B(["transformProperty", "WebkitTransform", "MozTransform", "OTransform", "msTransform"])
  76.     }, p.csstransforms3d = function() {
  77.         var a = !!B(["perspectiveProperty", "WebkitPerspective", "MozPerspective", "OPerspective", "msPerspective"]);
  78.         a && "webkitPerspective" in g.style && (a = e.csstransforms3d);
  79.         return a
  80.     };
  81.     for (var E in p) w(p, E) && (u = E.toLowerCase(), e[u] = p[E](), s.push((e[u] ? "" : "no-") + u));
  82.     x(""), j = l = null, e._version = d, e._prefixes = n, e._domPrefixes = o, e.testProp = function(a) {
  83.         return B([a])
  84.     }, e.testAllProps = C, e.testStyles = t, e.prefixed = function(a) {
  85.         return C(a, "pfx")
  86.     }, g.className = g.className.replace(/\bno-js\b/, "") + (f ? " js " + s.join(" ") : "");
  87.     return e
  88. }(this, this.document);

Raw Paste


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