PageSourceSearch

https://apologetika.ru/js/slidebars.js

js apologetika.ru collected 2026-10-02 05:22:38 UTC 9,207 bytes, 289 lines download raw bytes

1;
2(function(a) {
3    a.slidebars = function(b) {
4        var x = a.extend({
5            siteClose: true,
6            disableOver: false,
7            hideControlClasses: false
8        }, b);
9        var v = document.createElement("div").style,
10            t = false,
11            k = false;
12        if (v.MozTransition === "" || v.WebkitTransition === "" || v.OTransition === "" || v.transition === "") {
13            t = true
14        }
15        if (v.MozTransform === "" || v.WebkitTransform === "" || v.OTransform === "" || v.transform === "") {
16            k = true
17        }
18        var s = navigator.userAgent,
19            y = false,
20            c = false;
21        if (/Android/.test(s)) {
22            y = s.substr(s.indexOf("Android") + 8, 3)
23        } else {
24            if (/(iPhone|iPod|iPad)/.test(s)) {
25                c = s.substr(s.indexOf("OS ") + 3, 3).replace("_", ".")
26            }
27        }
28        if (y && y < 3 || c && c < 5) {
29            a("html").addClass("sb-static")
30        }
31        if (!a("#sb-site").length) {
32            a("body").children().wrapAll('<div id="sb-site" />')
33        }
34        var q = a("#sb-site");
35        if (!q.parent().is("body")) {
36            q.appendTo("body")
37        }
38        if (a(".sb-left").length) {
39            var e = a(".sb-left"),
40                g = false;
41            e.addClass("sb-slidebar");
42            if (!e.parent().is("body")) {
43                e.appendTo("body")
44            }
45        }
46        if (a(".sb-right").length) {
47            var h = a(".sb-right"),
48                j = false;
49            h.addClass("sb-slidebar");
50            if (!h.parent().is("body")) {
51                h.appendTo("body")
52            }
53        }
54        var r = false,
55            z = a(window).width(),
56            w = a(".sb-toggle-left, .sb-toggle-right, .sb-open-left, .sb-open-right, .sb-close"),
57            m = a(".sb-slide");
58
59        function o() {
60            if (!x.disableOver || (typeof x.disableOver === "number" && x.disableOver >= z)) {
61                r = true;
62                a("html").addClass("sb-init");
63                if (x.hideControlClasses) {
64                    w.removeClass("sb-hide")
65                }
66            } else {
67                if (typeof x.disableOver === "number" && x.disableOver < z) {
68                    r = false;
69                    a("html").removeClass("sb-init");
70                    if (x.hideControlClasses) {
71                        w.addClass("sb-hide")
72                    }
73                    if (g || j) {
74                        l()
75                    }
76                }
77            }
78        }
79        o();
80
81        function f() {
82            q.css("minHeight", "");
83            q.css("minHeight", a("body").height() + "px");
84            if (e && (e.hasClass("sb-style-push") || e.hasClass("sb-style-overlay"))) {
85                e.css("marginLeft", "-" + e.css("width"))
86            }
87            if (h && (h.hasClass("sb-style-push") || h.hasClass("sb-style-overlay"))) {
88                h.css("marginRight", "-" + h.css("width"))
89            }
90            if (e && e.hasClass("sb-width-custom")) {
91                e.css("width", e.attr("data-sb-width"))
92            }
93            if (h && h.hasClass("sb-width-custom")) {
94                h.css("width", h.attr("data-sb-width"))
95            }
96        }
97        f();
98        a(window).resize(function() {
99            var A = a(window).width();
100            if (z !== A) {
101                z = A;
102                o();
103                f();
104                if (g) {
105                    i("left")
106                }
107                if (j) {
108                    i("right")
109                }
110            }
111        });
112        var u;
113        if (t && k) {
114            u = "translate";
115            if (y && y < 4.4) {
116                u = "side"
117            }
118        } else {
119            u = "jQuery"
120        }
121
122        function d(B, E, D) {
123            var A;
124            if (B.hasClass("sb-style-push")) {
125                A = q.add(B).add(m)
126            } else {
127                if (B.hasClass("sb-style-overlay")) {
128                    A = B
129                } else {
130                    A = q.add(m)
131                }
132            }
133            if (u === "translate") {
134                A.css("transform", "translate(" + E + ")")
135            } else {
136                if (u === "side") {
137                    if (E[0] === "-") {
138                        E = E.substr(1)
139                    }
140                    A.css(D, E);
141                    setTimeout(function() {
142                        if (E === "0px") {
143                            A.removeAttr("style");
144                            f()
145                        }
146                    }, 400)
147                } else {
148                    if (u === "jQuery") {
149                        if (E[0] === "-") {
150                            E = E.substr(1)
151                        }
152                        var C = {};
153                        C[D] = E;
154                        A.stop().animate(C, 400);
155                        setTimeout(function() {
156                            if (E === "0px") {
157                                A.removeAttr("style");
158                                f()
159                            }
160                        }, 400)
161                    }
162                }
163            }
164        }
165
166        function i(A) {
167            if (A === "left" && e && j || A === "right" && h && g) {
168                l();
169                setTimeout(B, 400)
170            } else {
171                B()
172            }
173
174            function B() {
175                if (r && A === "left" && e) {
176                    a("html").addClass("sb-active sb-active-left");
177                    e.addClass("sb-active");
178                    d(e, e.css("width"), "left");
179                    setTimeout(function() {
180                        g = true
181                    }, 400)
182                } else {
183                    if (r && A === "right" && h) {
184                        a("html").addClass("sb-active sb-active-right");
185                        h.addClass("sb-active");
186                        d(h, "-" + h.css("width"), "right");
187                        setTimeout(function() {
188                            j = true
189                        }, 400)
190                    }
191                }
192            }
193        }
194
195        function l(A) {
196            if (g || j) {
197                if (g) {
198                    d(e, "0px", "left");
199                    g = false
200                }
201                if (j) {
202                    d(h, "0px", "right");
203                    j = false
204                }
205                setTimeout(function() {
206                    a("html").removeClass("sb-active sb-active-left sb-active-right");
207                    if (e) {
208                        e.removeClass("sb-active")
209                    }
210                    if (h) {
211                        h.removeClass("sb-active")
212                    }
213                    if (A) {
214                        window.location = A
215                    }
216                }, 400)
217            }
218        }
219
220        function n(A) {
221            if (A === "left" && e) {
222                if (!g) {
223                    i("left")
224                } else {
225                    l()
226                }
227            }
228            if (A === "right" && h) {
229                if (!j) {
230                    i("right")
231                } else {
232                    l()
233                }
234            }
235        }
236        this.open = i;
237        this.close = l;
238        this.toggle = n;
239        this.init = function() {
240            return r
241        };
242        this.active = function(A) {
243            if (A === "left" && e) {
244                return g
245            }
246            if (A === "right" && h) {
247                return j
248            }
249        };
250
251        function p(B, A) {
252            B.stopPropagation();
253            B.preventDefault();
254            if (B.type === "touchend") {
255                A.off("click")
256            }
257        }
258        a(".sb-toggle-left").on("touchend click", function(A) {
259            p(A, a(this));
260            n("left")
261        });
262        a(".sb-toggle-right").on("touchend click", function(A) {
263            p(A, a(this));
264            n("right")
265        });
266        a(".sb-open-left").on("touchend click", function(A) {
267            p(A, a(this));
268            i("left")
269        });
270        a(".sb-open-right").on("touchend click", function(A) {
271            p(A, a(this));
272            i("right")
273        });
274        a(".sb-close").on("touchend click", function(A) {
275            p(A, a(this));
276            l()
277        });
278        a(".sb-slidebar a").not(".sb-disable-close").on("click", function(A) {
279            p(A, a(this));
280            l(a(this).attr("href"))
281        });
282        q.on("touchend click", function(A) {
283            if (x.siteClose && (g || j)) {
284                p(A, a(this));
285                l()
286            }
287        })
288    }
289})(jQuery);

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.