PageSourceSearch

https://bumper.guru/wp-content/plugins/modesco-table-of-contents-plus/front.js?ver=1404

js bumper.guru collected 2026-10-02 18:16:06 UTC 10,466 bytes, 236 lines download raw bytes

1(function(l) {
2    function t(l) {
3        return l.replace(/(:|\.)/g, "\\$1")
4    }
5    var e = "1.4.10",
6        o = {
7            exclude: [],
8            excludeWithin: [],
9            offset: 0,
10            direction: "top",
11            scrollElement: null,
12            scrollTarget: null,
13            beforeScroll: function() {},
14            afterScroll: function() {},
15            easing: "swing",
16            speed: 400,
17            autoCoefficent: 2
18        },
19        r = function(t) {
20            var e = [],
21                o = !1,
22                r = t.dir && "left" == t.dir ? "scrollLeft" : "scrollTop";
23            return this.each(function() {
24                if (this != document && this != window) {
25                    var t = l(this);
26                    t[r]() > 0 ? e.push(this) : (t[r](1), o = t[r]() > 0, o && e.push(this), t[r](0))
27                }
28            }), e.length || this.each(function() {
29                "BODY" === this.nodeName && (e = [this])
30            }), "first" === t.el && e.length > 1 && (e = [e[0]]), e
31        };
32    l.fn.extend({
33        scrollable: function(l) {
34            var t = r.call(this, {
35                dir: l
36            });
37            return this.pushStack(t)
38        },
39        firstScrollable: function(l) {
40            var t = r.call(this, {
41                el: "first",
42                dir: l
43            });
44            return this.pushStack(t)
45        },
46        smoothScroll: function(e) {
47            e = e || {};
48            var o = l.extend({}, l.fn.smoothScroll.defaults, e),
49                r = l.smoothScroll.filterPath(location.pathname);
50            return this.unbind("click.smoothscroll").bind("click.smoothscroll", function(e) {
51                var n = this,
52                    s = l(this),
53                    c = o.exclude,
54                    i = o.excludeWithin,
55                    a = 0,
56                    f = 0,
57                    h = !0,
58                    u = {},
59                    d = location.hostname === n.hostname || !n.hostname,
60                    m = o.scrollTarget || (l.smoothScroll.filterPath(n.pathname) || r) === r,
61                    p = t(n.hash);
62                if (o.scrollTarget || d && m && p) {
63                    for (; h && c.length > a;) s.is(t(c[a++])) && (h = !1);
64                    for (; h && i.length > f;) s.closest(i[f++]).length && (h = !1)
65                } else h = !1;
66                h && (e.preventDefault(), l.extend(u, o, {
67                    scrollTarget: o.scrollTarget || p,
68                    link: n
69                }), l.smoothScroll(u))
70            }), this
71        }
72    }), l.smoothScroll = function(t, e) {
73        var o, r, n, s, c = 0,
74            i = "offset",
75            a = "scrollTop",
76            f = {},
77            h = {};
78        "number" == typeof t ? (o = l.fn.smoothScroll.defaults, n = t) : (o = l.extend({}, l.fn.smoothScroll.defaults, t || {}), o.scrollElement && (i = "position", "static" == o.scrollElement.css("position") && o.scrollElement.css("position", "relative"))), o = l.extend({
79            link: null
80        }, o), a = "left" == o.direction ? "scrollLeft" : a, o.scrollElement ? (r = o.scrollElement, c = r[a]()) : r = l("html, body").firstScrollable(), o.beforeScroll.call(r, o), n = "number" == typeof t ? t : e || l(o.scrollTarget)[i]() && l(o.scrollTarget)[i]()[o.direction] || 0, f[a] = n + c + o.offset, s = o.speed, "auto" === s && (s = f[a] || r.scrollTop(), s /= o.autoCoefficent), h = {
81            duration: s,
82            easing: o.easing,
83            complete: function() {
84                o.afterScroll.call(o.link, o)
85            }
86        }, o.step && (h.step = o.step), r.length ? r.stop().animate(f, h) : o.afterScroll.call(o.link, o)
87    }, l.smoothScroll.version = e, l.smoothScroll.filterPath = function(l) {
88        return l.replace(/^\//, "").replace(/(index|default).[a-zA-Z]{3,4}$/, "").replace(/\/$/, "")
89    }, l.fn.smoothScroll.defaults = o
90})(jQuery);
91
92
93jQuery.cookie = function(a, b, c) {
94    if (arguments.length > 1 && String(b) !== "[object Object]") {
95        c = jQuery.extend({}, c);
96        if (b === null || b === undefined) {
97            c.expires = -1
98        }
99        if (typeof c.expires === "number") {
100            var d = c.expires,
101                e = c.expires = new Date;
102            e.setDate(e.getDate() + d)
103        }
104        b = String(b);
105        return document.cookie = [encodeURIComponent(a), "=", c.raw ? b : encodeURIComponent(b), c.expires ? "; expires=" + c.expires.toUTCString() : "", c.path ? "; path=" + c.path : "", c.domain ? "; domain=" + c.domain : "", c.secure ? "; secure" : ""].join("")
106    }
107    c = b || {};
108    var f, g = c.raw ? function(a) {
109        return a
110    } : decodeURIComponent;
111    return (f = (new RegExp("(?:^|; )" + encodeURIComponent(a) + "=([^;]*)")).exec(document.cookie)) ? g(f[1]) : null
112}
113
114jQuery(document).ready(function($) {
115
116    if (typeof tocplus != 'undefined') {
117        $.fn.shrinkTOCWidth = function() {
118            $(this).css({
119                width: 'auto',
120                display: 'table'
121            });
122            if ($.browser.msie && parseInt($.browser.version) == 7)
123                $(this).css('width', '');
124        }
125        if (tocplus.smooth_scroll == 1) {
126            var target = hostname = pathname = qs = hash = null;
127            $('body a').click(function(event) {
128                hostname = $(this).prop('hostname');
129                pathname = $(this).prop('pathname');
130                qs = $(this).prop('search');
131                hash = $(this).prop('hash');
132                if (pathname.length > 0) {
133                    if (pathname.charAt(0) != '/') {
134                        pathname = '/' + pathname;
135                    }
136                }
137                if ((window.location.hostname == hostname) && (window.location.pathname == pathname) && (window.location.search == qs) && (hash !== '')) {
138                    var hash_selector = hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g, '\\$1');
139                    if ($(hash_selector).length > 0)
140                        target = hash;
141                    else {
142                        anchor = hash;
143                        anchor = anchor.replace('#', '');
144                        target = 'a[name="' + anchor + '"]';
145                        if ($(target).length == 0)
146                            target = '';
147                    }
148                    if (typeof tocplus.smooth_scroll_offset != 'undefined') {
149                        offset = -1 * tocplus.smooth_scroll_offset;
150                    } else {
151                        if ($('#wpadminbar').length > 0) {
152                            if ($('#wpadminbar').is(':visible'))
153                                offset = -30;
154                            else
155                                offset = 0;
156                        } else
157                            offset = 0;
158                    }
159                    if (target) {
160                        $.smoothScroll({
161                            scrollTarget: target,
162                            offset: offset
163                        });
164                    }
165                }
166            });
167        }
168        if (typeof tocplus.visibility_show != 'undefined') {
169            var invert = (typeof tocplus.visibility_hide_by_default != 'undefined') ? true : false;
170            if ($.cookie)
171                var visibility_text = ($.cookie('tocplus_hidetoc')) ? tocplus.visibility_show : tocplus.visibility_hide;
172            else
173                var visibility_text = tocplus.visibility_hide;
174            if (invert)
175                visibility_text = (visibility_text == tocplus.visibility_hide) ? tocplus.visibility_show : tocplus.visibility_hide;
176            $('#toc_container p.toc__title').append(' <span class="toc__toggle">[<a href="#">' + visibility_text + '</a>]</span>');
177            if (visibility_text == tocplus.visibility_show) {
178                $('ul.toc__list').hide();
179                $('#toc_container').addClass('contracted').shrinkTOCWidth();
180            }
181
182            $('span.toc__toggle a').click(function(event) {
183                event.preventDefault();
184                switch ($(this).html()) {
185                    case $('<div/>').html(tocplus.visibility_hide).text():
186                        $(this).html(tocplus.visibility_show);
187                        if ($.cookie) {
188                            if (invert)
189                                $.cookie('tocplus_hidetoc', null, {
190                                    path: '/'
191                                });
192                            else
193                                $.cookie('tocplus_hidetoc', '1', {
194                                    expires: 30,
195                                    path: '/'
196                                });
197                        }
198                        $('ul.toc__list').hide('fast');
199                        $('#toc_container').addClass('contracted').shrinkTOCWidth();
200                        break;
201                    case $('<div/>').html(tocplus.visibility_show).text():
202                    default:
203                        $(this).html(tocplus.visibility_hide);
204                        if ($.cookie) {
205                            if (invert)
206                                $.cookie('tocplus_hidetoc', '1', {
207                                    expires: 30,
208                                    path: '/'
209                                });
210                            else
211                                $.cookie('tocplus_hidetoc', null, {
212                                    path: '/'
213                                });
214                        }
215                        $('#toc_container').css('width', tocplus.width).removeClass('contracted');
216                        $('ul.toc__list').show('fast');
217                }
218            });
219
220        }
221    }
222
223   $('.toc .toc__listLink').hover(
224        function(){
225            $(this).css('border-bottom-color', $(this).css('color'));
226        },
227        function(){
228             $(this).css('border-bottom-color','transparent');
229        }
230    );
231  $('.toc .toc__listLink').focus(
232        function(){
233            $(this).css('border-bottom-color', $(this).css('color'));
234        }
235    );
236});

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.