PageSourceSearch

https://www.sportspedia.net/wp-content/themes/minimal-lite/assets/thememattic/js/script.js?ver=5.5.3

js sportspedia.net collected 2026-09-25 10:42:22 UTC 19,467 bytes, 508 lines download raw bytes

1(function (e) {
2    "use strict";
3    var n = window.MINIMAL_JS || {};
4    var iScrollPos = 0;
5    var grid;
6    /*Used for ajax loading posts*/
7    var loadType, loadButton, loader, pageNo, loading, morePost, scrollHandling;
8    
9    function minimal_lite_is_on_scrn(elem) {
10        // if the element doesn't exist, abort
11        if (elem.length == 0) {
12            return;
13        }
14        var tmtwindow = jQuery(window);
15        var viewport_top = tmtwindow.scrollTop();
16        var viewport_height = tmtwindow.height();
17        var viewport_bottom = viewport_top + viewport_height;
18        var tmtelem = jQuery(elem);
19        var top = tmtelem.offset().top;
20        var height = tmtelem.height();
21        var bottom = top + height;
22        return (top >= viewport_top && top < viewport_bottom) ||
23            (bottom > viewport_top && bottom <= viewport_bottom) ||
24            (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom);
25    }
26
27    n.stickyMenu = function () {
28        if (e(window).scrollTop() > 350) {
29            e("body").addClass("nav-affix");
30        } else {
31            e("body").removeClass("nav-affix");
32        }
33    };
34    n.mobileMenu = {
35        init: function () {
36            this.toggleMenu();
37            this.menuMobile();
38            this.menuArrow();
39        },
40        toggleMenu: function () {
41            e('#thememattic-header').on('click', '.toggle-menu', function (event) {
42                var ethis = e('.main-navigation .menu .menu-mobile');
43                if (ethis.css('display') == 'block') {
44                    ethis.slideUp('300');
45                    e("#thememattic-header").removeClass('mmenu-active');
46                } else {
47                    ethis.slideDown('300');
48                    e("#thememattic-header").addClass('mmenu-active');
49                }
50                e('.ham').toggleClass('exit');
51            });
52            e('#thememattic-header').on('keypress',function(event) {
53                var ethis = e('.main-navigation .menu .menu-mobile');
54                if (ethis.css('display') == 'block') {
55                    ethis.slideUp('300');
56                    e("#thememattic-header").removeClass('mmenu-active');
57                } else {
58                    ethis.slideDown('300');
59                    e("#thememattic-header").addClass('mmenu-active');
60                }
61                e('.ham').toggleClass('exit');
62            });
63            e('#thememattic-header .main-navigation ').on('click', '.menu-mobile a i', function (event) {
64                event.preventDefault();
65                var ethis = e(this),
66                    eparent = ethis.closest('li'),
67                    esub_menu = eparent.find('> .sub-menu');
68                if (esub_menu.css('display') == 'none') {
69                    esub_menu.slideDown('300');
70                    ethis.addClass('active');
71                } else {
72                    esub_menu.slideUp('300');
73                    ethis.removeClass('active');
74                }
75                return false;
76            });
77        },
78        menuMobile: function () {
79            if (e('.main-navigation .menu > ul').length) {
80                var ethis = e('.main-navigation .menu > ul'),
81                    eparent = ethis.closest('.main-navigation'),
82                    pointbreak = eparent.data('epointbreak'),
83                    window_width = window.innerWidth;
84                if (typeof pointbreak == 'undefined') {
85                    pointbreak = 991;
86                }
87                if (pointbreak >= window_width) {
88                    ethis.addClass('menu-mobile').removeClass('menu-desktop');
89                    e('.main-navigation .toggle-menu').css('display', 'inline-block');
90                } else {
91                    ethis.addClass('menu-desktop').removeClass('menu-mobile').css('display', '');
92                    e('.main-navigation .toggle-menu').css('display', '');
93                }
94            }
95        },
96        menuArrow: function () {
97            if (e('#thememattic-header .main-navigation div.menu > ul').length) {
98                e('#thememattic-header .main-navigation div.menu > ul .sub-menu').parent('li').find('> a').append('<i class="ion-ios-arrow-down">');
99            }
100        }
101    };
102    n.TmtSearch = function () {
103        e('.icon-search').on('click', function (event) {
104            e('body').toggleClass('reveal-search');
105            e('body').addClass('body-scroll-locked');
106            e('html').attr('style','overflow-y: scroll; position: fixed; width: 100%; left: 0px; top: 0px;');
107            setTimeout(function () {
108                e('.close-popup').focus();
109            }, 300);
110            
111        });
112        e('.close-popup').on('click', function (event) {
113            e('body').removeClass('reveal-search');
114            e('body').removeClass('body-scroll-locked');
115            e('html').removeAttr('style');
116            setTimeout(function () {
117                e('.icon-search').focus();
118            }, 300);
119        });
120
121        e(document).keyup(function(j) {
122
123            if( e('body').hasClass('reveal-search') ){
124
125                if (j.key === "Escape") { // escape key maps to keycode `27`
126
127                    e('body').removeClass('reveal-search');
128                    e('body').removeClass('body-scroll-locked');
129                    e('html').removeAttr('style');
130                    setTimeout(function () {
131                        e('.icon-search').focus();
132                    }, 300);
133
134                }
135
136            }
137
138        });
139
140        e( '.search-active-focus' ).on( 'focus', function() {
141            if ( e( 'body' ).hasClass( 'reveal-search' ) ) {
142
143                e('.close-popup').focus();
144            }
145        } );
146    };
147    n.TmtPreloader = function () {
148        e(window).load(function () {
149            e("body").addClass("page-loaded");
150        });
151    };
152    n.OffcanvasNav = function () {
153        e('#push-trigger').sidr({
154            name: 'offcanvas-panel',
155            side: 'right'
156        });
157        e('.sidr-class-sidr-button-close').click(function () {
158
159            if( e('body').hasClass('offcanvas-panel-open') ){
160                e('html').attr('style','');
161            }
162            e.sidr('close', 'offcanvas-panel');
163        });
164
165        e('#push-trigger').click(function(){
166            
167            e('html').attr('style','overflow-y: scroll; position: fixed; width: 100%; left: 0px; top: 0px;');
168
169            setTimeout(function () {
170                e('.sidr-class-sidr-button-close').focus();
171            }, 300);
172
173        });
174
175        e(document).keyup(function(j) {
176
177            if( e('body').hasClass('offcanvas-panel-open') ){
178
179                if (j.key === "Escape") { // escape key maps to keycode `27`
180
181                    e('html').attr('style','');
182                    e.sidr('close', 'offcanvas-panel');
183                    setTimeout(function () {
184                        e('#push-trigger').focus();
185                    }, 300);
186                }
187
188            }
189
190        });
191
192        e( 'input, a, button' ).on( 'focus', function() {
193            if ( e( 'body' ).hasClass( 'offcanvas-panel-open' ) ) {
194
195                if ( ! e( this ).parents( '#offcanvas-panel' ).length ) {
196                    e('.sidr-class-sidr-button-close').focus();
197                }
198            }
199        } );
200
201    };
202    n.TmtSlider = function () {
203        var slider_loop = true;
204        if (!minimalLiteVal.enable_slider_loop) {
205            slider_loop = false;
206        }
207        e(".banner-slider").slick({
208            slidesToShow: 1,
209            slidesToScroll: 1,
210            fade: true,
211            autoplay: true,
212            autoplaySpeed: 8000,
213            infinite: slider_loop,
214            dots: true,
215            arrows: false,
216            speed: 500,
217            centerMode: false,
218            draggable: true,
219            touchThreshold: 20,
220            cssEase: 'cubic-bezier(0.28, 0.12, 0.22, 1)'
221        });
222
223        e(".gallery-columns-1, ul.wp-block-gallery.columns-1, .wp-block-gallery.columns-1 .blocks-gallery-grid").each(function () {
224            e(this).slick({
225                slidesToShow: 1,
226                slidesToScroll: 1,
227                fade: true,
228                autoplay: true,
229                autoplaySpeed: 8000,
230                infinite: true,
231                dots: false,
232                nextArrow: '<i class="navcontrol-icon slide-next ion-ios-arrow-right"></i>',
233                prevArrow: '<i class="navcontrol-icon slide-prev ion-ios-arrow-left"></i>'
234            });
235        });
236    };
237    n.SingleColGallery = function (gal_selector) {
238        if (e.isArray(gal_selector)) {
239            e.each(gal_selector, function (index, value) {
240                e("#" + value).find('.gallery-columns-1, ul.wp-block-gallery.columns-1, .wp-block-gallery.columns-1 .blocks-gallery-grid').slick({
241                    slidesToShow: 1,
242                    slidesToScroll: 1,
243                    dots: false,
244                    infinite: false,
245                    nextArrow: '<i class="navcontrol-icon slide-next ion-ios-arrow-right"></i>',
246                    prevArrow: '<i class="navcontrol-icon slide-prev ion-ios-arrow-left"></i>'
247                });
248            });
249        } else {
250            e("." + gal_selector).slick({
251                slidesToShow: 1,
252                slidesToScroll: 1,
253                dots: false,
254                infinite: false,
255                nextArrow: '<i class="navcontrol-icon slide-next ion-ios-arrow-right"></i>',
256                prevArrow: '<i class="navcontrol-icon slide-prev ion-ios-arrow-left"></i>'
257            });
258        }
259    };
260    n.MagnificPopup = function () {
261        e('.gallery, .wp-block-gallery').each(function () {
262            e(this).magnificPopup({
263                delegate: 'a',
264                type: 'image',
265                gallery: {
266                    enabled: true
267                },
268                zoom: {
269                    enabled: true,
270                    duration: 300,
271                    opener: function (element) {
272                        return element.find('img');
273                    }
274                }
275            });
276        });
277    };
278    n.DataBackground = function () {
279        var pageSection = e(".data-bg");
280        pageSection.each(function (indx) {
281            if (e(this).attr("data-background")) {
282                e(this).css("background-image", "url(" + e(this).data("background") + ")");
283            }
284        });
285        e('.bg-image').each(function () {
286            var src = e(this).children('img').attr('src');
287            e(this).css('background-image', 'url(' + src + ')');
288        });
289    };
290    n.show_hide_scroll_top = function () {
291        if (e(window).scrollTop() > e(window).height() / 2) {
292            e("#scroll-up").fadeIn(300);
293        } else {
294            e("#scroll-up").fadeOut(300);
295        }
296    };
297    n.scroll_up = function () {
298        e("#scroll-up").on("click", function () {
299            e("html, body").animate({
300                scrollTop: 0
301            }, 800);
302            return false;
303        });
304    };
305    n.ms_masonry = function () {
306        if (e('.masonry-grid').length > 0) {
307            /*Default masonry animation*/
308            var hidden = 'scale(0.5)';
309            var visible = 'scale(1)';
310            /**/
311            /*Get masonry animation*/
312            if (minimalLiteVal.masonry_animation === 'none') {
313                hidden = 'translateY(0)';
314                visible = 'translateY(0)';
315            }
316            if (minimalLiteVal.masonry_animation === 'slide-up') {
317                hidden = 'translateY(50px)';
318                visible = 'translateY(0)';
319            }
320            if (minimalLiteVal.masonry_animation === 'slide-down') {
321                hidden = 'translateY(-50px)';
322                visible = 'translateY(0)';
323            }
324            if (minimalLiteVal.masonry_animation === 'zoom-out') {
325                hidden = 'translateY(-20px) scale(1.25)';
326                visible = 'translateY(0) scale(1)';
327            }
328            /**/
329            grid = e('.masonry-grid').imagesLoaded(function () {
330                //e('.masonry-grid article').fadeIn();
331                grid.masonry({
332                    itemSelector: 'article',
333                    hiddenStyle: {
334                        transform: hidden,
335                        opacity: 0
336                    },
337                    visibleStyle: {
338                        transform: visible,
339                        opacity: 1
340                    }
341                });
342            });
343        }
344    };
345    n.thememattic_matchheight = function () {
346        e('.widget-area').theiaStickySidebar({
347            additionalMarginTop: 30
348        });
349    };
350    n.thememattic_reveal = function () {
351        e('#thememattic-reveal').on('click', function (event) {
352            e('body').toggleClass('reveal-box');
353        });
354        e('.close-popup').on('click', function (event) {
355            e('body').removeClass('reveal-box');
356        });
357    };
358    n.setLoadPostDefaults = function () {
359        if (e('.load-more-posts').length > 0) {
360            loadButton = e('.load-more-posts');
361            loader = e('.load-more-posts .ajax-loader');
362            loadType = loadButton.attr('data-load-type');
363            pageNo = 2;
364            loading = false;
365            morePost = true;
366            scrollHandling = {
367                allow: true,
368                reallow: function () {
369                    scrollHandling.allow = true;
370                },
371                delay: 400
372            };
373        }
374    };
375    n.fetchPostsOnScroll = function () {
376
377        e(window).scroll(function () {
378            if ( !e('.load-more-posts').hasClass('tmt-no-post') && !e('.load-more-posts').hasClass('tmt-post-loding') && e('.load-more-posts').hasClass('scroll') && minimal_lite_is_on_scrn('.load-more-posts')) {
379
380                e('.load-more-posts').addClass('tmt-post-loding');
381                n.ShowPostsAjax();
382
383            }
384        });
385    };
386    n.fetchPostsOnClick = function () {
387        if (e('.load-more-posts').length > 0 && 'click' === loadType) {
388            e('.load-more-posts a').on('click', function (event) {
389                event.preventDefault();
390                n.ShowPostsAjax();
391            });
392        }
393    };
394    n.ShowPostsAjax = function () {
395        e.ajax({
396            type: 'GET',
397            url: minimalLiteVal.ajaxurl,
398            data: {
399                action: 'minimal_lite_load_more',
400                nonce: minimalLiteVal.nonce,
401                page: pageNo,
402                post_type: minimalLiteVal.post_type,
403                search: minimalLiteVal.search,
404                cat: minimalLiteVal.cat,
405                taxonomy: minimalLiteVal.taxonomy,
406                author: minimalLiteVal.author,
407                year: minimalLiteVal.year,
408                month: minimalLiteVal.month,
409                day: minimalLiteVal.day
410            },
411            dataType: 'json',
412            beforeSend: function () {
413                loader.addClass('ajax-loader-enabled');
414            },
415            success: function (response) {
416                e('.load-more-posts').removeClass('tmt-post-loding');
417                if (response.success) {
418                    var gallery = false;
419                    var gal_selectors = [];
420                    var content_join = response.data.content.join('');
421                    if (content_join.indexOf("gallery-columns-1") >= 0 ||
422                        content_join.indexOf("wp-block-gallery") >= 0 ||
423                        content_join.indexOf("blocks-gallery-grid") >= 0) {
424
425                        gallery = true;
426                        /*Push the post ids having galleries so that new gallery instance can be created*/
427                        e(content_join).find('.entry-gallery').each(function () {
428                            gal_selectors.push(e(this).closest('article').attr('id'));
429                        });
430                    }
431                    if (e('.masonry-grid').length > 0) {
432                        var content = e(content_join);
433                        content.hide();
434                        grid = e('.masonry-grid');
435                        grid.append(content);
436                        grid.imagesLoaded(function () {
437                            content.show();
438                            /*Init new Gallery*/
439                            if (true === gallery) {
440                                n.SingleColGallery(gal_selectors);
441                            }
442                            
443                            var winwidth = e(window).width();
444                            e(window).resize(function() {
445                                winwidth = e(window).width();
446                            });
447
448                            if( winwidth > 990 ){
449                                grid.masonry('appended', content).masonry();
450                            }else{
451                                grid.masonry('appended', content);
452                            }
453
454                            loader.removeClass('ajax-loader-enabled');
455                        });
456                    } else {
457                        e('.minimal-lite-posts-lists').append(response.data.content);
458                        /*Init new Gallery*/
459                        if (true === gallery) {
460                            n.SingleColGallery(gal_selectors);
461                        }
462                        /**/
463                        loader.removeClass('ajax-loader-enabled');
464                    }
465                    pageNo++;
466                    loading = false;
467                    if (!response.data.more_post) {
468                        morePost = false;
469                        loadButton.fadeOut();
470                    }
471                    /*For audio and video to work properly after ajax load*/
472                    e('video, audio').mediaelementplayer({alwaysShowControls: true});
473                    /**/
474                    /*For Gallery to work*/
475                    n.MagnificPopup();
476                    /**/
477                    loader.removeClass('ajax-loader-enabled');
478                } else {
479                    e('.load-more-posts').addClass('tmt-no-post');
480                    loadButton.fadeOut();
481                }
482            }
483        });
484    };
485    e(document).ready(function () {
486        n.mobileMenu.init();
487        n.TmtSearch();
488        n.TmtPreloader();
489        n.OffcanvasNav();
490        n.TmtSlider();
491        n.MagnificPopup();
492        n.DataBackground();
493        n.scroll_up();
494        n.thememattic_reveal();
495        n.thememattic_matchheight();
496        n.ms_masonry();
497        n.setLoadPostDefaults();
498        n.fetchPostsOnClick();
499    });
500    e(window).scroll(function () {
501        n.stickyMenu();
502        n.show_hide_scroll_top();
503        n.fetchPostsOnScroll();
504    });
505    e(window).resize(function () {
506        n.mobileMenu.menuMobile();
507    });
508})(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.