PageSourceSearch

https://istuprofi.ru/wp-content/themes/eduma/assets/js/custom-script-v2.js?ver=4.0.0

js istuprofi.ru collected 2026-09-25 23:32:50 UTC 84,139 bytes, 2,012 lines download raw bytes

1var thim_scroll = true;
2var woof_js_after_ajax_done;
3var can_escape = true;
4
5(function($) {
6    'use strict';
7    if (typeof LearnPress != 'undefined') {
8        if (typeof LearnPress.load_lesson == 'undefined') {
9            LearnPress.load_lesson = function(a, b) {
10                LearnPress.$Course && LearnPress.$Course.loadLesson(a, b);
11            };
12        }
13    }
14
15    $.avia_utilities = $.avia_utilities || {};
16    $.avia_utilities.supported = {};
17    $.avia_utilities.supports = (function() {
18        var div = document.createElement('div'),
19            vendors = ['Khtml', 'Ms', 'Moz', 'Webkit', 'O'];
20        return function(prop, vendor_overwrite) {
21            if (div.style.prop !== undefined) {
22                return '';
23            }
24            if (vendor_overwrite !== undefined) {
25                vendors = vendor_overwrite;
26            }
27            prop = prop.replace(/^[a-z]/, function(val) {
28                return val.toUpperCase();
29            });
30
31            var len = vendors.length;
32            while (len--) {
33                if (div.style[vendors[len] + prop] !== undefined) {
34                    return '-' + vendors[len].toLowerCase() + '-';
35                }
36            }
37            return false;
38        };
39    }());
40
41    /* Smartresize */
42    (function($, sr) {
43        var debounce = function(func, threshold, execAsap) {
44            var timeout;
45            return function debounced() {
46                var obj = this, args = arguments;
47
48                function delayed() {
49                    if (!execAsap)
50                        func.apply(obj, args);
51                    timeout = null;
52                }
53
54                if (timeout)
55                    clearTimeout(timeout);
56                else if (execAsap)
57                    func.apply(obj, args);
58                timeout = setTimeout(delayed, threshold || 100);
59            };
60        };
61        // smartresize
62        jQuery.fn[sr] = function(fn) {
63            return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr);
64        };
65    })(jQuery, 'smartresize');
66
67    //Back To top
68    var back_to_top = function() {
69        jQuery(window).scroll(function() {
70            if (jQuery(this).scrollTop() > 400) {
71                jQuery('#back-to-top').addClass('active');
72            } else {
73                jQuery('#back-to-top').removeClass('active');
74            }
75        });
76        jQuery('#back-to-top').on('click', function() {
77            jQuery('html, body').animate({scrollTop: '0px'}, 800);
78            return false;
79        });
80    };
81
82    //// stick header
83    $(document).ready(function() {
84        var $header = $('#masthead.header_default');
85        var $content_pusher = $('#wrapper-container .content-pusher');
86        $header.imagesLoaded(function() {
87            var height_sticky_header = $header.outerHeight(true);
88            $content_pusher.css({'padding-top': height_sticky_header + 'px'});
89            $(window).resize(function() {
90                var height_sticky_header = $header.outerHeight(true);
91                $content_pusher.css(
92                    {'padding-top': height_sticky_header + 'px'});
93            });
94        });
95    });
96
97    var thim_SwitchLayout = function() {
98        var cookie_name = 'course_switch',
99            archive = $('#thim-course-archive');
100        if (archive.length > 0) {
101
102            var data_cookie = archive.data('cookie')
103                ? archive.data('cookie')
104                : 'grid-layout';
105
106            //Check grid-layout
107            if ((!jQuery.cookie(cookie_name) && data_cookie != 'list-layout') ||
108                jQuery.cookie(cookie_name) == 'grid-layout') {
109                if (archive.hasClass('thim-course-list')) {
110                    archive.removeClass('thim-course-list').
111                        addClass('thim-course-grid');
112                }
113                $('.thim-course-switch-layout > a.switchToGrid').
114                    addClass('switch-active');
115            } else {
116                if (archive.hasClass('thim-course-grid')) {
117                    archive.removeClass('thim-course-grid').
118                        addClass('thim-course-list');
119                }
120                $('.thim-course-switch-layout > a.switchToList').
121                    addClass('switch-active');
122            }
123
124            $(document).
125                on('click', '.thim-course-switch-layout > a', function(event) {
126                    var elem = $(this),
127                        archive = $('#thim-course-archive');
128                    event.preventDefault();
129                    if (!elem.hasClass('switch-active')) {
130                        $('.thim-course-switch-layout > a').removeClass('switch-active');
131                        elem.addClass('switch-active');
132                        if (elem.hasClass('switchToGrid')) {
133                            archive.fadeOut(300, function() {
134                                archive.removeClass('thim-course-list').
135                                    addClass(' thim-course-grid').
136                                    fadeIn(300);
137                                jQuery.cookie(cookie_name, 'grid-layout',
138                                    {expires: 3, path: '/'});
139                            });
140                        } else {
141                            archive.fadeOut(300, function() {
142                                archive.removeClass('thim-course-grid').
143                                    addClass('thim-course-list').
144                                    fadeIn(300);
145                                jQuery.cookie(cookie_name, 'list-layout',
146                                    {expires: 3, path: '/'});
147                            });
148                        }
149                    }
150                });
151        }
152
153    };
154
155    var thim_Shop_SwitchLayout = function() {
156        var cookie_name = 'product_list',
157            archive = $('#thim-product-archive');
158        if (archive.length > 0) {
159            //Check grid-layout
160            if (!jQuery.cookie(cookie_name) || jQuery.cookie(cookie_name) == 'grid-layout') {
161                if (archive.hasClass('thim-product-list')) {
162                    archive.removeClass('thim-product-list').
163                        addClass('thim-product-grid');
164                }
165                $('.thim-product-switch-layout > a.switch-active').
166                    removeClass('switch-active');
167                $('.thim-product-switch-layout > a.switchToGrid').
168                    addClass('switch-active');
169            } else {
170                if (archive.hasClass('thim-product-grid')) {
171                    archive.removeClass('thim-product-grid').
172                        addClass('thim-product-list');
173                }
174                $('.thim-product-switch-layout > a.switch-active').
175                    removeClass('switch-active');
176                $('.thim-product-switch-layout > a.switchToList').
177                    addClass('switch-active');
178            }
179
180            $(document).
181                on('click', '.thim-product-switch-layout > a', function(event) {
182                    var elem = $(this),
183                        archive = $('#thim-product-archive');
184
185                    event.preventDefault();
186                    if (!elem.hasClass('switch-active')) {
187                        $('.thim-product-switch-layout > a').
188                            removeClass('switch-active');
189                        elem.addClass('switch-active');
190                        if (elem.hasClass('switchToGrid')) {
191                            archive.fadeOut(300, function() {
192                                archive.removeClass('thim-product-list').
193                                    addClass(' thim-product-grid').
194                                    fadeIn(300);
195                                jQuery.cookie(cookie_name, 'grid-layout',
196                                    {expires: 3, path: '/'});
197                            });
198                        } else {
199                            archive.fadeOut(300, function() {
200                                archive.removeClass('thim-product-grid').
201                                    addClass('thim-product-list').
202                                    fadeIn(300);
203                                jQuery.cookie(cookie_name, 'list-layout',
204                                    {expires: 3, path: '/'});
205                            });
206                        }
207                    }
208                });
209        }
210
211    };
212
213    var thim_Blog_SwitchLayout = function() {
214        var cookie_name = 'blog_layout',
215            archive = $('#blog-archive'),
216            switch_layout = archive.find('.switch-layout');
217        if (archive.length > 0) {
218            //Check grid-layout
219            if (!jQuery.cookie(cookie_name) || jQuery.cookie(cookie_name) == 'grid-layout') {
220                if (archive.hasClass('blog-list')) {
221                    archive.removeClass('blog-list').addClass('blog-grid');
222                }
223                switch_layout.find('> a.switch-active').
224                    removeClass('switch-active');
225                switch_layout.find('> a.switchToGrid').
226                    addClass('switch-active');
227            } else {
228                if (archive.hasClass('blog-grid')) {
229                    archive.removeClass('blog-grid').addClass('blog-list');
230                }
231                switch_layout.find('> a.switch-active').
232                    removeClass('switch-active');
233                switch_layout.find('> a.switchToList').
234                    addClass('switch-active');
235            }
236
237            $(document).
238                on('click', '#blog-archive .switch-layout > a',
239                    function(event) {
240                        var elem = $(this),
241                            archive = $('#blog-archive');
242
243                        event.preventDefault();
244                        if (!elem.hasClass('switch-active')) {
245                            switch_layout.find('>a').
246                                removeClass('switch-active');
247                            elem.addClass('switch-active');
248                            if (elem.hasClass('switchToGrid')) {
249                                archive.fadeOut(300, function() {
250                                    archive.removeClass('blog-list').
251                                        addClass('blog-grid').
252                                        fadeIn(300);
253                                    jQuery.cookie(cookie_name, 'grid-layout',
254                                        {expires: 3, path: '/'});
255                                });
256                            } else {
257                                archive.fadeOut(300, function() {
258                                    archive.removeClass('blog-grid').
259                                        addClass('blog-list').
260                                        fadeIn(300);
261                                    jQuery.cookie(cookie_name, 'list-layout',
262                                        {expires: 3, path: '/'});
263                                });
264                            }
265                        }
266                    });
267        }
268
269    };
270
271    /* ****** jp-jplayer  ******/
272    var thim_post_audio = function() {
273        $('.jp-jplayer').each(function() {
274            var $this = $(this),
275                url = $this.data('audio'),
276                type = url.substr(url.lastIndexOf('.') + 1),
277                player = '#' + $this.data('player'),
278                audio = {};
279            audio[type] = url;
280            $this.jPlayer({
281                ready              : function() {
282                    $this.jPlayer('setMedia', audio);
283                },
284                swfPath            : 'jplayer/',
285                cssSelectorAncestor: player,
286            });
287        });
288    };
289
290    var thim_post_gallery = function() {
291        $('article.format-gallery .flexslider').imagesLoaded(function() {
292            $('.flexslider').flexslider({
293                slideshow     : true,
294                animation     : 'fade',
295                pauseOnHover  : true,
296                animationSpeed: 400,
297                smoothHeight  : true,
298                directionNav  : true,
299                controlNav    : false,
300            });
301        });
302    };
303
304    /* ****** PRODUCT QUICK VIEW  ******/
305    var thim_quick_view = function() {
306        $(document).on('click', '.quick-view', function(e) {
307            /* add loader  */
308            $('.quick-view a').css('display', 'none');
309            $(this).append('<a href="javascript:;" class="loading dark"></a>');
310            var product_id = $(this).attr('data-prod');
311            var data = {action: 'jck_quickview', product: product_id};
312            $.post(ajaxurl, data, function(response) {
313                $.magnificPopup.open({
314                    mainClass: 'my-mfp-zoom-in',
315                    items    : {
316                        src : response,
317                        type: 'inline',
318                    },
319                    callbacks: {
320                        open: function() {
321                            $('body').addClass('thim-popup-active');
322                            $.magnificPopup.instance.close = function() {
323                                $('body').removeClass('thim-popup-active');
324                                $.magnificPopup.proto.close.call(this);
325                            };
326                        },
327                    },
328                });
329                $('.quick-view a').css('display', 'inline-block');
330                $('.loading').remove();
331                $('.product-card .wrapper').removeClass('animate');
332                setTimeout(function() {
333                    if (typeof wc_add_to_cart_variation_params !==
334                        'undefined') {
335                        $('.product-info .variations_form').each(function() {
336                            $(this).
337                                wc_variation_form().
338                                find('.variations select:eq(0)').
339                                change();
340                        });
341                    }
342                }, 600);
343            });
344            e.preventDefault();
345        });
346    };
347
348    var thim_miniCartHover = function() {
349        jQuery(document).
350            on('mouseenter', '.site-header .minicart_hover', function() {
351                jQuery(this).next('.widget_shopping_cart_content').slideDown();
352            }).
353            on('mouseleave', '.site-header .minicart_hover', function() {
354                jQuery(this).
355                    next('.widget_shopping_cart_content').
356                    delay(100).
357                    stop(true, false).
358                    slideUp();
359            });
360        jQuery(document).
361            on('mouseenter', '.site-header .widget_shopping_cart_content',
362                function() {
363                    jQuery(this).stop(true, false).show();
364                }).
365            on('mouseleave', '.site-header .widget_shopping_cart_content',
366                function() {
367                    jQuery(this).delay(100).stop(true, false).slideUp();
368                });
369    };
370
371    var thim_course_menu_landing = function() {
372        if ($('.thim-course-menu-landing').length > 0) {
373            var menu_landing = $('.thim-course-menu-landing'),
374                tab_course = $('#course-landing .nav-tabs');
375
376            var tab_active = tab_course.find('>li.active'),
377                tab_item = tab_course.find('>li>a'),
378                tab_landing = menu_landing.find('.thim-course-landing-tab'),
379                tab_landing_item = tab_landing.find('>li>a'),
380                landing_Top = ($('#course-landing').length) > 0 ? $('#course-landing').offset().top : 0,
381                checkTop = ($(window).height() > landing_Top) ? $(window).height() : landing_Top;
382
383            $('footer#colophon').addClass('has-thim-course-menu');
384            if (tab_active.length > 0) {
385                var active_href = tab_active.find('>a').attr('href'),
386                    landing_active = tab_landing.find('>li>a[href="' + active_href + '"]');
387
388                if (landing_active.length > 0) {
389                    landing_active.parent().addClass('active');
390                }
391            }
392
393            tab_landing_item.on('click', function(event) {
394                event.preventDefault();
395
396                var href = $(this).attr('href'),
397           
397         parent = $(this).parent();
398
399                if (!parent.hasClass('active')) {
400                    tab_landing.find('li.active').removeClass('active');
401                    parent.addClass('active');
402                }
403
404                if (tab_course.length > 0) {
405                    tab_course.find('>li>a[href="' + href + '"]').trigger('click');
406
407                    $('body, html').animate({
408                        scrollTop: tab_course.offset().top - 50,
409                    }, 800);
410                } else {
411                    $('body, html').animate({
412                        scrollTop: $($.attr(this, 'href')).offset().top,
413                    }, 500);
414                }
415            });
416
417            tab_item.on('click', function() {
418                var href = $(this).attr('href'),
419                    parent_landing = tab_landing.find('>li>a[href="' + href +
420                        '"]').parent();
421
422                if (!parent_landing.hasClass('active')) {
423                    tab_landing.find('li.active').removeClass('active');
424                    parent_landing.addClass('active');
425                }
426            });
427
428            $(window).scroll(function() {
429                if ($(window).scrollTop() > checkTop) {
430                    $('body').addClass('course-landing-active');
431                } else {
432                    $('body.course-landing-active').removeClass('course-landing-active');
433                }
434            });
435        }
436    };
437
438    var thimImagepopup = function() {
439        $('.thim-image-popup').magnificPopup({
440            type               : 'image',
441            closeOnContentClick: true,
442        });
443    };
444
445    $(document).on('click', '#course-curriculum-popup .popup-close', function(event) {
446        event.preventDefault();
447        $('#learn-press-block-content').remove();
448    });
449
450    $(function() {
451        back_to_top();
452
453        /* Waypoints magic
454         ---------------------------------------------------------- */
455        if (typeof jQuery.fn.waypoint !== 'undefined') {
456            jQuery(
457                '.wpb_animate_when_almost_visible:not(.wpb_start_animation)').
458                waypoint(function() {
459                    jQuery(this).addClass('wpb_start_animation');
460                }, {offset: '85%'});
461        }
462    });
463
464    function empty(data) {
465        if (typeof (data) == 'number' || typeof (data) == 'boolean') {
466            return false;
467        }
468        if (typeof (data) == 'undefined' || data === null) {
469            return true;
470        }
471        if (typeof (data.length) != 'undefined') {
472            return data.length === 0;
473        }
474        var count = 0;
475        for (var i in data) {
476            if (Object.prototype.hasOwnProperty.call(data, i)) {
477                count++;
478            }
479        }
480        return count === 0;
481    }
482
483    var windowWidth = window.innerWidth,
484        windowHeight = window.innerHeight,
485        $document = $(document),
486        orientation = windowWidth > windowHeight ? 'landscape' : 'portrait';
487    var TitleAnimation = {
488        selector   : '.article__parallax',
489        initialized: false,
490        animated   : false,
491        initialize : function() {
492        },
493        update     : function() {
494        },
495    };
496
497    $(window).on('debouncedresize', function(e) {
498        windowWidth = $(window).width();
499        windowHeight = $(window).height();
500        TitleAnimation.initialize();
501    });
502
503    $(window).on('orientationchange', function(e) {
504        setTimeout(function() {
505            TitleAnimation.initialize();
506        }, 300);
507    });
508
509    var latestScrollY = $('html').scrollTop() || $('body').scrollTop(),
510        ticking = false;
511
512    function updateAnimation() {
513        ticking = false;
514        TitleAnimation.update();
515    }
516
517    function requestScroll() {
518        if (!ticking) {
519            requestAnimationFrame(updateAnimation);
520        }
521        ticking = true;
522    }
523
524    $(window).on('scroll', function() {
525        latestScrollY = $('html').scrollTop() || $('body').scrollTop();
526        requestScroll();
527    });
528
529    jQuery(function($) {
530        var adminbar_height = jQuery('#wpadminbar').outerHeight();
531        jQuery('.navbar-nav li a,.arrow-scroll > a').on('click', function(e) {
532            if (parseInt(jQuery(window).scrollTop(), 10) < 2) {
533                var height = 47;
534            } else height = 0;
535            var sticky_height = jQuery('#masthead').outerHeight();
536            var menu_anchor = jQuery(this).attr('href');
537            if (menu_anchor && menu_anchor.indexOf('#') == 0 &&
538                menu_anchor.length > 1) {
539                e.preventDefault();
540                $('html,body').animate({
541                    scrollTop: jQuery(menu_anchor).offset().top -
542                        adminbar_height - sticky_height + height,
543                }, 850);
544            }
545        });
546    });
547
548    function mobilecheck() {
549        var check = false;
550        (function(a) {
551            if (/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(
552                a) ||
553                /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
554                    a.substr(0, 4))) check = true;
555        })(navigator.userAgent || navigator.vendor || window.opera);
556        return check;
557    }
558
559    if (mobilecheck()) {
560        window.addEventListener('load', function() { // on page load
561            var main_content = document.getElementById('main-content');
562            if (main_content) {
563                main_content.addEventListener('touchstart', function(e) {
564                    jQuery('.wrapper-container').
565                        removeClass('mobile-menu-open');
566                });
567            }
568        }, false);
569    }
570
571    /* mobile menu */
572    if (jQuery(window).width() > 768) {
573        jQuery(
574            '.navbar-nav>li.menu-item-has-children >a,.navbar-nav>li.menu-item-has-children >span,.navbar-nav>li.tc-menu-layout-builder >a,.navbar-nav>li.tc-menu-layout-builder >span').
575            after(
576                '<span class="icon-toggle"><i class="fa fa-angle-down"></i></span>');
577    } else {
578        jQuery(
579            '.navbar-nav>li.menu-item-has-children:not(.current-menu-parent) >a,.navbar-nav>li.menu-item-has-children:not(.current-menu-parent) >span,.navbar-nav>li.tc-menu-layout-builder:not(.current-menu-parent) >a,.navbar-nav>li.tc-menu-layout-builder:not(.current-menu-parent) >span').
580            after(
581                '<span class="icon-toggle"><i class="fa fa-angle-down"></i></span>');
582        jQuery(
583            '.navbar-nav>li.menu-item-has-children.current-menu-parent >a,.navbar-nav>li.menu-item-has-children.current-menu-parent >span,.navbar-nav>li.tc-menu-layout-builder.current-menu-parent >a,.navbar-nav>li.tc-menu-layout-builder.current-menu-parent >span').
584            after(
585                '<span class="icon-toggle"><i class="fa fa-angle-up"></i></span>');
586    }
587    jQuery(
588        '.navbar-nav>li.menu-item-has-children .icon-toggle, .navbar-nav>li.tc-menu-layout-builder .icon-toggle').
589        on('click', function() {
590            if (jQuery(this).next('.sub-menu').is(':hidden')) {
591                jQuery(this).next('.sub-menu').slideDown(500, 'linear');
592                jQuery(this).html('<i class="fa fa-angle-up"></i>');
593            } else {
594                jQuery(this).next('.sub-menu').slideUp(500, 'linear');
595                jQuery(this).html('<i class="fa fa-angle-down"></i>');
596            }
597        });
598
599    /* ====== ON RESIZE ====== */
600    $(window).load(function() {
601        thim_post_audio();
602        thim_post_gallery();
603        thim_quick_view();
604        thim_miniCartHover();
605        thim_SwitchLayout();
606        thim_Shop_SwitchLayout();
607        thim_Blog_SwitchLayout();
608        thimImagepopup();
609
610        setTimeout(function() {
611            TitleAnimation.initialize();
612            thim_course_menu_landing();
613        }, 400);
614    });
615
616})(jQuery);
617
618(function($) {
619    var thim_quiz_index = function() {
620        var question_index = $('.single-quiz .index-question'),
621            quiz_total_text = $('.single-quiz .quiz-total .quiz-text');
622        if (question_index.length > 0) {
623            quiz_total_text.html(question_index.html());
624        }
625    };
626
627    $(window).load(function() {
628        $('.article__parallax').each(function(index, el) {
629            $(el).parallax('50%', 0.4);
630        });
631        $('.images_parallax').parallax_images({
632            speed: 0.5,
633        });
634
635        $(window).resize(function() {
636            $('.images_parallax').each(function(index, el) {
637                $(el).imagesLoaded(function() {
638                    var parallaxHeight = $(this).find('img').height();
639                    $(this).height(parallaxHeight);
640                });
641            });
642        }).trigger('resize');
643
644        thim_quiz_index();
645
646        //Add class for profile tab
647        var $profile_list = $('.profile-tabs .nav-tabs>li ');
648        if ($profile_list.length > 0) {
649            $profile_list.addClass('thim-profile-list-' + $profile_list.length);
650        }
651    });
652
653    // Learnpress custom code js
654    $(document).ready(function() {
655        //Course wishlist
656        $('.course-wishlist-box [class*=\'course-wishlist\']').
657            on('click', function(event) {
658                event.preventDefault();
659                var $this = $(this);
660                if ($this.hasClass('loading')) return;
661                $this.addClass('loading');
662                $this.toggleClass('course-wishlist');
663                $this.toggleClass('course-wishlisted');
664                $class = $this.attr('class');
665                if ($this.hasClass('course-wishlisted')) {
666                    $.ajax({
667                        type    : 'POST',
668                        url     : window.location.href,
669                        dataType: 'html',
670                        data    : {
671                            //action   : 'learn_press_toggle_course_wishlist',
672                            'lp-ajax': 'toggle_course_wishlist',
673                            course_id: $this.data('id'),
674                            nonce    : $this.data('nonce'),
675                        },
676                        success : function() {
677                            $this.removeClass('loading');
678                        },
679                        error   : function() {
680                            $this.removeClass('loading');
681                        },
682                    });
683                }
684                if ($this.hasClass('course-wishlist')) {
685                    $.ajax({
686                        type    : 'POST',
687                        url     : window.location.href,
688                        dataType: 'html',
689                        data    : {
690                            //action   : 'learn_press_toggle_course_wishlist',
691                            'lp-ajax': 'toggle_course_wishlist',
692                            course_id: $this.data('id'),
693                            nonce    : $this.data('nonce'),
694                        },
695                        success : function() {
696                            $this.removeClass('loading');
697                        },
698                        error   : function() {
699                            $this.removeClass('loading');
700                        },
701                    });
702                }
703            });
704
705        $('.video-container').on('click', '.beauty-intro .btns', function() {
706            var iframe = '<iframe src="' + $(this).
707                    closest('.video-container').
708                    find('.yt-player').
709                    attr('data-video') + '" height= "' +
710                $('.parallaxslider').height() + '"></iframe>';
711            $(this).
712                closest('.video-container').
713                find('.yt-player').
714                replaceWith(iframe);
715            //debug >HP
716            $(this).
717                closest('.video-container').
718                find('.hideClick:first').
719                css('display', 'none');
720        });
721
722        if (!$('.add-review').length) {
723            return;
724        }
725        var $star = $('.add-review .filled');
726        var $review = $('#review-course-value');
727        $star.find('li').on('mouseover', function() {
728            $(this).nextAll().find('span').removeClass('fa-star').addClass('fa-star-o');
729            $(this).prevAll().find('span').removeClass('fa-star-o').addClass('fa-star');
730            $(this).find('span').removeClass('fa-star-o').addClass('fa-star');
731            $review.val($(this).index() + 1);
732        });
733
734        //Replace placeholder input password & login
735        $('.login-username [name="log"]').
736            attr('placeholder', thim_js_translate.login);
737        $('.login-password [name="pwd"]').
738            attr('placeholder', thim_js_translate.password);
739
740        $(window).scroll(function(event) {
741            if (thim_scroll && thim_scroll === false) {
742                event.preventDefault();
743            }
744        });
745    });
746
747    $(document).on('click', '#course-review-load-more', function() {
748        var $button = $(this);
749        if (!$button.is(':visible')) return;
750        $button.addClass('loading');
751        var paged = parseInt($(this).attr('data-paged')) + 1;
752        $.ajax({
753            type    : 'POST',
754            dataType: 'html',
755            url     : window.location.href,
756            data    : {
757                action: 'learn_press_load_course_review',
758                paged : paged,
759            },
760            success : function(response) {
761                var $content = $(response),
762                    $new_review = $content.find('.course-reviews-list>li');
763                $('#course-reviews .course-reviews-list').append($new_review);
764                if ($content.find('#course-review-load-more').length) {
765                    $button.removeClass('loading').attr('data-paged', paged);
766                } else {
767                    $button.remove();
768                }
769            },
770        });
771    });
772
773    $(document).on('click', '.single-lp_course .course-meta .course-review .value',
774        function() {
775            var review_tab = $('.course-tabs a[href="#tab-course-review"]');
776            if (review_tab.length > 0) {
777                review_tab.trigger('click');
778                $('body, html').animate({
779                    scrollTop: review_tab.offset().top - 50,
780                }, 800);
781            }
782            var review_tab_v3 = $('.course-tabs a[href="#tab-reviews"]');
783            if (review_tab_v3.length > 0) {
784                review_tab_v3.trigger('click');
785                $('body, html').animate({
786                    scrollTop: review_tab_v3.offset().top - 50,
787                }, 800);
788            }
789        });
790
791    //Widget live search course
792    var search_timer = false;
793
794    function thimlivesearch(contain) {
795        var input_search = contain.find('.courses-search-input'),
796            list_search = contain.find('.courses-list-search'),
797            keyword = input_search.val(),
798            loading = contain.find('.fa-search,.fa-times');
799
800        if (keyword) {
801            if (keyword.length < 1) {
802                return;
803            }
804            loading.addClass('fa-spinner fa-spin');
805            $.ajax({
806                type   : 'POST',
807                data   : 'action=courses_searching&keyword=' + keyword + '&from=search',
808                url    : ajaxurl,
809                success: function(html) {
810                    var data_li = '';
811                    var items = jQuery.parseJSON(html);
812                    if (!items.error) {
813                        $.each(items, function(index) {
814                            if (index == 0) {
815                                if (this['guid'] != '#') {
816                                    data_li += '<li class="ui-menu-item' +
817                                        this['id'] +
818                                        ' ob-selected"><a class="ui-corner-all" href="' +
819                                        this['guid'] + '">' + this['title'] +
820                                        '</a></li>';
821                                } else {
822                                    data_li += '<li class="ui-menu-item' +
823                                        this['id'] + ' ob-selected">' +
824                                        this['title'] + '</li>';
825                                }
826
827                            } else {
828                                data_li += '<li class="ui-menu-item' +
829                                    this['id'] +
830                                    '"><a class="ui-corner-all" href="' +
831                                    this['guid'] + '">' + this['title'] +
832                                    '</a></li>';
833                            }
834                        });
835                        list_search.addClass('search-visible').
836                            html('').
837                            append(data_li);
838                    }
839                    thimsearchHover();
840                    loading.removeClass('fa-spinner fa-spin');
841                },
842                error  : function(html) {
843                },
844            });
845        }
846        list_search.html('');
847    }
848
849    function thimsearchHover() {
850        $('.courses-list-search li').on('mouseenter', function() {
851            $('.courses-list-search li').removeClass('ob-selected');
852            $(this).addClass('ob-selected');
853        });
854    }
855
856    $(document).ready(function() {
857
858        $(document).
859            on('click', '.thim-course-search-overlay .search-toggle',
860                function(e) {
861                    e.stopPropagation();
862                    var parent = $(this).parent();
863                    $('body').addClass('thim-search-active');
864                    setTimeout(function() {
865                        parent.find('.thim-s').focus();
866                    }, 500);
867
868                });
869        $(document).on('click', '.search-popup-bg', function() {
870            var parent = $(this).parent();
871            window.clearTimeout(search_timer);
872            parent.find('.courses-list-search').empty();
873            parent.find('.thim-s').val('');
874            $('body').removeClass('thim-search-active');
875        });
876
877        $(document).on('keyup', '.courses-search-input', function(event) {
878            clearTimeout($.data(this, 'search_timer'));
879            var contain = $(this).parents('.courses-searching'),
880                list_search = contain.find('.courses-list-search'),
881                item_search = list_search.find('>li');
882            if (event.which == 13) {
883                event.preventDefault();
884                $(this).stop();
885            } else if (event.which == 38) {
886                if (navigator.userAgent.indexOf('Chrome') != -1 && parseFloat(
887                    navigator.userAgent.substring(navigator.userAgent.indexOf(
888                        'Chrome') + 7).split(' ')[0]) >= 15) {
889                    var selected = item_search.filter('.ob-selected');
890                    if (item_search.length > 1) {
891                        item_search.removeClass('ob-selected');
892                        // if there is no element before the selected one, we select the last one
893                        if (selected.prev().length == 0) {
894                            selected.siblings().last().addClass('ob-selected');
895                        } else { // otherwise we just select the next one
896                            selected.prev().addClass('ob-selected');
897                        }
898                    }
899                }
900            } else if (event.which == 40) {
901                if (navigator.userAgent.indexOf('Chrome') != -1 && parseFloat(
902                    navigator.userAgent.substring(navigator.userAgent.indexOf(
903                        'Chrome') + 7).split(' ')[0]) >= 15) {
904                    var selected = item_search.filter('.ob-selected');
905                    if (item_search.length > 1) {
906                        item_search.removeClass('ob-selected');
907
908                        // if there is no element before the selected one, we select the last one
909                        if (selected.next().length == 0) {
910                            selected.siblings().first().addClass('ob-selected');
911                        } else { // otherwise we just select the next one
912                            selected.next().addClass('ob-selected');
913                        }
914                    }
915                }
916            } else if (event.which == 27) {
917                if ($('body').hasClass('thim-search-active')) {
918                    $('body').removeClass('thim-search-active');
919                }
920                list_search.html('');
921                $(this).val('');
922                $(this).stop();
923            } else {
924                var search_timer = setTimeout(function() {
925                    thimlivesearch(contain);
926                }, 500);
927                $(this).data('search_timer', search_timer);
928            }
929        });
930        $(document).on('keypress', '.courses-search-input', function(event) {
931            var item_search = $(this).
932                parents('.courses-searching').
933                find('.courses-list-search>li');
934
935            if (event.keyCode == 13) {
936                var selected = $('.ob-selected');
937                if (selected.length > 0) {
938                    var ob_href = selected.find('a').first().attr('href');
939                    window.location.href = ob_href;
940                }
941                event.preventDefault();
942            }
943            if (event.keyCode == 27) {
944                if ($('body').hasClass('thim-search-active')) {
945                    $('body').removeClass('thim-search-active');
946                }
947                $('.courses-list-search').html('');
948                $(this).val('');
949                $(this).stop();
950            }
951            if (event.keyCode == 38) {
952                var selected = item_search.filter('.ob-selected');
953                // if there is no element before the selected one, we select the last one
954                if (item_search.length > 1) {
955                    item_search.removeClass('ob-selected');
956                    if (selected.prev().length == 0) {
957                        selected.siblings().last().addClass('ob-selected');
958                    } else { // otherwise we just select the next one
959                        selected.prev().addClass('ob-selected');
960                    }
961                }
962            }
963            if (event.keyCode == 40) {
964                var selected = item_search.filter('.ob-selected');
965                if (item_search.length > 1) {
966                    item_search.removeClass('ob-selected');
967                    // if there is no element before the selected one, we select the last one
968                    if (selected.next().length == 0) {
969                        selected.siblings().first().addClass('ob-selected');
970                    } else { // otherwise we just select the next one
971                        selected.next().addClass('ob-selected');
972                    }
973                }
974            }
975        });
976
977        $(document).
978            on('click', '.courses-list-search, .courses-search-input',
979                function(event) {
980                    event.stopPropagation();
981                });
982
983        $(document).on('click', 'body', function() {
984            if (!$('body').hasClass('course-scroll-remove')) {
985                $('body').addClass('course-scroll-remove');
986                $('.courses-list-search').html('');
987            }
988        });
989
990        $(window).scroll(function() {
991            if ($('body').hasClass('course-scroll-remove') &&
992                $('.courses-list-search li').length > 0) {
993                $('.courses-searching .courses-list-search').empty();
994                $('.courses-searching .thim-s').val('');
995            }
996        });
997
998        $(document).on('focus', '.courses-search-input', function() {
999            if ($('body').hasClass('course-scroll-remove')) {
1000                $('body').removeClass('course-scroll-remove');
1001            }
1002        });
1003
1004        //Prevent search result
1005        $(document).on('click', '#popup-header .search-visible', function(e) {
1006            var href = $(e.target).attr('href');
1007            if (!href) {
1008                $('#popup-header .search-visible').
1009                    removeClass('search-visible');
1010            }
1011
1012        });
1013
1014        $(document).on('click', '#popup-header button', function(e) {
1015            $('#popup-header .thim-s').trigger('focus');
1016
1017        });
1018
1019        $(document).on('focus', '#popup-header .thim-s', function() {
1020            var link = $('#popup-header .courses-list-search a');
1021
1022            if ($(this).val() != '' && link.length > 0) {
1023                $('#popup-header .courses-list-search').
1024                    addClass('search-visible');
1025            }
1026        });
1027
1028        //Widget icon box
1029        $('.wrapper-box-icon').each(function() {
1030            var $this = $(this);
1031            if ($this.attr('data-icon')) {
1032                var $color_icon = $('.boxes-icon i', $this).css('color');
1033                var $color_title = $('.heading__primary a', $this).css('color');
1034                var $color_icon_change = $this.attr('data-icon');
1035            }
1036            if ($this.attr('data-icon-border')) {
1037                var $color_icon_border = $('.boxes-icon', $this).
1038                    css('border-color');
1039                var $color_icon_border_change = $this.attr('data-icon-border');
1040            }
1041            if ($this.attr('data-icon-bg')) {
1042                var $color_bg = $('.boxes-icon', $this).css('background-color');
1043                var $color_bg_change = $this.attr('data-icon-bg');
1044            }
1045
1046            if ($this.attr('data-btn-bg')) {
1047                var $color_btn_bg = $('.smicon-read', $this).
1048                    css('background-color');
1049                var $color_btn_border = $('.smicon-read', $this).
1050                    css('border-color');
1051                var $color_btn_bg_text_color = $('.smicon-read', $this).
1052                    css('color');
1053
1054                var $color_btn_bg_change = $this.attr('data-btn-bg');
1055                if ($this.attr('data-text-readmore')) {
1056                    var $color_btn_bg_text_color_change = $this.attr(
1057                        'data-text-readmore');
1058                } else {
1059                    $color_btn_bg_text_color_change = $color_btn_bg_text_color;
1060                }
1061
1062                $('.smicon-read', $this).on({
1063                    'mouseenter': function() {
1064                        if ($('#style_selector_container').length > 0) {
1065                            if ($('.smicon-read', $this).
1066                                css('background-color') != $color_btn_bg)
1067                                $color_btn_bg = $('.smicon-read', $this).
1068                                    css('background-color');
1069                        }
1070                        $('.smicon-read', $this).css({
1071                            'background-color': $color_btn_bg_change,
1072                            'border-color'    : $color_btn_bg_change,
1073                            'color'           : $color_btn_bg_text_color_change,
1074                        });
1075                    },
1076                    'mouseleave': function() {
1077                        $('.smicon-read', $this).css({
1078                            'background-color': $color_btn_bg,
1079                            'border-color'    : $color_btn_border,
1080                            'color'           : $color_btn_bg_text_color,
1081                        });
1082                    },
1083                });
1084
1085            }
1086
1087            $($this).on({
1088                'mouseenter': function() {
1089                    if ($this.attr('data-icon')) {
1090                        $('.boxes-icon i', $this).
1091                            css({'color': $color_icon_change});
1092                        $('.heading__primary a', $this).
1093                            css({'color': $color_icon_change});
1094                    }
1095                    if ($this.attr('data-icon-bg')) {
1096                        /* for select style*/
1097                        if ($('#style_selector_container').length > 0) {
1098                            if ($('.boxes-icon', $this).css('background-color') != $color_bg)
1099                                $color_bg = $('.boxes-icon', $this).
1100                                    css('background-color');
1101                        }
1102
1103                        $('.boxes-icon', $this).
1104                            css({'background-color': $color_bg_change});
1105                    }
1106                    if ($this.attr('data-icon-border')) {
1107                        $('.boxes-icon', $this).
1108                            css({'border-color': $color_icon_border_change});
1109                    }
1110                },
1111                'mouseleave': function() {
1112                    if ($this.attr('data-icon')) {
1113                        $('.boxes-icon i', $this).css({'color': $color_icon});
1114                        $('.heading__primary a', $this).
1115                            css({'color': $color_title});
1116                    }
1117                    if ($this.attr('data-icon-bg')) {
1118                        $('.boxes-icon', $this).
1119                            css({'background-color': $color_bg});
1120                    }
1121                    if ($this.attr('data-icon-border')) {
1122                        $('.boxes-icon', $this).
1123                            css({'border-color': $color_icon_border});
1124                    }
1125                },
1126            });
1127
1128        });
1129        /* End Icon Box */
1130
1131        //Background video
1132        $('.bg-video-play').on('click', function() {
1133            var elem = $(this),
1134                video = $(this).
1135                    parents('.thim-widget-icon-box').
1136                    find('.full-screen-video'),
1137                player = video.get(0);
1138            if (player.paused) {
1139                player.play();
1140                elem.addClass('bg-pause');
1141            } else {
1142                player.pause();
1143                elem.removeClass('bg-pause');
1144            }
1145        });
1146
1147        //wpcf7-form-submit
1148        $(document).on('click', '.wpcf7-form-control.wpcf7-submit', function() {
1149            var elem = $(this),
1150                form = elem.parents('.wpcf7-form');
1151            form.addClass('thim-sending');
1152            $(document).on('invalid.wpcf7', function(event) {
1153                form.removeClass('thim-sending');
1154            });
1155            $(document).on('spam.wpcf7', function(event) {
1156                form.removeClass('thim-sending');
1157                setTimeout(function() {
1158                    if ($('.wpcf7-response-output').length > 0) {
1159                        $('.wpcf7-response-output').hide();
1160                    }
1161                }, 4000);
1162            });
1163            $(document).on('mailsent.wpcf7', function(event) {
1164                form.removeClass('thim-sending');
1165                setTimeout(function() {
1166                    if ($('.wpcf7-response-output').length > 0) {
1167                        $('.wpcf7-response-output').hide();
1168                    }
1169                }, 4000);
1170
1171            });
1172            $(document).on('mailfailed.wpcf7', function(event) {
1173                form.removeClass('thim-sending');
1174                setTimeout(function() {
1175                    if ($('.wpcf7-response-output').length > 0) {
1176                        $('.wpcf7-response-output').hide();
1177                    }
1178                }, 4000);
1179            });
1180        });
1181    });
1182
1183    //Include plugin event file events.js
1184    jQuery(document).ready(function() {
1185
1186        // owl-carausel
1187        var carousels = $('.tp_event_owl_carousel');
1188        for (var i = 0; i < carousels.length; i++) {
1189            var data = $(carousels[i]).attr('data-countdown');
1190            var options = {
1191                navigation     : true, // Show next and prev buttons
1192                slideSpeed     : 300,
1193                paginationSpeed: 400,
1194                singleItem     : true,
1195            };
1196            if (typeof data !== 'undefined') {
1197                data = JSON.parse(data);
1198                $.extend(options, data);
1199
1200                $.each(options, function(k, v) {
1201                    if (v === 'true') {
1202                        options[k] = true;
1203                    } else if (v === 'false') {
1204                        options[k] = false;
1205                    }
1206                });
1207            }
1208
1209            if (typeof options.slide === 'undefined' || options.slide ===
1210                true) {
1211                $(carousels[i]).owlCarousel(options);
1212            } else {
1213                $(carousels[i]).removeClass('owl-carousel');
1214            }
1215        }
1216    });
1217
1218    // Sticky sidebar
1219    jQuery(document).ready(function() {
1220        var offsetTop = 20;
1221        if ($('#wpadminbar').length) {
1222            offsetTop += $('#wpadminbar').outerHeight();
1223        }
1224        if ($('#masthead.sticky-header').length) {
1225            offsetTop += $('#masthead.sticky-header').outerHeight();
1226        }
1227        jQuery('#sidebar.sticky-sidebar').theiaStickySidebar({
1228            'containerSelector'     : '',
1229            'additionalMarginTop'   : offsetTop,
1230            'additionalMarginBottom': '0',
1231            'updateSidebarHeight'   : false,
1232            'minWidth'              : '768',
1233            'sidebarBehavior'       : 'modern',
1234        });
1235    });
1236
1237    // Prevent search when no content submited
1238    jQuery(document).ready(function() {
1239        $('.courses-searching form').submit(function() {
1240            var input_search = $(this).find('input[name=\'s\']');
1241            if ($.trim(input_search.val()) === '') {
1242                input_search.focus();
1243                return false;
1244            }
1245        });
1246
1247        $('form#bbp-search-form').submit(function() {
1248            if ($.trim($('#bbp_search').val()) === '') {
1249                $('#bbp_search').focus();
1250                return false;
1251            }
1252        });
1253
1254        $('form.search-form').submit(function() {
1255            var input_search = $(this).find('input[name=\'s\']');
1256            if ($.trim(input_search.val()) === '') {
1257                input_search.focus();
1258                return false;
1259            }
1260        });
1261
1262        //My account login
1263        $('#customer_login .login').submit(function(event) {
1264            var elem = $(this),
1265                input_username = elem.find('#username'),
1266                input_pass = elem.find('#password');
1267
1268            if (input_pass.length > 0 && input_pass.val() == '') {
1269                input_pass.addClass('invalid');
1270                event.preventDefault();
1271            }
1272
1273            if (input_username.length > 0 && input_username.val() == '') {
1274                input_username.addClass('invalid');
1275                event.preventDefault();
1276            }
1277        });
1278
1279        //My account register
1280        $('#customer_login .register').submit(function(event) {
1281            var elem = $(this),
1282                input_username = elem.find('#reg_username'),
1283                input_email = elem.find('#reg_email'),
1284                input_pass = elem.find('#reg_password'),
1285                input_captcha = $('#customer_login .register .captcha-result'),
1286                valid_email = /[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}/igm;
1287
1288            if (input_captcha.length > 0) {
1289                var captcha_1 = parseInt(input_captcha.data('captcha1')),
1290                    captcha_2 = parseInt(input_captcha.data('captcha2'));
1291
1292                if (captcha_1 + captcha_2 != parseInt(input_captcha.val())) {
1293                    input_captcha.addClass('invalid').val('');
1294                    event.preventDefault();
1295                }
1296            }
1297
1298            if (input_pass.length > 0 && input_pass.val() == '') {
1299                input_pass.addClass('invalid');
1300                event.preventDefault();
1301            }
1302
1303            if (input_username.length > 0 && input_username.val() == '') {
1304                input_username.addClass('invalid');
1305                event.preventDefault();
1306            }
1307
1308            if (input_email.length > 0 && (input_email.val() == '' ||
1309                !valid_email.test(input_email.val()))) {
1310                input_email.addClass('invalid');
1311                event.preventDefault();
1312            }
1313        });
1314
1315        //Validate comment form submit
1316        $('form#commentform').submit(function(event) {
1317            var elem = $(this),
1318                comment = elem.find('#comment[aria-required="true"]'),
1319                author = elem.find('#author[aria-required="true"]'),
1320                url = elem.find('#url[aria-required="true"]'),
1321                email = elem.find('#email[aria-required="true"]'),
1322                valid_email = /[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}/igm;
1323
1324            if (author.length > 0 && author.val() == '') {
1325                author.addClass('invalid');
1326                event.preventDefault();
1327            }
1328
1329            if (comment.length > 0 && comment.val() == '') {
1330                comment.addClass('invalid');
1331                event.preventDefault();
1332            }
1333
1334            if (url.length > 0 && url.val() == '') {
1335                url.addClass('invalid');
1336                event.preventDefault();
1337            }
1338
1339            if (email.length > 0 &&
1340                (email.val() == '' || !valid_email.test(email.val()))) {
1341                email.addClass('invalid');
1342                event.preventDefault();
1343            }
1344        });
1345
1346        $('#customer_login .register, #reg_username, #reg_email, #reg_password').on('focus', function() {
1347            $(this).removeClass('invalid');
1348        });
1349
1350        $('input.wpcf7-text, textarea.wpcf7-textarea').on('focus', function() {
1351            if ($(this).hasClass('wpcf7-not-valid')) {
1352                $(this).removeClass('wpcf7-not-valid');
1353            }
1354        });
1355
1356        $('.thim-language').on({
1357            'mouseenter': function() {
1358                $(this).children('.list-lang').stop(true, false).fadeIn(250);
1359            },
1360            'mouseleave': function() {
1361                $(this).children('.list-lang').stop(true, false).fadeOut(250);
1362            },
1363        });
1364
1365        $('#toolbar .menu li.menu-item-has-children').on({
1366            'mouseenter': function() {
1367                $(this).children('.sub-menu').stop(true, false).fadeIn(250);
1368            },
1369            'mouseleave': function() {
1370                $(this).children('.sub-menu').stop(true, false).fadeOut(250);
1371            },
1372        });
1373
1374        //Widget gallery-posts
1375        function gallery_layout() {
1376            var $container = jQuery('.isotope-layout');
1377            $container.each(function() {
1378                var $this = jQuery(this), $width, $col, $width_unit,
1379                    $height_unit;
1380                var $spacing = 10;
1381                $col = 6;
1382                if ($col != 1) {
1383                    if (parseInt($container.width()) < 768) {
1384                        $col = 4;
1385                    }
1386                    if (parseInt($container.width()) < 480) {
1387                        $col = 2;
1388                    }
1389
1390                }
1391                $width_unit = Math.floor((parseInt($container.width(), 10) -
1392                    ($col - 1) * $spacing) / $col);
1393                $height_unit = Math.floor(parseInt($width_unit, 10));
1394
1395                $this.find('.item_gallery').css({
1396                    width: $width_unit,
1397                });
1398                if ($col == 1) {
1399                    $height_unit = 'auto';
1400                }
1401                $this.find('.item_gallery .thim-gallery-popup').css({
1402                    height: $height_unit,
1403                });
1404                if ($this.find('.item_gallery').hasClass('size32')) {
1405                    if ($col > 1) {
1406                        $this.find('.item_gallery.size32 .thim-gallery-popup').
1407                            css({
1408                                height: $height_unit * 2 + $spacing,
1409                            });
1410                    }
1411                }
1412                if ($this.find('.item_gallery').hasClass('size32')) {
1413                    if ($col > 3) {
1414                        $width = $width_unit * 4 + $spacing * 3;
1415                        $this.find('.item_gallery.size32').css({
1416                            width: $width,
1417                        });
1418                    } else {
1419                        $width = $width_unit * 2 + $spacing * 1;
1420                        $this.find('.item_gallery.size32').css({
1421                            width: $width,
1422                        });
1423                    }
1424                }
1425                if ($this.find('.item_gallery').hasClass('size22') && $col != 1) {
1426                    $this.find('.item_gallery.size22 .thim-gallery-popup').css({
1427                        height: $height_unit * 2 + $spacing,
1428                    });
1429                }
1430                if ($this.find('.item_gallery').hasClass('size22') && $col != 1) {
1431                    $width = $width_unit * 2 + $spacing * 1;
1432                    $this.find('.item_gallery.size22').css({
1433                        width: $width,
1434                    });
1435                }
1436                $this.isotope({
1437                    itemSelector: '.item_gallery',
1438                    masonry     : {
1439                        columnWidth: $width_unit,
1440                        gutter     : $spacing,
1441                    },
1442                });
1443            });
1444        }
1445
1446        gallery_layout();
1447        $(window).resize(function() {
1448            gallery_layout();
1449        });
1450
1451        $(document).on('click', '.filter-controls .filter', function(e) {
1452            e.preventDefault();
1453            var filter = $(this).data('filter'),
1454                filter_wraper = $(this).
1455                    parents('.thim-widget-gallery-posts').
1456                    find('.wrapper-gallery-filter');
1457            $('.filter-controls .filter').removeClass('active');
1458            $(this).addClass('active');
1459            filter_wraper.isotope({filter: filter});
1460        });
1461
1462        $(document).on('click', '.thim-gallery-popup', function(e) {
1463            e.preventDefault();
1464            var elem = $(this),
1465                post_id = elem.attr('data-id'),
1466                data = {action: 'thim_gallery_popup', post_id: post_id};
1467            elem.addClass('loading');
1468            $.post(ajaxurl, data, function(response) {
1469                elem.removeClass('loading');
1470                $('.thim-gallery-show').append(response);
1471                if ($('.thim-gallery-show img').length > 0) {
1472                    $('.thim-gallery-show').magnificPopup({
1473                        mainClass   : 'my-mfp-zoom-in',
1474                        type        : 'image',
1475                        delegate    : 'a',
1476                        showCloseBtn: false,
1477                        gallery     : {
1478                            enabled: true,
1479                        },
1480                        callbacks   : {
1481                            open: function() {
1482                                $('body').addClass('thim-popup-active');
1483                                $.magnificPopup.instance.close = function() {
1484                                    $('.thim-gallery-show').empty();
1485                                    $('body').removeClass('thim-popup-active');
1486                                    $.magnificPopup.proto.close.call(this);
1487                                };
1488                            },
1489                        },
1490                    }).magnificPopup('open');
1491                } else {
1492                    $.magnificPopup.open({
1493                        mainClass   : 'my-mfp-zoom-in',
1494                        items       : {
1495                            src : $('.thim-gallery-show'),
1496                            type: 'inline',
1497                        },
1498                        showCloseBtn: false,
1499                        callbacks   : {
1500                            open: function() {
1501                                $('body').addClass('thim-popup-active');
1502                                $.magnificPopup.instance.close = function() {
1503                                    $('.thim-gallery-show').empty();
1504                                    $('body').removeClass('thim-popup-active');
1505                                    $.magnificPopup.proto.close.call(this);
1506                                };
1507                            },
1508                        },
1509                    });
1510                }
1511
1512            });
1513
1514        });
1515
1516        $('.widget-button.custom_style').each(function() {
1517            var elem = $(this),
1518                old_style = elem.attr('style'),
1519                hover_style = elem.data('hover');
1520            elem.on({
1521                'mouseenter': function() {
1522                    elem.attr('style', hover_style);
1523                },
1524                'mouseleave': function() {
1525                    elem.attr('style', old_style);
1526                },
1527            });
1528        });
1529
1530    });
1531
1532    $(window).load(function() {
1533
1534        $(window).resize(function() {
1535            thim_get_position_header_course_v2(
1536                $('.content_course_2 .header_single_content .bg_header'));
1537            $('.thim-carousel-instructors .instructor-item').
1538                css('min-height', '');
1539            // $('.thim-owl-carousel-post:not(.layout-3) .image').
1540            //     css('min-height', '');
1541            $('.thim-course-carousel .course-thumbnail').css('min-height', '');
1542            $('body.thim-demo-university-4 .thim-about-eduma, body.thim-demo-university-4 .thim-video-popup .video-info').
1543                css('min-height', '');
1544            if ($(window).width() < 767 || $(window).width() > 1200) {
1545                $('body.thim-demo-university-4 #sb_instagram .sbi_photo').
1546                    css('min-height', '');
1547            }
1548            thim_get_position_header_course_v2(
1549                $('.content_course_2 .header_single_content .bg_header'));
1550            thim_min_height_carousel(
1551                $('.thim-carousel-instructors .instructor-item'));
1552            thim_min_height_carousel(
1553                $('.thim-owl-carousel-post:not(.layout-3) .image'));
1554            thim_min_height_carousel(
1555                $('.thim-course-carousel .course-thumbnail'));
1556            thim_min_height_carousel(
1557                $('.thim-row-bg-border-top .thim-bg-border-top'));
1558            thim_min_height_carousel(
1559                $('.thim-testimonial-carousel-kindergarten .item'));
1560
1561            thim_min_height_carousel(
1562                $('.thim-widget-carousel-categories .item .image, .thim-widget-carousel-categories .item .content-wrapper'));
1563
1564            thim_min_height_content_area();
1565            if ($(window).width() > 767) {
1566                thim_min_height_carousel(
1567                    $('.thim-grid-posts .item-post .article-wrapper, .thim-grid-posts .item-post .article-image'));
1568                thim_min_height_carousel(
1569                    $('body.thim-demo-university-4 .thim-about-eduma, body.thim-demo-university-4 .thim-video-popup .video-info'));
1570            }
1571
1572            if ($(window).width() > 767 && $(window).width() < 1200) {
1573                if ($('body.thim-demo-university-4 .thim-icon-our-programs').length) {
1574                    var min_height = parseInt($(
1575                        'body.thim-demo-university-4 .thim-icon-our-programs').
1576                        outerHeight() / 3);
1577                    $('body.thim-demo-university-4 #sb_instagram .sbi_photo').
1578                        css('min-height', min_height);
1579                }
1580
1581            }
1582        });
1583    });
1584
1585    function thim_get_position_header_course_v2($selector) {
1586        if ($(window).width() > 1025) {
1587            $selector.css('left', '-' +
1588                ($(window).width() - $('.container').width()) / 2 + 'px');
1589            $selector.css('right', '-' +
1590                (($(window).width() - $('.container').width()) / 2 +
1591                    (45 + $('.content_course_2 .course_right').width())) +
1592                'px');
1593        } else {
1594            $selector.css('left', '-15px');
1595            $selector.css('right', '-' +
1596                (45 + $('.content_course_2 .course_right').width()) + 'px');
1597        }
1598
1599    }
1600
1601    function thim_min_height_carousel($selector) {
1602        var min_height = 0;
1603        $selector.each(function(index, val) {
1604            if ($(this).outerHeight() > min_height) {
1605                min_height = $(this).outerHeight();
1606            }
1607            if (index + 1 == $selector.length) {
1608                $selector.css('min-height', min_height);
1609            }
1610        });
1611    }
1612
1613    function thim_min_height_content_area() {
1614        var content_area = $('#main-content .content-area'),
1615            footer = $('#main-content .site-footer'),
1616            winH = $(window).height();
1617        if (content_area.length > 0 && footer.length > 0) {
1618            content_area.css('min-height', winH - footer.height());
1619        }
1620    }
1621
1622    $(document).ready(function() {
1623        $('.thim-search-light-style').
1624            append('<a class="thim-button-down thim-click-to-bottom" href="#"><i class="fa fa-chevron-down"></i></a>');
1625        $(document).on('click', '.thim-button-down', function(e) {
1626            e.preventDefault();
1627            if ($('#wpadminbar').length > 0) {
1628                var height = parseInt($('#wpadminbar').outerHeight()) +
1629                    parseInt($('.thim-search-light-style').outerHeight());
1630            } else {
1631                var height = parseInt($('.thim-search-light-style').outerHeight());
1632            }
1633            $('body, html').animate({
1634                'scrollTop': height,
1635            }, 600);
1636        });
1637
1638        var html_scroll = '<div class="scroll_slider_tab"><div class="container">' +
1639            '<a href="" class="to_bottom">' +
1640            '<svg xmlns="http://www.w3.org/2000/svg"' +
1641            'xmlns:xlink="http://www.w3.org/1999/xlink"' +
1642            'width="18px" height="28px">' +
1643            '<path fill-rule="evenodd"  fill="rgb(255, 255, 255)"' +
1644            'd="M16.169,2.687 C14.585,0.904 12.173,0.000 9.000,0.000 C5.827,0.000 3.415,0.904 1.831,2.687 C0.238,4.479 -0.000,6.580 -0.000,7.673 L-0.000,20.328 C-0.000,21.420 0.238,23.520 1.831,25.313 C3.415,27.096 5.827,28.000 9.000,28.000 C12.173,28.000 14.585,27.096 16.169,25.313 C17.762,23.520 18.000,21.420 18.000,20.328 L18.000,7.673 C18.000,6.580 17.762,4.479 16.169,2.687 ZM9.000,9.755 C8.342,9.755 7.808,9.242 7.808,8.611 L7.808,6.159 C7.808,5.528 8.342,5.015 9.000,5.015 C9.658,5.015 10.192,5.528 10.192,6.159 L10.192,8.611 C10.192,9.242 9.658,9.755 9.000,9.755 ZM17.059,20.328 C17.059,21.458 16.670,27.097 9.000,27.097 C1.330,27.097 0.941,21.458 0.941,20.328 L0.941,7.673 C0.941,6.566 1.315,1.138 8.529,0.911 L8.529,4.163 C7.578,4.369 6.866,5.185 6.866,6.159 L6.866,8.611 C6.866,9.585 7.578,10.401 8.529,10.607 L8.529,14.318 C8.529,14.568 8.740,14.770 9.000,14.770 C9.260,14.770 9.471,14.568 9.471,14.318 L9.471,10.607 C10.422,10.401 11.134,9.585 11.134,8.611 L11.134,6.159 C11.134,5.185 10.422,4.369 9.471,4.163 L9.471,0.911 C16.685,1.138 17.059,6.566 17.059,7.673 L17.059,20.328 Z"/>' +
1645            '</svg>' +
1646            '<i class="icon-chevron-down icon1"></i>' +
1647            '<i class="icon-chevron-down icon2"></i>' +
1648            '</a>' +
1649            '</div></div>';
1650        $('.have_scroll_bottom').append(html_scroll);
1651        $(document).
1652            on('click', '.have_scroll_bottom .scroll_slider_tab .to_bottom',
1653                function(e) {
1654                    e.preventDefault();
1655                    if ($('#wpadminbar').length > 0) {
1656                        var height = parseInt($('#wpadminbar').outerHeight()) +
1657                            parseInt($('.have_scroll_bottom').outerHeight());
1658                    } else {
1659                        var height = parseInt(
1660                            $('.have_scroll_bottom').outerHeight());
1661                    }
1662                    $('body, html').animate({
1663                        'scrollTop': height,
1664                    }, 600);
1665                });
1666
1667        $(document).
1668            on('click', 'body.page-template-landing-page .current_page_item>a, .thim-top-landing .widget-button',
1669                function(e) {
1670                    if ($('.thim-top-landing').length > 0) {
1671                        e.preventDefault();
1672                        if ($('#wpadminbar').length > 0) {
1673                            var height = parseInt(
1674                                $('#wpadminbar').outerHeight()) +
1675                                parseInt($('.thim-top-landing').outerHeight());
1676                        } else {
1677                            var height = parseInt(
1678                                $('.thim-top-landing').outerHeight());
1679                        }
1680                        $('body, html').animate({
1681                            'scrollTop': height,
1682                        }, 600);
1683                    }
1684                });
1685
1686    });
1687    $(document).ready(function() {
1688        //Shop filter color
1689        $('.woof_list input[data-tax="pa_color"]').each(function() {
1690            $(this).css('background-color', $(this).attr('name'));
1691        });
1692        $('.woof_list input.woof_radio_term[name="pa_color"]').each(function() {
1693            $(this).css('background-color', $(this).data('slug'));
1694        });
1695    });
1696
1697    woof_js_after_ajax_done = function() {
1698        $('.woof_list input[data-tax="pa_color"]').each(function() {
1699            $(this).css('background-color', $(this).attr('name'));
1700        });
1701        $('.woof_list input.woof_radio_term[name="pa_color"]').each(function() {
1702            $(this).css('background-color', $(this).data('slug'));
1703        });
1704
1705        if ($('#thim-product-archive').hasClass('thim-product-list')) {
1706            $('.thim-product-switch-layout>a.switchToGrid.switch-active').
1707                removeClass('switch-active');
1708            $('.thim-product-switch-layout>a.switchToList').
1709                addClass('switch-active');
1710        } else {
1711            $('.thim-product-switch-layout>a.switchToList.switch-active').
1712                removeClass('switch-active');
1713            $('.thim-product-switch-layout>a.switchToGrid').
1714                addClass('switch-active');
1715        }
1716
1717    };
1718
1719    //Code for timetable widget
1720    // TODO when using many Thim Course Categories widgets
1721    $(document).ready(function() {
1722
1723        var tab_cat_course = $('.thim-carousel-course-categories-tabs');
1724        tab_cat_course.each(function() {
1725            tab_cat_course.find('.thim-course-slider .item').click(function(e) {
1726                e.preventDefault();
1727                tab_cat_course.find('.item_content.active').
1728                    removeClass('active');
1729                tab_cat_course.find($(this).find('.title a').attr('href')).
1730                    addClass('active');
1731                tab_cat_course.find('.thim-course-slider .item.active').
1732                    removeClass('active');
1733                $(this).addClass('active');
1734            });
1735        });
1736
1737        var item_input_new = $(
1738            '.form_developer_course .content .yikes-easy-mc-form>label>input');
1739        item_input_new.focusin(function() {
1740            $(this).parent().find('span').css('font-size', '14px');
1741            $(this).parent().find('span').css('bottom', '36px');
1742        }).focusout(function() {
1743            if ($(this).val() == '') {
1744                $(this).parent().find('span').css('font-size', '0px');
1745                $(this).parent().find('span').css('bottom', '0px');
1746            }
1747        });
1748
1749        //Add class for nav-tabs single course
1750        var tab_course = $('.course-tabs .nav-tabs>li').length;
1751        if (tab_course > 0) {
1752            $('.course-tabs .nav-tabs>li').addClass('thim-col-' + tab_course);
1753        }
1754
1755        $('.thim-widget-timetable .timetable-item ').each(function() {
1756            var elem = $(this),
1757                old_style = elem.attr('style'),
1758                hover_style = elem.data('hover');
1759            elem.on({
1760                'mouseenter': function() {
1761                    elem.attr('style', hover_style);
1762                },
1763                'mouseleave': function() {
1764                    elem.attr('style', old_style);
1765                },
1766            });
1767        });
1768
1769        //Resize window when click certificate tab on page profile
1770        $('.profile-tabs').each(function() {
1771            var elem = $(this);
1772            elem.find('a[href^=#user_certificates]').on('click', function() {
1773                $(window).resize();
1774                if ($('.canvas-container').length > 0) {
1775                    $('.canvas-container').trigger('click');
1776                }
1777            });
1778        });
1779
1780        if (typeof LP != 'undefined') {
1781            LP.Hook.addAction('learn_press_receive_message', function() {
1782                var lesson_title = $(
1783                    '.course-item.item-current .course-item-title').text(),
1784                    lesson_index = $('.course-item.item-current .index').text();
1785                $('#popup-header .popup-title').
1786                    html('<span class="index">' + lesson_index + '</span>' +
1787                        lesson_title);
1788            });
1789        }
1790
1791        $('.thim-video-popup .button-popup').on('click', function(e) {
1792            var item = $(this);
1793            e.preventDefault();
1794            $.magnificPopup.open({
1795                items       : {
1796                    src : item.parent().parent().find('.video-content'),
1797                    type: 'inline',
1798                },
1799                showCloseBtn: false,
1800                callbacks   : {
1801                    open: function() {
1802                        $('body').addClass('thim-popup-active');
1803                        $.magnificPopup.instance.close = function() {
1804                            $('body').removeClass('thim-popup-active');
1805                            $.magnificPopup.proto.close.call(this);
1806                        };
1807                    },
1808                },
1809            });
1810        });
1811
1812        $('.mc4wp-form #mc4wp_email').on('focus', function() {
1813            $(this).parents('.mc4wp-form').addClass('focus-input');
1814        }).on('focusout', function() {
1815            $(this).
1816                parents('.mc4wp-form.focus-input').
1817                removeClass('focus-input');
1818        });
1819
1820        $(document).
1821            on('click', '.button-retake-course, .button-finish-course',
1822                function() {
1823                    $('.thim-box-loading-container.visible').
1824                        removeClass('visible');
1825                });
1826
1827        $(document).on('click', '.button-load-item', function() {
1828            $('#course-curriculum-popup').addClass('loading');
1829            $('.thim-box-loading-container').addClass('visible');
1830        });
1831
1832        //Thim simple slider
1833        $('.thim-event-simple-slider').thim_simple_slider({
1834            item        : 3,
1835            itemActive  : 1,
1836            itemSelector: '.item-event',
1837            align       : 'right',
1838            pagination  : true,
1839            navigation  : true,
1840            height      : 392,
1841            activeWidth : 1170,
1842            itemWidth   : 800,
1843            prev_text   : '<i class="fa fa-long-arrow-left"></i>',
1844            next_text   : '<i class="fa fa-long-arrow-right"></i>',
1845        });
1846
1847        $('.width-navigation .menu-main-menu>li.menu-item').last().addClass('last-menu-item');
1848
1849        //add mac-os to body class
1850        if (navigator.userAgent.indexOf('Mac') > 0) {
1851            $('body').addClass('mac-os');
1852        }
1853        //add i-os to body class
1854        if (navigator.platform.match(/(iPhone|iPod|iPad)/i)) {
1855            $('body').addClass('i-os');
1856        }
1857
1858        //Set padding for demo vc RTL
1859        setTimeout(function() {
1860            $(window).trigger('resize');
1861        }, 1000);
1862        $(window).resize(function() {
1863            var get_padding1 = parseFloat(
1864                $('body.rtl .vc_row-has-fill[data-vc-full-width="true"]').
1865                    css('left')),
1866                get_padding2 = parseFloat(
1867                    $('body.rtl .vc_row-no-padding[data-vc-full-width="true"]').
1868                        css('left'));
1869            if (get_padding1 != 'undefined') {
1870                $('body.rtl .vc_row-has-fill[data-vc-full-width="true"]').
1871                    css({'right': get_padding1, 'left': ''});
1872            }
1873            if (get_padding2 != 'undefined') {
1874                $('body.rtl .vc_row-no-padding[data-vc-full-width="true"]').
1875                    css({'right': get_padding2, 'left': ''});
1876            }
1877        });
1878
1879        //Course archive search filter
1880        var search_time_out = null;
1881        $(document).on('keydown', 'body:not(.course-filter-active) .course-search-filter',
1882            function(event) {
1883                if (event.ctrlKey) {
1884                    return;
1885                }
1886
1887                if (event.keyCode === 13) {
1888                    event.preventDefault();
1889                    return false;
1890                }
1891
1892                if ((event.keyCode >= 48 && event.keyCode <= 90) || event.keyCode === 8 || event.keyCode === 32) {
1893                    var elem = $(this),
1894                        keyword = event.keyCode === 8 ? elem.val() : elem.val() + event.key,
1895                        $body = $('body');
1896
1897                    if (search_time_out != null) clearTimeout(search_time_out);
1898
1899                    search_time_out = setTimeout(function() {
1900                        elem.attr('disabled', 'disabled');
1901                        search_time_out = null;
1902
1903                        $('#thim-course-archive').addClass('loading');
1904
1905                        var archive = elem.parents('#lp-archive-courses'),
1906                            cateArr = [];
1907
1908                        if ($body.hasClass('category')) {
1909                            var bodyClass = $body.attr('class'),
1910                                cateClass = bodyClass.match(/category\-\d+/gi)[0],
1911                                cateID = cateClass.split('-').pop();
1912
1913                            cateArr.push(cateID);
1914                        }
1915
1916                        if ($('.list-cate-filter').length > 0) {
1917                            $('.list-cate-filter input.filtered').each(function() {
1918
1919                                if ($(this).val() !== cateID) {
1920                                    cateArr.push($(this).val());
1921                                }
1922                            });
1923                        }
1924
1925                        $.ajax({
1926                            url     : $('#lp-archive-courses').data('allCoursesUrl'),
1927                            type    : 'POST',
1928                            dataType: 'html',
1929                            data    : {
1930                                s                 : keyword,
1931                                ref               : 'course',
1932                                post_type         : 'lp_course',
1933                                course_orderby    : $('.thim-course-order > select').val(),
1934                                course_cate_filter: cateArr,
1935                                course_paged      : 1,
1936                            },
1937                            success : function(html) {
1938                                var archive_html = $(html).find('#lp-archive-courses').html();
1939                                archive.html(archive_html);
1940                                $('.course-search-filter').val(keyword).trigger('focus');
1941                                $body.removeClass('course-filter-active');
1942                                $('.filter-loading').remove();
1943                            },
1944                            error   : function() {
1945                                $body.removeClass('course-filter-active');
1946                                $('.filter-loading').remove();
1947                            },
1948                        });
1949
1950                    }, 1000);
1951                }
1952            });
1953
1954        $(document).on('click', '.button-load-item', function() {
1955            can_escape = false;
1956        });
1957
1958        $(document).on('keydown', function(event) {
1959            if (event.keyCode == 27) {
1960                if (typeof can_escape !== 'undefined') {
1961                    if (can_escape === false) {
1962                        event.preventDefault();
1963                    }
1964                }
1965            }
1966
1967        });
1968
1969        //Add view password into checkbox field
1970        $('.login-password').append('<span id="show_pass"><i class="fa fa-eye"></i></span>');
1971        $(document).on('click', '#show_pass', function() {
1972            var el = $(this),
1973                thim_pass = el.parents('.login-password').find('>input');
1974            if (el.hasClass('active')) {
1975                thim_pass.attr('type', 'password');
1976            } else {
1977                thim_pass.attr('type', 'text');
1978            }
1979            el.toggleClass('active');
1980        });
1981
1982        $(document).
1983            on('click',
1984                '.content_course_2 .course_right .menu_course ul li a, .content_course_2 .thim-course-menu-landing .thim-course-landing-tab li a',
1985                function() {
1986                    $('html, body').animate({
1987                        scrollTop: $($(this).attr('href')).offset().top,
1988                    }, 1000);
1989                });
1990
1991        $(window).resize(function() {
1992            if ($(window).width() > 600) {
1993                $('footer#colophon.has-footer-bottom').
1994                    css('margin-bottom', $('.footer-bottom').height());
1995            }
1996            if ($(window).width() < 768) {
1997                $('body.course-item-popup').
1998                    addClass('full-screen-content-item');
1999                $('body.ltr.course-item-popup #learn-press-course-curriculum').
2000                    css('left', '-300px');
2001                $('body.ltr.course-item-popup #learn-press-content-item').
2002                    css('left', '0');
2003                $('body.rtl.course-item-popup #learn-press-course-curriculum').
2004                    css('right', 'auto');
2005                $('body.rtl.course-item-popup #learn-press-content-item').
2006                    css('right', 'auto');
2007            }
2008        });
2009
2010    });
2011
2012})(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.