PageSourceSearch

https://big-step.co.jp/js/ofi.min.js

js big-step.co.jp collected 2026-10-02 17:17:43 UTC 4,311 bytes, 120 lines download raw bytes

vendor: 4,311 bytes, lines 1-120
1/*! npm.im/object-fit-images 3.2.4 */
2var objectFitImages = function () {
3  "use strict";
4
5  function t(t, e) {
6    return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" + t + "' height='" + e + "'%3E%3C/svg%3E"
7  }
8
9  function e(t) {
10    if (t.srcset && !p && window.picturefill) {
11      var e = window.picturefill._;
12      t[e.ns] && t[e.ns].evaled || e.fillImg(t, {
13        reselect: !0
14      }), t[e.ns].curSrc || (t[e.ns].supported = !1, e.fillImg(t, {
15        reselect: !0
16      })), t.currentSrc = t[e.ns].curSrc || t.src
17    }
18  }
19
20  function i(t) {
21    for (var e, i = getComputedStyle(t).fontFamily, r = {}; null !== (e = u.exec(i));) r[e[1]] = e[2];
22    return r
23  }
24
25  function r(e, i, r) {
26    var n = t(i || 1, r || 0);
27    b.call(e, "src") !== n && h.call(e, "src", n)
28  }
29
30  function n(t, e) {
31    t.naturalWidth ? e(t) : setTimeout(n, 100, t, e)
32  }
33
34  function c(t) {
35    var c = i(t),
36      o = t[l];
37    if (c["object-fit"] = c["object-fit"] || "fill", !o.img) {
38      if ("fill" === c["object-fit"]) return;
39      if (!o.skipTest && f && !c["object-position"]) return
40    }
41    if (!o.img) {
42      o.img = new Image(t.width, t.height), o.img.srcset = b.call(t, "data-ofi-srcset") || t.srcset, o.img.src = b.call(t, "data-ofi-src") || t.src, h.call(t, "data-ofi-src", t.src), t.srcset && h.call(t, "data-ofi-srcset", t.srcset), r(t, t.naturalWidth || t.width, t.naturalHeight || t.height), t.srcset && (t.srcset = "");
43      try {
44        s(t)
45      } catch (t) {
46        window.console && console.warn("https://bit.ly/ofi-old-browser")
47      }
48    }
49    e(o.img), t.style.backgroundImage = 'url("' + (o.img.currentSrc || o.img.src).replace(/"/g, '\\"') + '")', t.style.backgroundPosition = c["object-position"] || "center", t.style.backgroundRepeat = "no-repeat", t.style.backgroundOrigin = "content-box", /scale-down/.test(c["object-fit"]) ? n(o.img, function () {
50      o.img.naturalWidth > t.width || o.img.naturalHeight > t.height ? t.style.backgroundSize = "contain" : t.style.backgroundSize = "auto"
51    }) : t.style.backgroundSize = c["object-fit"].replace("none", "auto").replace("fill", "100% 100%"), n(o.img, function (e) {
52      r(t, e.naturalWidth, e.naturalHeight)
53    })
54  }
55
56  function s(t) {
57    var e = {
58      get: function (e) {
59        return t[l].img[e ? e : "src"]
60      },
61      set: function (e, i) {
62        return t[l].img[i ? i : "src"] = e, h.call(t, "data-ofi-" + i, e), c(t), e
63      }
64    };
65    Object.defineProperty(t, "src", e), Object.defineProperty(t, "currentSrc", {
66      get: function () {
67        return e.get("currentSrc")
68      }
69    }), Object.defineProperty(t, "srcset", {
70      get: function () {
71        return e.get("srcset")
72      },
73      set: function (t) {
74        return e.set(t, "srcset")
75      }
76    })
77  }
78
79  function o() {
80    function t(t, e) {
81      return t[l] && t[l].img && ("src" === e || "srcset" === e) ? t[l].img : t
82    }
83    d || (HTMLImageElement.prototype.getAttribute = function (e) {
84      return b.call(t(this, e), e)
85    }, HTMLImageElement.prototype.setAttribute = function (e, i) {
86      return h.call(t(this, e), e, String(i))
87    })
88  }
89
90  function a(t, e) {
91    var i = !y && !t;
92    if (e = e || {}, t = t || "img", d && !e.skipTest || !m) return !1;
93    "img" === t ? t = document.getElementsByTagName("img") : "string" == typeof t ? t = document.querySelectorAll(t) : "length" in t || (t = [t]);
94    for (var r = 0; r < t.length; r++) t[r][l] = t[r][l] || {
95      skipTest: e.skipTest
96    }, c(t[r]);
97    i && (document.body.addEventListener("load", function (t) {
98      "IMG" === t.target.tagName && a(t.target, {
99        skipTest: e.skipTest
100      })
101    }, !0), y = !0, t = "img"), e.watchMQ && window.addEventListener("resize", a.bind(null, t, {
102      skipTest: e.skipTest
103    }))
104  }
105  var l = "bfred-it:object-fit-images",
106    u = /(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g,
107    g = "undefined" == typeof Image ? {
108      style: {
109        "object-position": 1
110      }
111    } : new Image,
112    f = "object-fit" in g.style,
113    d = "object-position" in g.style,
114    m = "background-size" in g.style,
115    p = "string" == typeof g.currentSrc,
116    b = g.getAttribute,
117    h = g.setAttribute,
118    y = !1;
119  return a.supportsObjectFit = f, a.supportsObjectPosition = d, o(), a
120}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.