PageSourceSearch

https://msukonp.ru/js/lazyload-1.3.min.export.js

js msukonp.ru collected 2026-10-07 22:46:07 UTC 10,656 bytes, 177 lines download raw bytes

1function t_lazyload_update() {
2    "undefined" != typeof lazyload_cover && lazyload_cover.update(), "undefined" != typeof lazyload_img && lazyload_img.update(), "undefined" != typeof lazyload_bgimg && lazyload_bgimg.update(), "undefined" != typeof lazyload_iframe && lazyload_iframe.update()
3}
4
5function t_lazyload_updateResize_elem(e) {
6    if (window.jQuery && e instanceof jQuery) {
7        if (0 == e.length) return;
8        e = e.get(0)
9    }
10    var t, o, n, i, l, a, s;
11    null != e && (s = "IMG" == (t = e.tagName) ? (o = e.getAttribute("src"), "-/resize/") : "undefined" != typeof getComputedStyle ? (o = getComputedStyle(e)["background-image"].replace("url(", "").replace(")", "").replace(/"/gi, ""), "contain" == getComputedStyle(e)["background-size"] ? "-/contain/" : "-/cover/") : "-/cover/", null == o || -1 === o.indexOf(s) || 0 < o.indexOf(".svg") || 0 < o.indexOf(".gif") || 0 < o.indexOf(".ico") || -1 === o.indexOf("thumb.tildacdn.com") || 0 < o.indexOf("-/empty/") && 0 < o.indexOf("-/resizeb/") || (s = o.indexOf(s) + s.length, n = o.indexOf("/", s), 0 < s && 0 < n && (i = o.slice(s, n).split("x"), l = e.clientWidth, a = e.clientHeight, 0 < l && 0 < a && (0 < i[0] || 0 < i[1]) && (0 < i[0] && l > i[0] || 0 < i[1] && a > i[1]) && (0 < i[0] && 100 < l - i[0] || 0 < i[1] && 100 < a - i[1]) && (s = o.slice(0, s) + (0 < i[0] ? l : "") + "x" + (0 < i[1] ? a : "") + o.substring(n), "IMG" == t ? e.setAttribute("src", s) : e.style.backgroundImage = "url('" + s + "')"))))
12}
13
14!function (e, t) {
15    "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? module.exports = t() : e.LazyLoad = t()
16}(this, function () {
17    function i(e, t, o) {
18        var n;
19        h ? e.addEventListener(t, o) : _ && e.attachEvent("on" + t, (n = e, function () {
20            o.call(n, window.event)
21        }))
22    }
23
24    function l(e, t, o) {
25        h ? e.removeEventListener(t, o) : _ && e.detachEvent("on" + t, o)
26    }
27
28    function a(e, t, o) {
29        var n, i, l;
30
31        function a() {
32            return window.innerWidth || n.documentElement.clientWidth || document.body.clientWidth
33        }
34
35        function s(e) {
36            return e.getBoundingClientRect().top + i - n.documentElement.clientTop
37        }
38
39        function r(e) {
40            return e.getBoundingClientRect().left + l - n.documentElement.clientLeft
41        }
42
43        return n = e.ownerDocument, i = window.pageYOffset || n.body.scrollTop, l = window.pageXOffset || n.body.scrollLeft, "fixed" === e.getAttribute("data-content-cover-parallax") && e.closest && e.closest(".t-cover__container") && (e = e.closest(".t-cover__container")), !((t === window ? (window.innerHeight || n.documentElement.clientHeight || document.body.clientHeight) + i : s(t) + t.offsetHeight) <= s(e) - o || (t === window ? i : s(t)) >= s(e) + 1200 + e.offsetHeight || (t === window ? a() + window.pageXOffset : r(t) + a()) <= r(e) - o || (t === window ? l : r(t)) >= r(e) + o + e.offsetWidth)
44    }
45
46    function n() {
47        return (new Date).getTime()
48    }
49
50    function s(e, t) {
51        for (var o = []; (e = e.parentNode) && e !== document;) t && !e.matches(t) || o.unshift(e);
52        return o
53    }
54
55    function r(e, t) {
56        o ? e.classList.add(t) : e.className += (e.className ? " " : "") + t
57    }
58
59    function c(e, t) {
60        o ? e.classList.remove(t) : e.className = e.className.replace(new RegExp("(^|\\s+)" + t + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "")
61    }
62
63    function d(e, t, o, n) {
64        n = t.getAttribute("data-" + n), t = t.getAttribute("data-" + o), o = e.tagName;
65        "IMG" === o ? (t && e.setAttribute("srcset", t), n && e.setAttribute("src", n)) : "IFRAME" === o ? n && e.setAttribute("src", n) : e.style.backgroundImage = "url(" + n + ")"
66    }
67
68    function u(e, t) {
69        return function () {
70            return e.apply(t, arguments)
71        }
72    }
73
74    function e(e) {
75        p || (t = {
76            elements_selector: "img",
77            container: window,
78            threshold: 300,
79            throttle: 50,
80            data_src: "original",
81            data_srcset: "original-set",
82            class_loading: "loading",
83            class_loaded: "loaded",
84            skip_invisible: !0,
85            show_while_loading: !0,
86            callback_load: null,
87            callback_error: null,
88            callback_set: null,
89            callback_processed: null,
90            placeholder: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
91        }, h = !!window.addEventListener, _ = !!window.attachEvent, o = !!document.body.classList, p = !0), this._settings = function (e, t) {
92            var o, n = {};
93            for (o in e) e.hasOwnProperty(o) && (n[o] = e[o]);
94            for (o in t) t.hasOwnProperty(o) && (n[o] = t[o]);
95            return n
96        }(t, e), this._queryOriginNode = this._settings.container === window ? document : this._settings.container, this._previousLoopTime = 0, this._loopTimeout = null, this._handleScrollFn = u(this.handleScroll, this), i(window, "resize", this._handleScrollFn), this.update()
97    }
98
99    var t, h, _, o, p = !1;
100    return e.prototype._showOnLoad = function (t) {
101        var o, n = this._settings;
102        t.getAttribute("src") || t.setAttribute("src", n.placeholder), i(o = document.createElement("img"), "load", function e() {
103            null !== n && (n.callback_load && n.callback_load(t), d(t, t, n.data_srcset, n.data_src), n.callback_set && n.callback_set(t), c(t, n.class_loading), r(t, n.class_loaded), l(o, "load", e))
104        }), i(o, "error", function () {
105            c(t, n.class_loading), n.callback_error && n.callback_error(t)
106        }), r(t, n.class_loading), d(o, t, n.data_srcset, n.data_src)
107    }, e.prototype._showOnAppear = function (e) {
108        function t() {
109            null !== o && (o.callback_load && o.callback_load(e), c(e, o.class_loading), r(e, o.class_loaded), l(e, "load", t))
110        }
111
112        var o = this._settings;
113        "IMG" !== e.tagName && "IFRAME" !== e.tagName || (i(e, "load", t), i(e, "error", function () {
114            l(e, "load", t), c(e, o.class_loading), o.callback_error && o.callback_error(e)
115        }), r(e, o.class_loading)), d(e, e, o.data_srcset, o.data_src), o.callback_set && o.callback_set(e)
116    }, e.prototype._loopThroughElements = function () {
117        for (var e, t = this._settings, o = this._elements, n = o ? o.length : 0, i = [], l = 0; l < n; l++) e = o[l], t.skip_invisible && e.isSkipByPosition || a(e, t.container, t.threshold) && (t.show_while_loading ? this._showOnAppear(e) : this._showOnLoad(e), i.push(l), e.wasProcessed = !0);
118        for (; 0 < i.length;) o.splice(i.pop(), 1), t.callback_processed && t.callback_processed(o.length);
119        0 === n && this._stopScrollHandler()
120    }, e.prototype._purgeElements = function () {
121        for (var e = this._elements, t = e.length, o = [], n = 0; n < t; n++) e[n].wasProcessed && o.push(n);
122        for (; 0 < o.length;) e.splice(o.pop(), 1)
123    }, e.prototype._startScrollHandler = function () {
124        this._isHandlingScroll || (this._isHandlingScroll = !0, i(this._settings.container, "scroll", this._handleScrollFn))
125    }, e.prototype._stopScrollHandler = function () {
126        this._isHandlingScroll && (this._isHandlingScroll = !1, l(this._settings.container, "scroll", this._handleScrollFn))
127    }, e.prototype.handleScroll = function () {
128        var e, t, o;
129        this._settings && (t = n(), 0 !== (o = this._settings.throttle) ? (e = o - (t - this._previousLoopTime)) <= 0 || o < e ? (this._loopTimeout && (clearTimeout(this._loopTimeout), this._loopTimeout = null), this._previousLoopTime = t, this._loopThroughElements()) : this._loopTimeout || (this._loopTimeout = setTimeout(u(function () {
130            this._previousLoopTime = n(), this._loopTimeout = null, this._loopThroughElements()
131        }, this), e)) : this._loopThroughElements())
132    }, e.prototype.update = function () {
133        this._elements = function (t) {
134            var o;
135            try {
136                o = Array.prototype.slice.call(t)
137            } catch (e) {
138                for (var n = [], i = t.length, l = 0; l < i; l++) n.push(t[l]);
139                o = n
140            }
141            return o.forEach(function (e) {
142                e.isSkipByPosition = null === e.offsetParent && 0 === s(e, ".t396__carrier-wrapper").length && "fixed" !== e.getAttribute("data-content-cover-parallax"), e.isNotUnderScreenRange = 0 === s(e, ".t-rec[data-screen-max]").length && 0 === s(e, ".t-rec[data-screen-min]").length
143            }), o
144        }(this._queryOriginNode.querySelectorAll(this._settings.elements_selector)), this._purgeElements(), this._loopThroughElements(), this._startScrollHandler()
145    }, e.prototype.destroy = function () {
146        l(window, "resize", this._handleScrollFn), this._loopTimeout && (clearTimeout(this._loopTimeout), this._loopTimeout = null), this._stopScrollHandler(), this._elements = null, this._queryOriginNode = null, this._settings = null
147    }, e
148}), window.lazy = "y", t_onReady(function () {
149    setTimeout(function () {
150        lazyload_cover = new LazyLoad({
151            elements_selector: ".t-cover__carrier",
152            show_while_loading: !1,
153            data_src: "content-cover-bg",
154            placeholder: "",
155            threshold: 700
156        })
157    }, 100), setTimeout(function () {
158        var e, t;
159        lazyload_img = new LazyLoad({
160            elements_selector: ".t-img",
161            threshold: 800
162        }), lazyload_bgimg = new LazyLoad({
163            elements_selector: ".t-bgimg",
164            show_while_loading: !1,
165            placeholder: "",
166            threshold: 800
167        }), lazyload_iframe = new LazyLoad({elements_selector: ".t-iframe"}), document.addEventListener("slide.bs.carousel", function (e) {
168            setTimeout(function () {
169                lazyload_cover.update(), lazyload_img.update(), lazyload_bgimg.update()
170            }, 500)
171        }), /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && !document.body.classList && ((e = document.createElement("div")).classList.add("t-mbfix"), document.body.appendChild(e), t = document.querySelector(".t-mbfix"), setTimeout(function () {
172            t.classList.add("t-mbfix_hide")
173        }, 50), setTimeout(function () {
174            null !== t.parentNode && t.parentNode.removeChild(t)
175        }, 1e3))
176    }, 500)
177});

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.