PageSourceSearch

https://www.fsgc.sm/assets/js/frontend_onload.js?v=1.5.38

js fsgc.sm collected 2026-09-24 21:37:27 UTC 4,215 bytes, 129 lines download raw bytes

1$(document).ready(function () {
2    initLiveCarousel();
3    initGoToPagePositionButton();
4    initSearchBar();
5
6    $('#pills-tab button').on('click', function () {
7        const scrollAnchor = $(".scroll-anchor");
8        const scrollTarget = scrollAnchor.offset();
9        if (scrollTarget) {
10            $("html, body").animate({ scrollTop: scrollTarget.top }, 300);
11        }
12    });
13
14    if ($("#documents_table").length > 0){
15        getDocumentsTable();
16    }
17});
18
19function initDotsCarousel(nameCarousel) {
20    nameCarousel.on('init reInit afterChange', function (e, slick, currentSlide){
21        const $dotsUl = $(this).find('.slick-dots');
22        if ($dotsUl.parent('.dots-wrapper').length === 0) {
23            $dotsUl.wrap('<div class="dots-wrapper"></div>');
24        }
25
26        const $dots = $dotsUl.find('li');
27        if ($dots.length === 0) {
28            return;
29        }
30
31        const dotFullWidth = $dots.eq(0).outerWidth(true);
32        const visibleDots = 5;
33        const wrapperWidth = dotFullWidth * Math.min(visibleDots, $dots.length);
34        $dotsUl.parent('.dots-wrapper').css('width', wrapperWidth + 'px');
35
36        const activeIdx = $dotsUl.find('.slick-active').index();
37        const startMovingAtIdx = visibleDots - 2;
38        let translate = 0;
39        if (activeIdx > startMovingAtIdx) {
40            translate = -dotFullWidth * (activeIdx - startMovingAtIdx);
41        }
42        $dotsUl.css({
43            'transition': 'transform 0.12s cubic-bezier(0.4,0,0.2,1)',
44            'transform': 'translateX(' + translate + 'px)'
45        });
46    });
47}
48
49function initLiveCarousel() {
50    const nameCarousel = $('.live-carousel');
51    if(nameCarousel.length > 0) {
52        initDotsCarousel(nameCarousel);
53
54        nameCarousel.slick({
55            slidesToShow: 3,
56            slidesToScroll: 1,
57            autoplay: true,
58            autoplaySpeed: 3000,
59            dots: true,
60            arrows: true,
61            nextArrow: '<button class="slick-next text-primary"><i class="fa-light fa-arrow-right-long"></i></button>',
62            prevArrow: '<button class="slick-prev text-primary"><i class="fa-light fa-arrow-left-long "></i></button>',
63            responsive: [
64                {
65                    breakpoint: 1024,
66                    settings: {
67                        slidesToShow: 2
68                    }
69                },
70                {
71                    breakpoint: 600,
72                    settings: {
73                        slidesToShow: 1
74                    }
75                }
76            ]
77        });
78    }
79}
80
81function acceptCookies(accepted) {
82    createCookie(accept_cookie_key, accepted, 90);
83    $('#cookie_bar').animate(
84        { left: '-100%' }, // Slide out to the left
85        500, // Duration in milliseconds
86        function() {
87            $(this).remove(); // Remove element from DOM after animation
88        }
89    );
90}
91
92var handheldDropdownsInitialized = false;
93function initHandheldDropdowns() {
94    handheldDropdownsInitialized = true;
95    $("#navbarNav").addClass("handheld");
96    $("#navbarNav.handheld .nav-item.dropdown").find(".dropdown-menu").hide();
97    $("#navbarNav.handheld .nav-item.dropdown").find(".nav-link.dropdown-toggle").click(function() {
98        if ($(this).closest(".nav-item.dropdown").find(".dropdown-menu").is(":visible")) {
99            $(this).closest(".nav-item.dropdown").find(".dropdown-menu").slideUp();
100        } else {
101            $(this).closest(".nav-item.dropdown").find(".dropdown-menu").slideDown();
102        }
103    });
104}
105function toggleHandheldMenu() {
106    $("#navbarNav").toggleClass("toggled-handheld");
107    if (!handheldDropdownsInitialized) {
108        initHandheldDropdowns();
109    }
110}
111
112function initSearchBar() {
113    $("#search-bar").on("submit", function (e) {
114        e.preventDefault();
115        if ($("#search-input").val().trim() !== "") {
116            this.submit();
117        }
118    });
119
120    $('#main-search-btn').on('click', function () {
121        $('#search-modal').removeClass('d-none').hide().fadeIn('fast');
122    });
123
124    $('#search-close-btn').on('click', function () {
125        $('#search-modal').fadeOut('fast', function () {
126            $('#search-modal').addClass('d-none');
127        });
128    });
129}

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.