PageSourceSearch

https://aaron.net.pl/wp-content/themes/newscrunch/assets/js/custom.js?ver=6.8.10

js aaron.net.pl collected 2026-10-04 20:15:10 UTC 9,897 bytes, 255 lines download raw bytes

1(function($){
2    
3    $(document).ready(function() {
4
5        
6       /* ---------------------------------------------- /*
7         * Home section height
8         /* ---------------------------------------------- */
9
10        function buildHomeSection(homeSection) {
11            if (homeSection.length > 0) {
12                if (homeSection.hasClass('home-full-height')) {
13                    homeSection.height($(window).height());
14                } else {
15                    homeSection.height($(window).height() * 0.85);
16                }
17            }
18        }
19        
20
21        /* ---------------------------------------------- /*
22         * News highlight section 
23        /* ---------------------------------------------- */ 
24          $('#spnc-marquee-right').on('click', function() {
25                 $('.spnc_highlights').addClass('right');
26             })
27             $('#spnc-marquee-left').on('click', function() {
28                 $('.spnc_highlights').removeClass('right');
29             })
30                    
31        /* ---------------------------------------------- /*
32         * Scroll top
33         /* ---------------------------------------------- */
34
35        $(window).scroll(function() {
36            if ($(this).scrollTop() > 100) {
37                $('.scroll-up').fadeIn();
38            } else {
39                $('.scroll-up').fadeOut();
40            }
41        });
42
43        $('a[href="#totop"]').click(function() {
44            $('html, body').animate({ scrollTop: 0 }, 'slow');
45            return false;
46        });
47    
48        // Accodian Js
49        function toggleIcon(e) {
50            $(e.target)
51            .prev('.panel-heading')
52            .find(".more-less")
53            .toggleClass('fa-plus-square-o fa-minus-square-o');
54        }
55        $('.panel-group').on('hidden.bs.collapse', toggleIcon);
56        $('.panel-group').on('shown.bs.collapse', toggleIcon);
57
58        // top date time
59        var timeElement = $( ".newscrunch-topbar-time" )
60        if( timeElement.length > 0 ) {
61            setInterval(function() {
62                timeElement.html(new Date().toLocaleTimeString())
63            },1000);
64        }
65
66        /* ---------------------------------------------- /*
67         * Sticky Header
68         /* ---------------------------------------------- */
69        jQuery(window).bind('scroll', function () {
70            if ( jQuery(window).scrollTop() > 100) {
71                jQuery('.header-sticky').addClass('stickymenu');
72                jQuery('.wow-callback').addClass('wow-sticky');
73            } else {
74                jQuery('.header-sticky').removeClass('stickymenu');
75                jQuery('.wow-callback').removeClass('wow-sticky');
76            }
77        });
78
79        /* ---------------------------------------------- /*
80         * Banner carousel 
81        /* ---------------------------------------------- */  
82        $("#spnc-banner-carousel-1").owlCarousel({
83            navigation : true, // Show next and prev buttons        
84            autoplay: true,
85            autoplayTimeout: 3000,
86            autoplayHoverPause: true,
87            smartSpeed: 2300,
88            loop:true, // loop is true up to 1199px screen.
89            nav:true, // is true across all sizes
90            margin:10, // margin 10px till 960 breakpoint
91            autoHeight: true,
92            responsiveClass:true, // Optional helper class. Add 'owl-reponsive-' + 'breakpoint' class to main element.
93            //items: 3,
94            dots: false,
95            navText: ["<i class='fa fa-arrow-left'></i>","<i class='fa fa-arrow-right'></i>"],
96            responsive:{    
97                200:{ items:1 },
98                480:{ items:1 },
99                768:{ items:1 },
100                1000:{ items:1 }            
101            }
102        });
103
104        // Video section popup
105        $('.popup-youtube1, .popup-youtube2, .popup-youtube3').magnificPopup({
106            disableOn: 700,
107            type: 'iframe',
108            mainClass: 'mfp-fade',
109            removalDelay: 160,
110            preloader: false,
111            fixedContentPos: false
112        });
113
114
115        /* ---------------------------------------------- /*
116         * Sticky sidebar
117        /* ---------------------------------------------- */    
118        var topLimit = ($('#spnc-sidebar-fixed').offset() || { "top": NaN }).top;
119        //var bottomLimit=$(".spnc-blog-section").height();
120        $(window).scroll(function() {
121            if (topLimit <= $(window).scrollTop()){
122                $('#spnc-sidebar-fixed').addClass('spnc_sticky')
123            } else {
124                $('#spnc-sidebar-fixed').removeClass('spnc_sticky')
125            }
126        });
127        $(document).ready(function() {
128            $('.spnc-sticky-sidebar, .spnc-sticky-content')
129                .theiaStickySidebar({
130                    additionalMarginTop: 30
131            });
132        });
133
134        /* ---------------------------------------------- /*
135         *Add animation class in widget
136        /* ---------------------------------------------- */ 
137        //add css for post title hover effect
138        var className = $('#wrapper #page').attr('class');
139        if (typeof className !== 'undefined') {
140        // Access properties or methods of someVariable here
141
142        className= className.split(' ');
143        $(".wp-block-latest-posts__post-title").addClass(className[1]);
144
145        //add css for img hover effect
146        const footerClass = className[2].split('-');
147        $(".wp-block-latest-posts__featured-image").addClass(footerClass[1]);
148        }
149
150    }); 
151
152    /* Preloader */
153    jQuery(window).on('load', function() {
154        var preloaderFadeOutTime = 500;
155        function newscrunch_hidePreloader() {
156            var preloader = jQuery('.newscrunch-loader');
157            setTimeout(function() {
158                preloader.fadeOut(preloaderFadeOutTime);
159            }, 500);
160        }
161        newscrunch_hidePreloader();
162    });
163
164})(jQuery); 
165
166/* ---------------------------------------------- /*
167         * Sidebar Panel
168/* ---------------------------------------------- */
169function spncOpenPanel() {
170    document.getElementById("spnc_panelSidebar").style.transform = "translate3d(0,0,0)";
171    document.getElementById("spnc_panelSidebar").style.visibility = "visible";
172    document.getElementById("wrapper").style.marginLeft = "0px";
173    document.body.classList.add("spnc_body_sidepanel");
174    const panel_elm = document.getElementById('spnc_panelSidebar');
175    panel_elm.addEventListener('focusout', (event1) => {
176        if(panel_elm.contains(event1.relatedTarget)==false){
177            document.getElementById("spnc_panelSidebar").style.transform = "";
178            document.getElementById("spnc_panelSidebar").style.visibility = "hidden";
179            document.getElementById("wrapper").style.marginLeft = "0px";
180            document.body.classList.remove("spnc_body_sidepanel");
181        }
182    })
183}
184function spncClosePanel() {
185    document.getElementById("spnc_panelSidebar").style.transform = "";
186    document.getElementById("spnc_panelSidebar").style.visibility = "hidden";
187    document.getElementById("wrapper").style.marginLeft = "0px";
188    document.body.classList.remove("spnc_body_sidepanel");
189}
190
191
192jQuery(document).ready(function($) {
193     // When the window resizes
194    $(window).on('resize', function () {
195         // Get the height + padding + border of `#masthead`
196         var headerHeight = $('header').outerHeight();
197         var incrseHeight=  headerHeight-185;
198       //  Add the height to `.page-title-section`
199        $('.page-title-section').css('padding-top', incrseHeight+230);
200        $('.newscrunch-plus:not(.newsblogger) .page-title-section.breadcrumb-2').css('padding-top', incrseHeight+210);
201        $('.newsblogger .page-title-section').css('padding-top', 'unset');
202        $('.newscrunch-plus.newsblogger .page-title-section').css('padding-top', incrseHeight+230);
203        $('.newscrunch-plus.newsblogger .page-title-section.breadcrumb-2').css('padding-top', incrseHeight+210);
204        $('.newscrunch-plus section.bread-nt-2.disable').css('padding-top', incrseHeight+210);
205    });
206     // Trigger the function on document load.
207    $(window).trigger('resize');
208});
209
210
211/* ---------------------------------------------- /*
212         * open and close sidemenu in responsive
213/* ---------------------------------------------- */
214let MenucodeVisible = false;
215function openNav() {
216    MenucodeVisible= true;
217    updateMenuFocusVisibility();
218    var element = document.getElementById("spnc-menu-open");
219    element.classList.add("open");
220    jQuery('body').addClass('off-canvas');
221     const panel_elm1 = document.getElementById('spnc-menu-open');
222    panel_elm1.addEventListener('focusout', (event) => {
223        if(panel_elm1.contains(event.relatedTarget)==false){
224            panel_elm1.classList.remove("open");
225             jQuery('body').removeClass('off-canvas');
226            document.getElementsByClassName("spnc-menu-open")[0].focus();
227            MenucodeVisible= false;
228            updateMenuFocusVisibility();
229        }
230    })
231}
232function closeNav() {
233     MenucodeVisible=false;
234    updateMenuFocusVisibility();
235    var element = document.getElementById("spnc-menu-open");
236    element.classList.remove("open");
237    jQuery('body').removeClass('off-canvas');
238    document.getElementsByClassName("spnc-menu-open")[0].focus();
239}
240jQuery(".spnc-nav-menu-overlay").on('click', function () {
241    var element124 = document.getElementById("spnc-menu-open");
242    element124.classList.remove("open");
243    jQuery('body').removeClass('off-canvas');
244})
245function updateMenuFocusVisibility() {
246    if (MenucodeVisible) {
247        // Show focus
248       document.getElementById("spnc-menu-open").style.display = 'block';
249    } else {
250        // Hide focus
251        document.getElementById("spnc-menu-open").style.display = 'none';
252    }
253}
254updateMenuFocusVisibility();
255// open and close sidemenu

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.