PageSourceSearch

https://www.dotcom-monitor.com/blog/wp-content/plugins/top-table-o…/public/js/boomdevs-toc-public.js?ver=1.4.1

js dotcom-monitor.com collected 2026-09-24 08:54:13 UTC 17,791 bytes, 422 lines download raw bytes

1(function ($) {
2    "use strict";
3
4    $(document).ready(function () {
5        let bdTocContentListLink = $(".bd_toc_content_list_item a"),
6            bdTocContainerWithFixed = $(".scroll-to-fixed-fixed"),
7            bdTocContainer = $(".bd_toc_container"),
8            bdTocHeader = $(".bd_toc_header"),
9            bd_toc_wrapper = $(".bd_toc_wrapper"),
10            bd_toc_content = $(".bd_toc_content"),
11            bd_toc_wrapper_height = bd_toc_wrapper.height(),
12            bd_toc_content_height = $(".bd_toc_content").height(),
13            bdTocContainerDataVal = bdTocContainer.data("fixedwidth");
14
15        bdTocHeader.click(function () {
16            bd_toc_content.slideToggle();
17
18            $('.fit_content').css({
19                width: "auto"
20            });
21
22            if ($(this).hasClass("active")) {
23                $(this).removeClass("active");
24                bdTocContainer.addClass("slide_left");
25                headerTitleWidthHeight();
26            } else {
27                $(this).addClass("active");
28                bdTocContainer.removeClass("slide_left");
29                headerTitleRemoveWidthHeight();
30            }
31        });
32
33
34        //add width to header title
35        function headerTitleWidthHeight() {
36            let headerTitleWidth = $(".bd_toc_header_title").width();
37            let bdTocWrapperPadding = bd_toc_wrapper.attr("data-wrapperPadding");
38            let bdTocHeaderPadding = bdTocHeader.attr("data-headerPadding");
39            let bdTocWrapperPaddingValue = parseInt(bdTocWrapperPadding);
40            let bdTocHeaderPaddingValue = parseInt(bdTocHeaderPadding);
41            let totleHeaderTitleWidth = parseInt(headerTitleWidth + bdTocWrapperPaddingValue + bdTocHeaderPaddingValue + 3);
42
43            if (bdTocContainer.hasClass("scroll-to-fixed-fixed")) {
44                bdTocContainerWithFixed.css({
45                    position: "fixed",
46                    top: "0px",
47                });
48            } else {
49                bdTocContainer.css(
50                    "cssText",
51                    "width: " + totleHeaderTitleWidth + "px !important;"
52                );
53            }
54        }
55
56        // remove width and height from header title
57        function headerTitleRemoveWidthHeight() {
58            bdTocContainer.css("width", 0 + "px");
59            // bd_toc_content.css("cssText", "height: " + bd_toc_content_height + "px");
60        }
61
62        //collapse button off
63        if (handle.initial_view == "0") {
64            bdTocHeader.click(function () {
65                if (bdTocContainer.hasClass("scroll-to-fixed-fixed")) {
66                    bdTocContainerWithFixed.css({
67                        position: "fixed",
68                        top: "0px",
69                    });
70                } else {
71                    bdTocContainer.css(
72                        "cssText",
73                        "width: " + 100 + "% !important;",
74                        "transition: all 0.5s ease-in-out;"
75                    );
76                }
77                bd_toc_content.css("cssText", "display: block;");
78
79                if (bdTocContainer.hasClass("slide_left")) {
80                    headerTitleWidthHeight();
81                } else {
82                    $(".bd_toc_content_list").css(
83                        "cssText",
84                        // "height: " + $(".bd_toc_content").height() + "px !important;"
85                    );
86                }
87            });
88            if (bdTocHeader.hasClass("active")) {
89                bdTocHeader.removeClass("active");
90            }
91        }
92
93        //collapse button on
94        if (handle.initial_view == "1") {
95            headerTitleRemoveWidthHeight();
96        }
97
98        function slidingTocContainer(width) {
99            let side = sticky_mode_position.sticky_mode_position;
100            let oppositeSide = side === 'right' ? 'left' : 'right';
101            $(".bd_toc_container.scroll-to-fixed-fixed").css(
102                "cssText",
103                `z-index: 1000;
104                position: fixed;
105                transition: ${side} 0.2s ease-in-out;
106                top: 0px;
107                margin-left: 0px;
108                ${side}: calc( 0% + ${width} ) !important;
109                ${oppositeSide}: auto !important;`
110            );
111        }
112
113        $(document).on(
114            "click",
115            ".bd_toc_content_list_item ul li .collaps-button",
116            function () {
117                $(this).parent("li").toggleClass("collapsed");
118                $(this).parent("li").find("li").addClass("collapsed");
119                bd_toc_content_height = $(".bd_toc_content ul").height();
120
121                toggleContentWrapperHeight(bd_toc_content_height);
122            }
123        );
124
125        bdTocContentListLink.on("click", function () {
126            let bdTocContentListLinkHref = $(this).attr("href");
127            location.replace(bdTocContentListLinkHref);
128        });
129
130        bdTocContentListLink.on("click", function () {
131            if (screen.width < "1024") {
132                if (bdTocContainer.hasClass("active")) {
133                    slidingTocContainer("-" + bdTocContainerDataVal + "px");
134                    bdTocContainer.removeClass("active");
135                }
136            }
137        });
138
139        function toggleContentWrapperHeight(height) {
140            $(".bd_toc_container .bd_toc_content_list_item").css("height", height);
141        }
142
143        $(".layout_toggle_button").on("click", function () {
144            if (sticky_mode_position.sticky_sidebar_collapse_on_off == "1") {
145                $('.bd_toc_container.scroll-to-fixed-fixed .bd_toc_wrapper').css('opacity', '1');
146                if (bdTocContainer.hasClass("active")) {
147                    bdTocContainer.removeClass("active");
148                    slidingTocContainer(`0px`);
149                } else {
150                    bdTocContainer.addClass("active");
151                    slidingTocContainer("-" + bdTocContainerDataVal + "px");
152                }
153            } else {
154                if (bdTocContainer.hasClass("active")) {
155                    bdTocContainer.removeClass("active");
156                    slidingTocContainer("-" + bdTocContainerDataVal + "px");
157                } else {
158                    bdTocContainer.addClass("active");
159                    slidingTocContainer(`0px`);
160                }
161            }
162        });
163
164        //scroll class add form sticky sidebar when content height is greater than windows height 
165        if (bd_toc_content.height() > $(window).height()) {
166            bd_toc_content.addClass("scroll");
167        } else {
168            bd_toc_content.removeClass("scroll");
169        }
170
171        //progress bar
172        if (typeof progress_bar_switcher !== 'undefined' && progress_bar_switcher.progress_bar_switcher == 1) {
173            $(".bd_toc_progress_bar").addClass("progress_bar_open");
174            $(document).on("scroll", function () {
175                var pixels = $(document).scrollTop();
176                var pageHeight = $(document).height() - $(window).height();
177                var progress = 100 * pixels / pageHeight;
178
179                $(".bd_toc_widget_progress_bar").css("width", progress + "%");
180            })
181        }
182    });
183
184    //floating content show hide option when scrolling
185    function widgetFLoatingOpen() {
186        $(window).scroll(function () {
187            let windowScrollLength = $(window).scrollTop();
188            if (windowScrollLength > $(".bd_toc_container").height() + $('.bd_toc_container').offset().top) {
189                $(".bd_toc_widget_floating").addClass("widget_floating_open");
190            } else {
191                $(".bd_toc_widget_floating").removeClass("widget_floating_open");
192            }
193        });
194    }
195
196    //default nav scrolling and floating value update
197    $(".bd_toc_content_list_item").onePageNav({
198        currentClass: "current",
199        scrollChange: function ($currentListItem) {
200            $($currentListItem).parents("li").addClass("active");
201            $($currentListItem[0]).addClass("active");
202
203            //floating title text insert when click single content element
204            // let current_list_item = $currentListItem.text();
205            let current_list_item = $(".bd_toc_content_list_item ul li.current").find(">:first-child").text();
206            $(".bd_toc_widget_floating_current_heading .current_list_item").text(current_list_item);
207
208            if (handle.isProActivated && widget_floating_option.widget_floating_option == "1") {
209                //floating content show when default content scroll
210                widgetFLoatingOpen();
211            }
212        },
213    });
214
215    //Floating Title show and value update when scrolling
216    if (handle.isProActivated && widget_floating_option.widget_floating_option == "1") {
217        $(".bd_toc_content_floating_list_item").onePageNav({
218            currentClass: "current",
219            scrollChange: function ($currentListItem) {
220                // let current_list_item = $currentListItem.text();
221                let current_list_item = $(".bd_toc_content_floating_list_item ul li.current").find(">:first-child").text();
222                $(".bd_toc_widget_floating_current_heading .current_list_item").text(current_list_item);
223
224                //floating content show when scroll floating content scroll 
225                widgetFLoatingOpen();
226            },
227        });
228    };
229
230    //Floating option
231    if (handle.isProActivated && widget_floating_option.widget_floating_option == 1) {
232        $(".bd_toc_widget_item").prepend(`
233        <div class="current_list_item"></div>
234    `)
235    }
236
237    //Floating navigation insert
238    if (handle.isProActivated && widget_floating_nav.widget_floating_nav == 1) {
239        $(".bd_toc_widget_item").prepend(`
240            <div class="bd_toc_widget_nav_prev">
241                <a href="#" class="bd_toc_widget_left_arrow"></a>
242            </div>
243            <div class="bd_toc_widget_nav_next">
244                <a href="#" class="bd_toc_widget_right_arrow"></a>
245            </div>
246        `)
247    }
248
249    //floating content
250    if (handle.isProActivated && widget_floating_content.widget_floating_content == 1) {
251        $(".current_list_item").hover(function () {
252            $(this).parent().parent().parent().find(".bd_toc_floating_content").addClass("widget_floating_content_open");
253            $(".bd_toc_widget_floating").css({
254                "border-radius": "15px",
255            });
256        });
257
258        //floating content hide when click floating single content
259        $(".bd_toc_floating_content ul li a ").on("click", function () {
260            $('.bd_toc_floating_content').addClass("floating_content_hide");
261        })
262
263        let title_border_radius_top = widget_floating_content.title_border_radius_top + "px";
264        let title_border_radius_right = widget_floating_content.title_border_radius_right + "px";
265        let title_border_radius_bottom = widget_floating_content.title_border_radius_bottom + "px";
266        let title_border_radius_left = widget_floating_content.title_border_radius_left + "px";
267
268        $(document).on("mouseleave", ".bd_toc_floating_content", function () {
269
270            if ($(window).width() >= 768) {
271                $(this).removeClass("floating_content_hide");
272                $(this).removeClass("widget_floating_content_open");
273                $(".bd_toc_widget_floating").css(
274                    "cssText",
275                    `
276                    border-top-left-radius: ${title_border_radius_top},
277                    border-top-right-radius: ${title_border_radius_right},
278                    border-bottom-left-radius: ${title_border_radius_bottom},
279                    border-bottom-right-radius: ${title_border_radius_left},
280                    `
281                );
282            }
283        });
284        // for mobile devices
285        if ($(window).width() <= 767) {
286            $(".floating_toc_bg_overlay").on("click", function () {
287                $(".bd_toc_floating_content").removeClass("widget_floating_content_open");
288                $('.bd_toc_widget_floating').removeClass("overlay");
289                $('.bd_toc_widget_floating_current_heading').css({
290                    "display": "block"
291                })
292            })
293
294            $(".bd_toc_widget_nav_overlay").on("click", function () {
295                $(this).parent().parent().parent().find(".bd_toc_floating_content").addClass("widget_floating_content_open");
296                $(".bd_toc_widget_floating").css({
297                    "border-radius": "15px"
298                });
299                $('.bd_toc_widget_floating').addClass("overlay");
300                $('.bd_toc_widget_floating_current_heading').css({
301                    "display": "none"
302                })
303            });
304        }
305    }
306
307    //floating content hide floating position is bottom 
308    if (handle.isProActivated && widget_floating_content.widget_floating_position == "bottom") {
309        $(".current_list_item").hover(function () {
310            $(this).parent().parent().css("display", "none");
311            $(this).parent().parent().parent().find(".bd_toc_floating_content").css("display", "block");
312        });
313
314        $(document).on("mouseleave", ".bd_toc_floating_content", function () {
315            if ($(window).width() >= 768) {
316                $(".bd_toc_widget_floating_current_heading").css("display", "block");
317                $(this).css("display", "none");
318            }
319        });
320
321        if (handle.isProActivated && widget_floating_content.widget_floating_content == 0) {
322            $(".current_list_item").hover(function () {
323                $(this).parent().parent().css("display", "block");
324                $(this).parent().parent().parent().find(".bd_toc_floating_content").css("display", "none");
325            });
326        }
327    }
328
329    //floating text update when click single content element
330    $(".bd_toc_content_list_item ul li a ").on("click", function () {
331        if (handle.isProActivated && widget_floating_option.widget_floating_option == "1") {
332            $(".bd_toc_content_floating_list_item").onePageNav({
333                currentClass: "current",
334                scrollChange: function ($currentListItem) {
335                    let current_list_item = $(".bd_toc_content_list_item ul li.current").find(">:first-child").text();
336                    $(".bd_toc_widget_floating_current_heading .current_list_item").text(current_list_item);
337
338                    //floating content show when scroll floating content scroll 
339                    widgetFLoatingOpen();
340                },
341            });
342        }
343    });
344
345    if ($('.bd_toc_content_floating_list_item').length > 0) {
346        $('.bd_toc_content_floating_list_item ul:first > li').addClass('root_parent');
347    }
348
349    //floating text update when click floating single content element
350    $(".bd_toc_content_floating_list_item ul li a ").on("click", function () {
351        let current_text = $(".bd_toc_content_floating_list_item ul li.current").find(">:first-child").text();
352        $('.bd_toc_widget_floating_current_heading .current_list_item').text(current_text);
353    });
354
355    //floating navigation when click arrow left button
356    $(".bd_toc_widget_nav_prev").on("click", function () {
357        let pre_id = "";
358        let current_dom = $(".bd_toc_floating_content .bd_toc_content_floating_list_item ul").find("li.current");
359        if (current_dom.prev().children("ul").length > 0) {
360            pre_id = current_dom.prev().children("ul").find("li").last().find("a").attr("href");
361
362        } else {
363            if (current_dom.parent().children("li").hasClass("first last")) {
364                pre_id = current_dom.parent().parent().find("a").attr("href");
365            } else {
366                pre_id = current_dom.prev().find("a").attr("href");
367            }
368            if (pre_id === undefined) {
369                pre_id = current_dom.parent().parent().find("a").attr("href");
370            }
371        }
372
373        $(".bd_toc_widget_nav_prev a").attr("href", pre_id);
374        $('html').css("scroll-behavior", "smooth");
375    });
376
377    //floating navigation when click arrow right button
378    $(".bd_toc_widget_nav_next").on("click", function () {
379        // e.preventDefault();
380        let next_id;
381        let current_dom = $(".bd_toc_floating_content .bd_toc_content_floating_list_item ul").find("li.current");
382
383        if (current_dom.children("ul").children("li").hasClass("first last")) {
384            next_id = current_dom.children("ul").children("li").find("a").attr("href");
385        } else {
386            let next_element = current_dom.next("li");
387            next_id = next_element.find("a").attr("href");
388
389            if (current_dom.children("ul").length > 0) {
390                next_id = current_dom.children("ul").children("li").find("a").attr("href");
391            } else {
392                if (next_element.length === 0) {
393                    let parent_li = getFirstParentLi(current_dom[0]);
394                    next_id = $(parent_li).next().children("a").attr("href");
395                } else {
396                    next_id = current_dom.next("li").find("a").attr("href");
397                }
398            }
399        }
400
401        $(".bd_toc_widget_nav_next a").attr("href", next_id);
402        $('html').css("scroll-behavior", "smooth");
403    });
404
405
406    function getFirstParentLi(element) {
407        if (!element.parentNode || element.parentNode.className === 'root_parent' || element.parentNode.className === 'first root_parent') {
408            return element.parentNode;
409        }
410        // Recursive case: call the function again with the parent element
411        return getFirstParentLi(element.parentNode);
412    }
413
414    let count = $(".bd_toc_container").length;
415
416    for (let i = 0; i < count; i++) {
417        if (i !== 0) {
418            $(".bd_toc_container").eq(1).remove();
419        }
420    }
421
422})(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.