PageSourceSearch

https://allyourbase.net/wp-content/themes/online-blog/js/custom-script.js?ver=1.1.6

js allyourbase.net collected 2026-10-05 19:07:28 UTC 16,019 bytes, 448 lines download raw bytes

1(function (e) {
2    "use strict";
3    var n = window.Thememattic_JS || {};
4    var loadType, loadButton, loader, pageNo, loading, morePost, scrollHandling;
5
6    function online_blog_is_on_scrn(elem) {
7        // if the element doesn't exist, abort
8        if (elem.length == 0) {
9            return;
10        }
11        var tmtwindow = e(window);
12        var viewport_top = tmtwindow.scrollTop();
13        var viewport_height = tmtwindow.height();
14        var viewport_bottom = viewport_top + viewport_height;
15        var tmtelem = e(elem);
16        var top = tmtelem.offset().top;
17        var height = tmtelem.height();
18        var bottom = top + height;
19        return (top >= viewport_top && top < viewport_bottom) ||
20            (bottom > viewport_top && bottom <= viewport_bottom) ||
21            (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom);
22    }
23
24    n.mobileMenu = {
25        init: function () {
26            this.toggleMenu();
27            this.menuMobile();
28            this.menuArrow();
29            this.offcanvasNav();
30            this.submenuHover();
31        },
32        toggleMenu: function () {
33            e('#masthead').on('click', '.toggle-menu', function (event) {
34                var ethis = e('.main-navigation .menu .menu-mobile');
35                if (ethis.css('display') == 'block') {
36                    ethis.slideUp('300');
37                } else {
38                    ethis.slideDown('300');
39                }
40                e('.ham').toggleClass('exit');
41            });
42            e('#masthead').on('keypress',function(event) {
43                var ethis = e('.main-navigation .menu .menu-mobile');
44                if (ethis.css('display') == 'block') {
45                    ethis.slideUp('300');
46                } else {
47                    ethis.slideDown('300');
48                }
49                e('.ham').toggleClass('exit');
50            });
51            e('#masthead .main-navigation ').on('click', '.menu-mobile a i', function (event) {
52                event.preventDefault();
53                var ethis = e(this),
54                    eparent = ethis.closest('li'),
55                    esub_menu = eparent.find('> .sub-menu');
56                if (esub_menu.css('display') == 'none') {
57                    esub_menu.slideDown('300');
58                    ethis.addClass('active');
59                } else {
60                    esub_menu.slideUp('300');
61                    ethis.removeClass('active');
62                }
63                return false;
64            });
65        },
66        menuMobile: function () {
67            if (e('.main-navigation .menu > ul').length) {
68                var ethis = e('.main-navigation .menu > ul'),
69                    eparent = ethis.closest('.main-navigation'),
70                    pointbreak = eparent.data('epointbreak'),
71                    window_width = window.innerWidth;
72                if (typeof pointbreak == 'undefined') {
73                    pointbreak = 991;
74                }
75                if (pointbreak >= window_width) {
76                    ethis.addClass('menu-mobile').removeClass('menu-desktop');
77                    e('.main-navigation .toggle-menu').css('display', 'block');
78                } else {
79                    ethis.addClass('menu-desktop').removeClass('menu-mobile').css('display', '');
80                    e('.main-navigation .toggle-menu').css('display', '');
81                }
82            }
83        },
84        menuArrow: function () {
85            if (e('#masthead .main-navigation div.menu > ul').length) {
86                e('#masthead .main-navigation div.menu > ul .sub-menu').parent('li').find('> a').append('<i class="icon-arrow-down icons">');
87            }
88        },
89        offcanvasNav: function () {
90            if (e("body").hasClass("rtl")) {
91                e('#widgets-nav').sidr({
92                    name: 'sidr-nav',
93                    side: 'right'
94                });
95            } else {
96                e('#widgets-nav').sidr({
97                    name: 'sidr-nav',
98                    side: 'left'
99                });
100            }
101            e('.sidr-class-sidr-button-close').click(function () {
102                e.sidr('close', 'sidr-nav');
103                e('html').attr('style','');
104                setTimeout(function(){
105                    e('a#widgets-nav').focus();
106                },300);
107            });
108
109            e('#widgets-nav').click(function(){
110                e('html').attr('style','margin: 0; height: 100%; overflow: hidden');
111                setTimeout(function(){
112                    e('a.sidr-class-sidr-button-close').focus();
113                },300);
114                
115            });
116
117            e( 'input, a, button' ).on( 'focus', function() {
118                if ( e( 'body' ).hasClass( 'sidr-nav-open' ) ) {
119
120                    if ( ! e( this ).parents( '#sidr-nav' ).length ) {
121                        e('a.sidr-class-sidr-button-close').focus();
122                    }
123                }
124            } );
125
126            // Action On Esc Button
127            e(document).keyup(function(j) {
128                if (j.key === "Escape") { // escape key maps to keycode `27`
129                    e.sidr('close', 'sidr-nav');
130                    e('html').attr('style','');
131
132                    if ( e( 'body' ).hasClass( 'sidr-nav-open' ) ) {
133                        setTimeout(function(){
134                            e('a#widgets-nav').focus();
135                        },300);
136
137                    }
138
139                }
140            });
141        },
142        submenuHover: function () {
143            e('.site-header .main-navigation li.mega-menu .sub-cat-list li').on('hover', function () {
144                if (!e(this).hasClass('current')) {
145                    var eposts = e(this).parents('.sub-cat-list').first().siblings('.sub-cat-posts').first();
146                    e(this).siblings('.current').removeClass('current').end().addClass('current');
147                    eposts.children('.current').removeClass('current');
148                    eposts.children('.' + e(this).attr('data-id')).addClass('current');
149                }
150            });
151        }
152    };
153    n.DataBackground = function () {
154        var pageSection = e(".data-bg");
155        pageSection.each(function (indx) {
156            if (e(this).attr("data-background")) {
157                e(this).css("background-image", "url(" + e(this).data("background") + ")");
158            }
159        });
160        e('.bg-image').each(function () {
161            var src = e(this).children('img').attr('src');
162            e(this).css('background-image', 'url(' + src + ')').children('img').hide();
163        });
164    };
165    n.SlickCarousel = function () {
166        e(".main-slider-1").slick({
167            slidesToShow: 1,
168            slidesToScroll: 1,
169            fade: true,
170            autoplay: true,
171            autoplaySpeed: 8000,
172            infinite: true,
173            dots: true,
174            nextArrow: '<i class="slide-icon slide-next icon-arrow-right icons"></i>',
175            prevArrow: '<i class="slide-icon slide-prev icon-arrow-left icons"></i>',
176            responsive: [
177                {
178                    breakpoint: 767,
179                    settings: {
180                        arrows: false
181                    }
182                }
183            ]
184        });
185        e(".main-slider-2").slick({
186            slidesToShow: 3,
187            slidesToScroll: 1,
188            centerMode: true,
189            centerPadding: '55px',
190            autoplay: true,
191            autoplaySpeed: 12000,
192            infinite: true,
193            nextArrow: '<i class="slide-icon slide-next icon-arrow-right icons"></i>',
194            prevArrow: '<i class="slide-icon slide-prev icon-arrow-left icons"></i>',
195            responsive: [
196                {
197                    breakpoint: 1024,
198                    settings: {
199                        slidesToShow: 2,
200                        centerMode: false
201                    }
202                },
203                {
204                    breakpoint: 767,
205                    settings: {
206                        slidesToShow: 1,
207                        arrows: false,
208                        centerMode: false
209                    }
210                }
211            ]
212        });
213        e(".gallery-columns-1, ul.wp-block-gallery.columns-1, .wp-block-gallery.columns-1 .blocks-gallery-grid").each(function () {
214            e(this).slick({
215                slidesToShow: 1,
216                slidesToScroll: 1,
217                fade: true,
218                autoplay: true,
219                autoplaySpeed: 8000,
220                infinite: true,
221                dots: false,
222                nextArrow: '<i class="slide-icon slide-next icon-arrow-right icons"></i>',
223                prevArrow: '<i class="slide-icon slide-prev icon-arrow-left icons"></i>',
224            });
225        });
226    };
227    n.Thememattic_preloader = function () {
228
229            e("body").addClass("page-loaded");
230
231    };
232    n.Thememattic_slideheight = function () {
233        e('.main-slider-2 .slick-slide').matchHeight({
234            byRow: true,
235            property: 'min-height',
236        });
237    };
238    n.ThemematticReveal = function () {
239        e('.icon-search').on('click', function (event) {
240            e('body').toggleClass('reveal-search');
241            e('body').addClass('body-scroll-locked');
242            e('html').attr('style','overflow-y: scroll; position: fixed; width: 100%; left: 0px; top: 0px;');
243            setTimeout(function () {
244                e('.close-popup').focus();
245            }, 300);
246            
247        });
248        e('.close-popup').on('click', function (event) {
249            e('body').removeClass('reveal-search');
250            e('body').removeClass('body-scroll-locked');
251            e('html').removeAttr('style');
252            setTimeout(function () {
253                e('.icon-search').focus();
254            }, 300);
255        });
256
257        e(document).keyup(function(j) {
258
259            if( e('body').hasClass('reveal-search') ){
260
261                if (j.key === "Escape") { // escape key maps to keycode `27`
262
263                    e('body').removeClass('reveal-search');
264                    e('body').removeClass('body-scroll-locked');
265                    e('html').removeAttr('style');
266                    setTimeout(function () {
267                        e('.icon-search').focus();
268                    }, 300);
269
270                }
271
272            }
273
274        });
275
276        e( '.search-active-focus' ).on( 'focus', function() {
277            if ( e( 'body' ).hasClass( 'reveal-search' ) ) {
278
279                e('.close-popup').focus();
280            }
281        } );
282    };
283    n.Thememattic_wow = function () {
284        if (e('.wow').length) {
285            var wow = new WOW(
286                {
287                    animateClass: 'animated',
288                    offset: 0,
289                }
290            );
291            wow.init();
292        }
293    };
294    n.MagnificPopup = function () {
295        e('.gallery, .wp-block-gallery').each(function () {
296            e(this).magnificPopup({
297                delegate: 'a',
298                type: 'image',
299                closeOnContentClick: false,
300                closeBtnInside: false,
301                mainClass: 'mfp-with-zoom mfp-img-mobile',
302                image: {
303                    verticalFit: true,
304                    titleSrc: function (item) {
305                        return item.el.attr('title');
306                    }
307                },
308                gallery: {
309                    enabled: true
310                },
311                zoom: {
312                    enabled: true,
313                    duration: 300,
314                    opener: function (element) {
315                        return element.find('img');
316                    }
317                }
318            });
319        });
320    };
321    n.show_hide_scroll_top = function () {
322        if (e(window).scrollTop() > e(window).height() / 2) {
323            e("#scroll-up").fadeIn(300);
324        } else {
325            e("#scroll-up").fadeOut(300);
326        }
327    };
328    n.scroll_up = function () {
329        e("#scroll-up").on("click", function () {
330            e("html, body").animate({
331                scrollTop: 0
332            }, 800);
333            return false;
334        });
335    };
336    n.thememattic_matchheight = function () {
337        e('.widget-area').theiaStickySidebar({
338            additionalMarginTop: 30
339        });
340    };
341    n.nav_tab = function () {
342        e('.tab-trigger').on('click', function () {
343            e([e(this).parent()[0], e(e(this).data('href'))[0]]).addClass('active').siblings('.active').removeClass('active');
344        });
345    };
346    n.setLoadPostDefaults = function () {
347        if (e('.load-more-posts').length > 0) {
348            loadButton = e('.load-more-posts');
349            loader = e('.load-more-posts .ajax-loader');
350            loadType = loadButton.attr('data-load-type');
351            pageNo = 2;
352            loading = false;
353            morePost = true;
354            scrollHandling = {
355                allow: true,
356                reallow: function () {
357                    scrollHandling.allow = true;
358                },
359                delay: 400
360            };
361        }
362    };
363    n.fetchPostsOnScroll = function () {
364        n.fetchPostsOnScroll = function () {
365        e(window).scroll(function () {
366            if ( !e('.load-more-posts').hasClass('tmt-no-post') && !e('.load-more-posts').hasClass('tmt-post-loding') && e('.load-more-posts').hasClass('scroll') && online_blog_is_on_scrn('.load-more-posts')) {
367
368                e('.load-more-posts').addClass('tmt-post-loding');
369                n.ShowPostsAjax();
370
371            }
372        });
373    };
374    };
375    n.fetchPostsOnClick = function () {
376        if (e('.load-more-posts').length > 0 && 'click' === loadType) {
377            e('.load-more-posts a').on('click', function (event) {
378                event.preventDefault();
379                n.ShowPostsAjax(loadType);
380            });
381        }
382    };
383    n.ShowPostsAjax = function (loadType) {
384        e.ajax({
385            type: 'GET',
386            url: onlineVal.ajaxurl,
387            data: {
388                action: 'online_blog_load_more',
389                nonce: onlineVal.nonce,
390                page: pageNo,
391                post_type: onlineVal.post_type,
392                search: onlineVal.search,
393                cat: onlineVal.cat,
394                taxonomy: onlineVal.taxonomy,
395                author: onlineVal.author,
396                year: onlineVal.year,
397                month: onlineVal.month,
398                day: onlineVal.day
399            },
400            dataType: 'json',
401            beforeSend: function () {
402                loader.addClass('ajax-loader-enabled');
403            },
404            success: function (response) {
405                e('.load-more-posts').removeClass('tmt-post-loding');
406                loader.removeClass('ajax-loader-enabled');
407                if (response.success) {
408                    e('.online-posts-lists').append(response.data.content);
409                    pageNo++;
410                    loading = false;
411                    if (!response.data.more_post) {
412                        morePost = false;
413                        loadButton.fadeOut();
414                    }
415                } else {
416                    e('.load-more-posts').addClass('tmt-no-post');
417                    loadButton.fadeOut();
418                }
419            }
420        });
421    };
422	
423	e(window).load(function () {
424	    n.Thememattic_preloader();
425	 });	
426	 
427    e(document).ready(function () {
428        n.mobileMenu.init();
429        n.DataBackground();
430        n.SlickCarousel();
431        n.Thememattic_slideheight();
432        n.ThemematticReveal();
433        n.Thememattic_wow();
434        n.MagnificPopup();
435        n.scroll_up();
436        n.thememattic_matchheight();
437        n.nav_tab();
438        n.setLoadPostDefaults();
439        n.fetchPostsOnClick();
440    });
441    e(window).scroll(function () {
442        n.show_hide_scroll_top();
443        n.fetchPostsOnScroll();
444    });
445    e(window).resize(function () {
446        n.mobileMenu.menuMobile();
447    });
448})(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.