PageSourceSearch

https://parlo-italiano.cz/wp-content/themes/edukul/assets/js/main.js?ver=1.0.0

js parlo-italiano.cz collected 2026-10-08 03:52:41 UTC 12,574 bytes, 387 lines download raw bytes

1;(function($) {
2    'use strict';
3
4    // Mega Menu
5    var megaMenu = function() {
6        $(window).on('load resize', function() {
7            var 
8            du = $('#main-nav .megamenu > ul'),
9            siteNav = $('#main-nav'),
10            siteHeader = $( '#site-header' );
11
12            if ( du.length ) {
13                var
14                o = siteHeader.find(".edukul-container").outerWidth(),
15                a = siteNav.outerWidth(),
16                n = siteNav.css("right"),
17                n = parseInt(n,10),
18                d = o-a-n; 
19                if ( $('.site-navigation-wrap').length ) d = 0;
20                du.css({ width: o, "margin-left": -d })
21            }
22        });
23    };
24
25    // PreLoader
26    var preLoader = function() {
27        if ( $().animsition ) {
28            $('.animsition').animsition({
29                inClass: 'fade-in',
30                outClass: 'fade-out',
31                inDuration: 1500,
32                outDuration: 800,
33                loading: true,
34                loadingParentElement: 'body',
35                loadingClass: 'animsition-loading',
36                timeout: false,
37                timeoutCountdown: 5000,
38                onLoadEvent: true,
39                browser: [
40                    '-webkit-animation-duration',
41                    '-moz-animation-duration',
42                    'animation-duration'
43                    ],
44                overlay: false,
45                overlayClass: 'animsition-overlay-slide',
46                overlayParentElement: 'body',
47                transition: function(url){ window.location.href = url; }
48            });
49        }
50    };
51
52    // Menu Search Icon
53    var searchIcon = function() {
54        var search_wrap = $('.search-style-fullscreen');
55        var search_trigger = $('.header-search-trigger');
56        var search_field = search_wrap.find('.search-field');
57
58        search_trigger.on('click', function(e) {
59            if ( ! search_wrap.hasClass('search-opened') ) {
60                search_wrap.addClass('search-opened');
61                search_field.get(0).focus();
62
63            } else if (search_field.val() == '') {
64                if ( search_wrap.hasClass('search-opened') )
65                    search_wrap.removeClass('search-opened');
66                else search_field.get(0).focus();
67
68            } else {
69                 search_wrap.find('form').get(0).submit();
70            }
71
72            $('html').addClass( 'disable-scroll' );
73            e.preventDefault();
74            return false;
75        });
76
77        search_wrap.find('.search-close').on('click', function(e) {
78            search_wrap.removeClass('search-opened');
79            $('html').removeClass( 'disable-scroll' );
80            e.preventDefault();
81            return false;
82        });
83    };
84
85    // Mobile Navigation
86    var mobileNav = function() {
87
88        var menuType = 'desktop';
89
90        $(window).on('load resize', function() {
91            var
92            mode = 'desktop',
93            wrapMenu = $('#site-header-inner .wrap-inner'),
94            navExtw = $('.nav-extend'),
95            navExt = $('.nav-extend').children('.ext').filter(':not(".menu-logo")'),
96            navLogo = $('.nav-extend').children('.menu-logo');
97
98            if ( matchMedia( 'only screen and (max-width: 991px)' ).matches )
99                mode = 'mobile';
100
101            if ( mode != menuType ) {
102                menuType = mode;
103
104                if ( mode == 'mobile' ) {
105
106                    if ( $('#main-nav').length ) {
107                        $('.mobile-button').show();
108
109                        var mobiMenu = $('#main-nav').attr('id', 'main-nav-mobi').appendTo('body').children('.menu');
110                            
111                        if ( navLogo.length != 0 ) mobiMenu.prepend(navLogo);
112
113                        if ( navExt.length != 0 ) mobiMenu.append(navExt);
114
115                        mobiMenu.find('li:has(ul)').children('ul').removeAttr('style').hide().before('<span class="arrow"></span>');
116                    }
117
118                } else {
119                    $('.mobile-button').removeClass('hide');
120                    $('html').removeClass( 'disable-scroll' );
121                    $( '.mobi-overlay' ).removeClass('show');
122                    $('.mobile-button').hide();
123
124                    var mainMenuList = $('#main-nav-mobi').attr('id', 'main-nav').removeAttr('style').appendTo(wrapMenu).children('.menu');
125
126                    if ( mainMenuList.find('.ext').length != 0 )
127                        mainMenuList.find('.ext').appendTo(navExtw);
128
129                    mainMenuList.find('.sub-menu').removeAttr('style').prev().remove();
130                }
131            }
132        });
133
134        // Close mobi-menu when clicking on overlay
135        $('.mobi-overlay').on('click', function() {
136            $('.mobile-button').removeClass('hide');
137            $(this).removeClass('show');
138            $("#main-nav-mobi").animate({ left: "-300px" }, 300, 'easeInOutExpo');
139            $('html').removeClass( 'disable-scroll' );
140        } );
141
142        // Show mobi-menu when clicking on mobi-button
143        $(document).on('click', '.mobile-button', function() {
144            $('.mobile-button').addClass('hide');
145            $( '.mobi-overlay' ).addClass('show');
146            $("#main-nav-mobi").animate({ left: "0"}, 300, 'easeInOutExpo');
147            $('html').addClass( 'disable-scroll' );
148        })
149
150        $(document).on('click', '#main-nav-mobi .arrow', function() {
151            $(this).toggleClass('active').next().stop().slideToggle();
152        })
153    };
154
155    // Fix Navigation
156    var fixNav = function() {
157        var
158        nav = $('#main-nav'),
159        wNav = $('.widget_nav_menu'),
160        docW = $(window).width(),
161        c = $('#site-header-inner'),
162        cl = c.offset().left,
163        cw = c.width();
164
165        if ( nav )
166            nav.find('.sub-menu').each(function() {
167            var
168            off = $(this).offset(),
169            l = off.left,
170            w = $(this).width(),
171            il = l - cl,
172            over = ( il + w >= cw );
173
174            if ( over )
175                $(this).addClass('left');
176
177            })
178
179        if ( wNav.length != 0 )
180            wNav.find('a:empty')
181                .closest('li').remove();
182    };
183
184    // One Page
185    var onePage = function() {
186        $('#menu-one-page li').filter(':first').addClass('current-menu-item');
187
188        $('#menu-one-page li a').on('click',function() {
189            var anchor = $(this).attr('href').split('#')[1];
190
191            if ( anchor ) {
192                if ( $('#'+anchor).length > 0 ) {
193                    var headerHeight = 0;
194
195                    if ( $('body').hasClass('header-fixed') )
196                        headerHeight = $('#site-header').height();
197
198                    var target = $('#' + anchor).offset().top - headerHeight;
199
200                    $('html,body').animate({scrollTop: target}, 1000, 'easeInOutExpo');
201               }
202            }
203            return false;
204        });
205
206        $(window).on("scroll", function() {
207
208            var mode = 'desktop';
209
210            if ( matchMedia( 'only screen and (max-width: 991px)' ).matches )
211                mode = 'mobile';
212
213            if ( mode == 'desktop' ) {
214
215                var scrollPos = $(window).scrollTop();
216
217                $('#menu-one-page li a').each(function () {
218                    var link = $(this);
219                    var block = $( link.attr("href") );
220                    if ( block.offset().top <= scrollPos 
221                        && block.offset().top + block.height() > scrollPos ) {
222                        $('#menu-one-page li').removeClass("current-menu-item");
223                        link.parent().addClass("current-menu-item");
224                    } else {
225                        link.parent().removeClass("current-menu-item");
226                    }
227                });
228            }
229        });
230    };
231
232    // Responsive Videos
233    var responsiveVideos = function() {
234        if ( $().fitVids ) {
235            $('.edukul-container').fitVids();
236        }
237    };
238
239    // Header Fixed
240    var headerFixed = function() {
241        if ( $('body').hasClass('header-fixed') ) {
242            var nav = $('#site-header');
243
244            if ( $('body').is('.header-style-5, .header-style-6') )
245                nav = $('.site-navigation-wrap');
246
247            if ( nav.length ) {
248                var
249                offsetTop = nav.offset().top,
250                headerHeight = nav.height(),
251                injectSpace = $('<div />', {
252                    height: headerHeight
253                }).insertAfter(nav);
254
255                $(window).on('load scroll', function(){
256                    if ( $(window).scrollTop() > offsetTop ) {
257                        nav.addClass('fixed-hide');
258                        injectSpace.show();
259                    } else {
260                        nav.removeClass('fixed-hide');
261                        injectSpace.hide();
262                    }
263
264                    if ( $(window).scrollTop() > 500 ) {
265                        nav.addClass('fixed-show');
266                    } else {
267                        nav.removeClass('fixed-show');
268                    }
269                })
270            }
271        }     
272    };
273
274    // Scroll to Top
275    var scrollToTop = function() {
276        $(window).scroll(function() {
277            if ( $(this).scrollTop() > 800 ) {
278                $('#scroll-top').addClass('show');
279            } else {
280                $('#scroll-top').removeClass('show');
281            }
282        });
283
284        $('#scroll-top').on('click', function() {
285            $('html, body').animate({ scrollTop: 0 }, 1000 , 'easeInOutExpo');
286        return false;
287        });
288    };
289
290    // Featured Media
291    var featuredMedia = function() {
292        if ( $().slick ) {
293            $('.blog-gallery').slick({
294                arrows: false,
295                dots: true,
296                infinite: true,
297                speed: 300,
298                fade: true,
299                cssEase: 'linear'
300            });
301        }
302    };
303
304    // Related Post
305    var relatedPost = function() {
306        if ( $().slick ) {
307            $('.related-post').slick({
308                dots: false,
309                arrows: false,
310                infinite: false,
311                speed: 300,
312                slidesToShow: 3,
313                slidesToScroll: 1,
314                responsive: [
315                {
316                  breakpoint: 1024,
317                  settings: {
318                    slidesToShow: 3,
319                    slidesToScroll: 3
320                  }
321                },
322                {
323                  breakpoint: 600,
324                  settings: {
325                    slidesToShow: 2,
326                    slidesToScroll: 2
327                  }
328                },
329                {
330                  breakpoint: 480,
331                  settings: {
332                    slidesToShow: 1,
333                    slidesToScroll: 1
334                  }
335                }
336                ]
337            });
338        }
339    };
340
341    // Widget Spacer
342    var widgetSpacer = function() {
343        $(window).on('load resize', function() {
344            var mode = 'desktop';
345
346            if ( matchMedia( 'only screen and (max-width: 991px)' ).matches )
347                mode = 'mobile';
348
349            $('.spacer').each(function(){
350                if ( mode == 'mobile' ) {
351                    $(this).attr('style', 'height:' + $(this).data('mobi') + 'px')
352                } else {
353                    $(this).attr('style', 'height:' + $(this).data('desktop') + 'px')
354                }
355            })
356        });
357    };
358
359    var AddGridVC = function() {
360        if ( $('body').hasClass('is-page') ) {
361            var vcGrid = $('.wpb_row');
362
363            if ( vcGrid.length == 0 ) {
364                $('#content-wrap').addClass('edukul-container');
365            }
366        }
367    };
368
369    mobileNav();
370    headerFixed();
371    scrollToTop();
372    widgetSpacer();
373    megaMenu();
374
375    // Dom Ready
376    $(function() {
377        
378        preLoader();
379        searchIcon();
380        fixNav();
381        onePage();
382        featuredMedia();
383        relatedPost();
384        responsiveVideos();
385        AddGridVC();
386    });
387})(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.