1/* 2* Re-structure JS 3* */ 4(function($) { 5 'use strict'; 6 7 /* 8 * Helper vars 9 * */ 10 11 /* 12 * Helper functions 13 * */ 14 function thim_get_url_parameters(sParam) { 15 var sPageURL = window.location.search.substring(1); 16 17 var sURLVariables = sPageURL.split('&'); 18 for (var i = 0; i < sURLVariables.length; i++) { 19 var sParameterName = sURLVariables[i].split('='); 20 21 if (sParameterName[0] === sParam) { 22 return sParameterName[1]; 23 } 24 } 25 26 } 27 28 var thim_eduma = { 29 ready: function() { 30 this.register_ajax(); 31 this.login_ajax(); 32 this.login_form_popup(); 33 this.form_submission_validate(); 34 this.thim_TopHeader(); 35 this.ctf7_input_effect(); 36 this.thim_course_filter(); 37 this.mobile_menu_toggle(); 38 }, 39 40 load: function() { 41 this.thim_menu(); 42 this.thim_carousel(); 43 this.thim_contentslider(); 44 this.counter_box(); 45 }, 46 47 resize: function() { 48 49 }, 50 51 validate_form: function(form) { 52 var valid = true, 53 email_valid = /[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}/igm; 54 55 form.find('input.required').each(function() { 56 // Check empty value 57 if (!$(this).val()) { 58 $(this).addClass('invalid'); 59 valid = false; 60 } 61 62 // Uncheck 63 if ($(this).is(':checkbox') && !$(this).is(':checked')) { 64 $(this).addClass('invalid'); 65 valid = false; 66 } 67 68 // Check email format 69 if ('email' === $(this).attr('type')) { 70 if (!email_valid.test($(this).val())) { 71 $(this).addClass('invalid'); 72 valid = false; 73 } 74 } 75 76 // Check captcha 77 if ($(this).hasClass('captcha-result')) { 78 let captcha_1 = parseInt($(this).data('captcha1')), 79 captcha_2 = parseInt($(this).data('captcha2')); 80 81 if ((captcha_1 + captcha_2) !== parseInt($(this).val())) { 82 $(this).addClass('invalid').val(''); 83 valid = false; 84 } 85 } 86 }); 87 88 // Check repeat password 89 if (form.hasClass('auto_login')) { 90 let $pw = form.find('input[name=password]'), 91 $repeat_pw = form.find('input[name=repeat_password]'); 92 93 if ($pw.val() !== $repeat_pw.val()) { 94 $pw.addClass('invalid'); 95 $repeat_pw.addClass('invalid'); 96 valid = false; 97 } 98 } 99 100 $('form input.required').on('focus', function() { 101 $(this).removeClass('invalid'); 102 }); 103 104 return valid; 105 }, 106 107 login_form_popup: function() { 108 $(document).on('click', 'body:not(".loggen-in") .thim-button-checkout', 109 function(e) { 110 if ($(window).width() > 767) { 111 e.preventDefault(); 112 if ($('#thim-popup-login').length) { 113 $('body').addClass('thim-popup-active'); 114 $('#thim-popup-login').addClass('active'); 115 } else { 116 var redirect = $(this).data('redirect'); 117 window.location = redirect; 118 } 119 } else { 120 e.preventDefault(); 121 var redirect = $(this).data('redirect'); 122 window.location = redirect; 123 } 124 }); 125 126 $(document).on('click', '#thim-popup-login .close-popup', function(event) { 127 event.preventDefault(); 128 $('body').removeClass('thim-popup-active'); 129 $('#thim-popup-login').removeClass(); 130 }); 131 132 $('body .thim-login-popup a.js-show-popup').on('click', function(event) { 133 event.preventDefault(); 134 135 let $popup = $('#thim-popup-login'); 136 $('body').addClass('thim-popup-active'); 137 $popup.addClass('active'); 138 if ($(this).hasClass('login')) { 139 $popup.addClass('sign-in'); 140 } else { 141 $popup.addClass('sign-up'); 142 } 143 }); 144 145 $('#thim-popup-login .link-bottom a').on('click', function(e) { 146 e.preventDefault(); 147 148 if ($(this).hasClass('login')) { 149 $('#thim-popup-login').removeClass('sign-up').addClass('sign-in'); 150 } else { 151 $('#thim-popup-login').removeClass('sign-in').addClass('sign-up'); 152 } 153 }); 154 155 // Show login popup when click to LP buttons 156 $('body:not(".logged-in") .enroll-course .button-enroll-course, body:not(".logged-in") form.purchase-course:not(".guest_checkout") .button:not(.button-add-to-cart)'). 157 on('click', function(e) { 158 e.preventDefault(); 159 160 // if ($(window).width() > 1024) { 161 if ($('body').hasClass('thim-popup-feature')) { 162 $('.thim-link-login.thim-login-popup .login').trigger('click'); 163 } else { 164 window.location.href = $(this).parent().find('input[name=redirect_to]').val(); 165 } 166 // } else { 167 // window.location.href = $(this).parent().find('input[name=redirect_to]').val(); 168 // } 169 }); 170 171 $(document).on('click', '#thim-popup-login', function(e) { 172 if ($(e.target).attr('id') === 'thim-popup-login') { 173 $('body').removeClass('thim-popup-active'); 174 $('#thim-popup-login').removeClass(); 175 } 176 }); 177 }, 178 179 register_ajax: function() { 180 $('#thim-popup-login form[name=registerformpopup]').on('submit', function(e) { 181 e.preventDefault(); 182 183 if (!thim_eduma.validate_form($(this))) { 184 return false;
185 } 186 187 var $form = $(this), 188 data = { 189 action : 'thim_register_ajax', 190 data : $form.serialize() + '&wp-submit=' + 191 $form.find('input[type=submit]').val(), 192 register_security: $form.find('#register_security'). 193 val(), 194 }, 195 redirect_url = $form.find('input[name=redirect_to]').val(), 196 $elem = $('#thim-popup-login .thim-login-container'); 197 198 $elem.addClass('loading'); 199 $elem.find('.message').slideDown().remove(); 200 201 $.ajax({ 202 type : 'POST', 203 url : ajaxurl, 204 data : data, 205 success: function(response) { 206 $elem.removeClass('loading'); 207 if (typeof response.data !== 'undefined') { 208 $elem.find('.popup-message').html(response.data.message); 209 } 210 if (response.success === true) { 211 if ($form.hasClass('auto_login')) { 212 window.location.href = redirect_url; 213 } 214 } else { 215 var $captchaIframe = $('#thim-popup-login .gglcptch iframe'); 216 if ($captchaIframe.length > 0) { 217 $captchaIframe.attr('src', $captchaIframe.attr('src')); // reload iframe 218 } 219 } 220 }, 221 }); 222 }); 223 }, 224 225 login_ajax: function() { 226 $('#thim-popup-login form[name=loginpopopform]').submit(function(event) { 227 event.preventDefault(); 228 229 if (!thim_eduma.validate_form($(this))) { 230 return false; 231 } 232 233 var form = $(this), 234 $elem = $('#thim-popup-login .thim-login-container'), 235 wp_submit = $elem.find('input[type=submit]').val(); 236 237 $elem.addClass('loading'); 238 $elem.find('.message').slideDown().remove(); 239 240 var data = { 241 action: 'thim_login_ajax', 242 data : form.serialize() + '&wp-submit=' + wp_submit, 243 }; 244 245 $.post(ajaxurl, data, function(response) { 246 try { 247 response = JSON.parse(response); 248 $elem.find('.thim-login').append(response.message); 249 if (response.code == '1') { 250 if (response.redirect) { 251 if (window.location.href == response.redirect) { 252 location.reload(); 253 } else { 254 window.location.href = response.redirect; 255 } 256 } else { 257 location.reload(); 258 } 259 } else { 260 var $captchaIframe = $('#thim-popup-login .gglcptch iframe'); 261 if ($captchaIframe.length > 0) { 262 $captchaIframe.attr('src', $captchaIframe.attr('src')); // reload iframe 263 } 264 } 265 } catch (e) { 266 return false; 267 } 268 $elem.removeClass('loading'); 269 }); 270 271 return false; 272 }); 273 }, 274 275 form_submission_validate: function() { 276 // Form login 277 $('.form-submission-login form[name=loginform]').on('submit', function(e) { 278 if (!thim_eduma.validate_form($(this))) { 279 e.preventDefault(); 280 return false; 281 } 282 }); 283 284 // Form register 285 $('.form-submission-register form[name=registerform]').on('submit', function(e) { 286 if (!thim_eduma.validate_form($(this))) { 287 e.preventDefault(); 288 return false;
289 } 290 }); 291 292 // Form lost password 293 $('.form-submission-lost-password form[name=lostpasswordform]').on('submit', function(e) { 294 if (!thim_eduma.validate_form($(this))) { 295 e.preventDefault(); 296 return false; 297 } 298 }); 299 }, 300 301 thim_TopHeader: function() { 302 var header = $('#masthead'), 303 height_sticky_header = header.outerHeight(true), 304 content_pusher = $('#wrapper-container .content-pusher'), 305 top_site_main = $('#wrapper-container .top_site_main'); 306 307 if (header.hasClass('header_overlay')) { // Header overlay 308 top_site_main.css({'padding-top': height_sticky_header + 'px'}); 309 $(window).resize(function() { 310 let height_sticky_header = header.outerHeight(true); 311 top_site_main.css({'padding-top': height_sticky_header + 'px'}); 312 }); 313 } else { // Header default 314 content_pusher.css({'padding-top': height_sticky_header + 'px'}); 315 $(window).resize(function() { 316 let height_sticky_header = header.outerHeight(true); 317 content_pusher.css({'padding-top': height_sticky_header + 'px'}); 318 }); 319 320 } 321 }, 322 323 ctf7_input_effect: function() { 324 let $ctf7_edtech = $('.form_developer_course'), 325 $item_input = $ctf7_edtech.find('.field_item input'), 326 $submit_wrapper = $ctf7_edtech.find('.submit_row'); 327 328 $item_input.focus(function() { 329 $(this).parent().addClass('focusing'); 330 }).blur(function() { 331 $(this).parent().removeClass('focusing'); 332 }); 333 334 $submit_wrapper.on('click', function() { 335 $(this).closest('form').submit(); 336 }); 337 }, 338 339 thim_course_filter: function() { 340 let $body = $('body'); 341 342 if (!$body.hasClass('learnpress') || !$body.hasClass('archive')) { 343 return; 344 } 345 346 let ajaxCall = function(data) { 347 return $.ajax({ 348 url : $('#lp-archive-courses').data('allCoursesUrl'), //using for course category page 349 type : 'POST', 350 data : data, 351 dataType : 'html', 352 beforeSend: function() { 353 $('#thim-course-archive').addClass('loading'); 354 }, 355 }).fail(function() { 356 $('#thim-course-archive').removeClass('loading'); 357 }).done(function(data) { 358 /*if (typeof history.pushState === 'function') { 359 history.pushState(orderby, null, url); 360 }*/ 361 let $document = $($.parseHTML(data)); 362 363 $('#thim-course-archive').replaceWith($document.find('#thim-course-archive')); 364 $('.learn-press-pagination ul.page-numbers'). 365 replaceWith($document.find('.learn-press-pagination ul.page-numbers')); 366 $('.thim-course-top .course-index span'). 367 replaceWith($document.find('.thim-course-top .course-index span')); 368 }); 369 }; 370 371 let sendData = { 372 s : '', 373 ref : 'course', 374 post_type : 'lp_course', 375 course_orderby: 'newly-published', 376 course_paged : 1, 377 }; 378 379 /* 380 * Handle courses sort ajax 381 * */ 382 $(document).on('change', '.thim-course-order > select', function() { 383 sendData.s = $('.courses-searching .course-search-filter').val(); 384 sendData.course_orderby = $(this).val(); 385 sendData.course_paged = 1; 386 387 ajaxCall(sendData); 388 }); 389 390 /* 391 * Handle pagination ajax 392 * */ 393 394 $(document).on('click', '#lp-archive-courses > .learn-press-pagination a.page-numbers', function(e) { 395 e.preventDefault(); 396 397 $('html, body').animate({ 398 'scrollTop': $('.site-content').offset().top - 140, 399 }, 1000); 400 401 let pageNum = parseInt($(this).text()), 402 paged = pageNum ? pageNum : 1, 403 cateArr = [], instructorArr = [], 404 cpage = $('.learn-press-pagination.navigation.pagination ul.page-numbers li span.page-numbers.current').text(), 405 isNext = $(this).hasClass('next') && $(this).hasClass('page-numbers'), 406 isPrev = $(this).hasClass('prev') && $(this).hasClass('page-numbers'); 407 if(!pageNum){ 408 if(isNext){ 409 paged = parseInt(cpage)+1; 410 } 411 if(isPrev){ 412 paged = parseInt(cpage)-1; 413 } 414 } 415 416 $('form.thim-course-filter').find('input.filtered').each(function() { 417 switch ($(this).attr('name')) { 418 case 'course-cate-filter': 419 cateArr.push($(this).val()); 420 break; 421 case 'course-instructor-filter': 422 instructorArr.push($(this).val()); 423 break; 424 case 'course-price-filter': 425 sendData.course_price_filter = $(this).val(); 426 break; 427 default: 428 break; 429 } 430 }); 431 432 if ($body.hasClass('category') && $('.list-cate-filter').length <= 0) { 433 let bodyClass = $body.attr('class'), 434 cateClass = bodyClass.match(/category\-\d+/gi)[0], 435 cateID = cateClass.split('-').pop(); 436 437 cateArr.push(cateID); 438 } 439 440 sendData.course_cate_filter = cateArr; 441 sendData.course_instructor_filter = instructorArr; 442 443 sendData.s = $('.courses-searching .course-search-filter').val(); 444 sendData.course_orderby = $('.thim-course-order > select').val(); 445 sendData.course_paged = paged; 446 447 ajaxCall(sendData); 448 }); 449 450 /* 451 * Handle filter form click ajax 452 * */ 453 $('form.thim-course-filter').on('submit', function(e) { 454 e.preventDefault(); 455 456 let formData = $(this).serializeArray(), 457 cateArr = [], instructorArr = []; 458 459 if (!formData.length) { 460 return; 461 } 462 463 $('html, body').animate({ 464 'scrollTop': $('.site-content').offset().top - 140, 465 }, 1000); 466 467 $(this).find('input').each(function() { 468 let form_input = $(this); 469 form_input.removeClass('filtered'); 470 471 if (form_input.is(':checked')) { 472 form_input.addClass('filtered'); 473 } 474 }); 475 476 $.each(formData, function(index, filter) { 477 switch (filter.name) { 478 case 'course-cate-filter': 479 cateArr.push(filter.value); 480 break; 481 case 'course-instructor-filter': 482 instructorArr.push(filter.value); 483 break; 484 case 'course-price-filter':
485 sendData.course_price_filter = filter.value; 486 break; 487 default: 488 break; 489 } 490 }); 491 492 if ($body.hasClass('category') && $('.list-cate-filter').length <= 0) { 493 let bodyClass = $body.attr('class'), 494 cateClass = bodyClass.match(/category\-\d+/gi)[0], 495 cateID = cateClass.split('-').pop(); 496 497 cateArr.push(cateID); 498 } 499 500 sendData.course_cate_filter = cateArr; 501 sendData.course_instructor_filter = instructorArr; 502 sendData.course_paged = 1; 503 504 ajaxCall(sendData); 505 }); 506 }, 507 508 mobile_menu_toggle: function() { 509 $(document).on('click', '.menu-mobile-effect', function(e) { 510 e.stopPropagation(); 511 $('body').toggleClass('mobile-menu-open'); 512 }); 513 514 $(document).on('click', '.mobile-menu-wrapper', function(e) { 515 $('body').removeClass('mobile-menu-open'); 516 }); 517 518 $(document).on('click', '.mobile-menu-inner', function(e) { 519 e.stopPropagation(); 520 }); 521 }, 522 523 thim_menu: function() { 524 525 //Add class for masthead 526 var $header = $('#masthead.sticky-header'), 527 off_Top = ($('.content-pusher').length > 0) ? $('.content-pusher'). 528 offset().top : 0, 529 menuH = $header.outerHeight(), 530 latestScroll = 0; 531 if ($(window).scrollTop() > 2) { 532 $header.removeClass('affix-top').addClass('affix'); 533 } 534 $(window).scroll(function() { 535 var current = $(this).scrollTop(); 536 if (current > 2) { 537 $header.removeClass('affix-top').addClass('affix'); 538 } else { 539 $header.removeClass('affix').addClass('affix-top'); 540 } 541 542 if (current > latestScroll && current > menuH + off_Top) { 543 if (!$header.hasClass('menu-hidden')) { 544 $header.addClass('menu-hidden'); 545 } 546 } else { 547 if ($header.hasClass('menu-hidden')) { 548 $header.removeClass('menu-hidden'); 549 } 550 } 551 552 latestScroll = current; 553 }); 554 555 //Submenu position 556 $('.wrapper-container:not(.mobile-menu-open) .site-header .navbar-nav > .menu-item').each(function() { 557 if ($('>.sub-menu', this).length <= 0) { 558 return; 559 } 560 561 let elm = $('>.sub-menu', this), 562 off = elm.offset(), 563 left = off.left, 564 width = elm.width(); 565 566 let navW = $('.thim-nav-wrapper').width(), 567 isEntirelyVisible = (left + width <= navW); 568 569 if (!isEntirelyVisible) { 570 elm.addClass('dropdown-menu-right'); 571 } else { 572 let subMenu2 = elm.find('>.menu-item>.sub-menu'); 573 574 if (subMenu2.length <= 0) { 575 return; 576 } 577 578 let off = subMenu2.offset(), 579 left = off.left, 580 width = subMenu2.width(); 581 582 let isEntirelyVisible = (left + width <= navW); 583 584 if (!isEntirelyVisible) { 585 elm.addClass('dropdown-left-side'); 586 } 587 } 588 }); 589 590 //Show submenu when hover 591 // var $menuItem = $( 592 // '.wrapper-container:not(.mobile-menu-open) .site-header .navbar-nav >li,' + 593 // '.wrapper-container:not(.mobile-menu-open) .site-header .navbar-nav li,' + 594 // '.site-header .navbar-nav li ul li'); 595 // 596 // $menuItem.on({ 597 // 'mouseenter': function() { 598 // $(this).children('.sub-menu').stop(true, false).fadeIn(250); 599 // }, 600 // 'mouseleave': function() { 601 // $(this). 602 // children('.sub-menu'). 603 // stop(true, false). 604 // fadeOut(250); 605 // }, 606 // }); 607 608 let $headerLayout = $('header#masthead'); 609 let magicLine = function() { 610 if ($(window).width() > 768) { 611 //Magic Line 612 var menu_active = $( 613 '#masthead .navbar-nav>li.menu-item.current-menu-item,#masthead .navbar-nav>li.menu-item.current-menu-parent, #masthead .navbar-nav>li.menu-item.current-menu-ancestor'); 614 if (menu_active.length > 0) { 615 menu_active.before('<span id="magic-line"></span>'); 616 var menu_active_child = menu_active.find( 617 '>a,>span.disable_link,>span.tc-menu-inner'), 618 menu_left = menu_active.position().left, 619 menu_child_left = parseInt(menu_active_child.css('padding-left')), 620 magic = $('#magic-line'); 621 622 magic.width(menu_active_child.width()). 623 css('left', Math.round(menu_child_left + menu_left)). 624 data('magic-width', magic.width()). 625 data('magic-left', magic.position().left); 626 627 } else { 628 var first_menu = $( 629 '#masthead .navbar-nav>li.menu-item:first-child'); 630 first_menu.before('<span id="magic-line"></span>'); 631 var magic = $('#magic-line'); 632 magic.data('magic-width', 0); 633 } 634 635 var nav_H = parseInt($('.site-header .navigation').outerHeight()); 636 magic.css('bottom', nav_H - (nav_H - 90) / 2 - 64); 637 638 $('#masthead .navbar-nav>li.menu-item').on({ 639 'mouseenter': function() { 640 var elem = $(this). 641 find('>a,>span.disable_link,>span.tc-menu-inner'), 642 new_width = elem.width(), 643 parent_left = elem.parent().position().left, 644 left = parseInt(elem.css('padding-left')); 645 if (!magic.data('magic-left')) { 646 magic.css('left', Math.round(parent_left + left)); 647 magic.data('magic-left', 'auto'); 648 } 649 magic.stop().animate({ 650 left : Math.round(parent_left + left), 651 width: new_width, 652 }); 653 }, 654 'mouseleave': function() { 655 magic.stop().animate({ 656 left : magic.data('magic-left'), 657 width: magic.data('magic-width'), 658 }); 659 }, 660 }); 661 } 662 }; 663 664 if (!$headerLayout.hasClass('header_v4')) { 665 magicLine(); 666 } 667 668 var subMenuPosition = function(menuItem) { 669 var $menuItem = menuItem, 670 $container = $menuItem.closest('.container, .header_full'), 671 $subMenu = $menuItem.find('>.sub-menu'), 672 $menuItemWidth = $menuItem.width(), 673 $containerWidth = $container.width(), 674 $subMenuWidth = $subMenu.width(), 675 $subMenuDistance = $subMenuWidth / 2, 676 paddingContainer = 15; 677 678 }; 679 }, 680 681 thim_carousel: function($scope) { 682 if (jQuery().owlCarousel) { 683 $('.thim-gallery-images').owlCarousel({ 684 autoPlay : false, 685 singleItem : true, 686 stopOnHover: true, 687 pagination : true, 688 autoHeight : false, 689 }); 690 691 $('.thim-carousel-wrapper').each(function() { 692 var item_visible = $(this).data('visible') ? parseInt( 693 $(this).data('visible')) : 4, 694 item_desktopsmall = $(this).data('desktopsmall') ? parseInt( 695 $(this).data('desktopsmall')) : item_visible, 696 itemsTablet = $(this).data('itemtablet') ? parseInt( 697 $(this).data('itemtablet')) : 2, 698 itemsMobile = $(this).data('itemmobile') ? parseInt( 699 $(this).data('itemmobile')) : 1, 700 pagination = !!$(this).data('pagination'), 701 navigation = !!$(this).data('navigation'), 702 autoplay = $(this).data('autoplay') ? parseInt( 703 $(this).data('autoplay')) : false, 704 navigation_text = ($(this).data('navigation-text') && 705 $(this).data('navigation-text') === '2') ? [ 706 '<i class=\'fa fa-long-arrow-left \'></i>', 707 '<i class=\'fa fa-long-arrow-right \'></i>', 708 ] : [ 709 '<i class=\'fa fa-chevron-left \'></i>', 710 '<i class=\'fa fa-chevron-right \'></i>', 711 ]; 712 713 $(this).owlCarousel({ 714 items : item_visible, 715 itemsDesktop : [1200, item_visible], 716 itemsDesktopSmall: [1024, item_desktopsmall], 717 itemsTablet : [768, itemsTablet], 718 itemsMobile : [480, itemsMobile], 719 navigation : navigation, 720 pagination : pagination, 721 lazyLoad : true, 722 autoPlay : autoplay, 723 navigationText : navigation_text, 724 }); 725 }); 726 727 $('.thim-carousel-course-categories .thim-course-slider, .thim-carousel-course-categories-tabs .thim-course-slider'). 728 each(function() { 729 var item_visible = $(this).data('visible') ? parseInt($(this).data('visible')) : 7, 730 item_desktop = $(this).data('desktop') ? parseInt($(this).data('desktop')) : 7, 731 item_desktopsmall = $(this).data('desktopsmall') 732 ? parseInt($(this).data('desktopsmall')) 733 : 6, 734 item_tablet = $(this).data('tablet') ? parseInt($(this).data('tablet')) : 4, 735 item_mobile = $(this).data('mobile') ? parseInt($(this).data('mobile')) : 2, 736 pagination = !!$(this).data('pagination'), 737 navigation = !!$(this).data('navigation'), 738 autoplay = $(this).data('autoplay') ? parseInt($(this).data('autoplay')) : false, 739 is_rtl = $('body').hasClass('rtl'); 740 741 $(this).owlCarousel({ 742 items : item_visible, 743 itemsDesktop : [1800, item_desktop], 744 itemsDesktopSmall: [1024, item_desktopsmall], 745 itemsTablet : [768, item_tablet], 746 itemsMobile : [480, item_mobile], 747 navigation : navigation, 748 pagination : pagination, 749 autoPlay : autoplay, 750 navigationText : [ 751 '<i class=\'fa fa-chevron-left \'></i>', 752 '<i class=\'fa fa-chevron-right \'></i>', 753 ], 754 }); 755 }); 756 } 757 }, 758 759 thim_contentslider: function($scope) { 760 $('.thim-testimonial-slider').each(function() { 761 var elem = $(this), 762 item_visible = parseInt(elem.data('visible')), 763 item_time = parseInt(elem.data('time')), 764 autoplay = elem.data('auto') ? true : false, 765 item_ratio = elem.data('ratio') ? elem.data('ratio') : 1.18, 766 item_padding = elem.data('padding') ? elem.data('padding') : 15, 767 item_activepadding = elem.data('activepadding') ? elem.data( 768 'activepadding') : 0, 769 item_width = elem.data('width') ? elem.data('width') : 100, 770 mousewheel = !!elem.data('mousewheel'); 771 772 var testimonial_slider = $(this).thimContentSlider({ 773 items : elem, 774 itemsVisible : item_visible, 775 mouseWheel : mousewheel, 776 autoPlay : autoplay, 777 pauseTime : item_time, 778 itemMaxWidth : item_width, 779 itemMinWidth : item_width, 780 activeItemRatio : item_ratio, 781 activeItemPadding: item_activepadding, 782 itemPadding : item_padding, 783 }); 784 785 }); 786 }, 787 788 counter_box: function() { 789 if (jQuery().waypoint) { 790 jQuery('.counter-box').waypoint(function() { 791 jQuery(this).find('.display-percentage').each(function() { 792 var percentage = jQuery(this).data('percentage'); 793 jQuery(this). 794 countTo({ 795 from : 0, 796 to : percentage, 797 refreshInterval: 40, 798 speed : 2000, 799 }); 800 }); 801 }, { 802 triggerOnce: true, 803 offset : '80%', 804 }); 805 } 806 } 807 808 }; 809 810 $(document).ready(function() { 811 thim_eduma.ready(); 812 }); 813 814 $(window).load(function() { 815 thim_eduma.load(); 816 }); 817 818 $(window).resize(function() { 819 thim_eduma.resize(); 820 }); 821 822 $(window).on('elementor/frontend/init', function() { 823 elementorFrontend.hooks.addAction('frontend/element_ready/thim-carousel-post.default', 824 thim_eduma.thim_carousel); 825 826 elementorFrontend.hooks.addAction('frontend/element_ready/thim-courses.default', 827 thim_eduma.thim_carousel); 828 829 elementorFrontend.hooks.addAction('frontend/element_ready/thim-course-categories.default', 830 thim_eduma.thim_carousel); 831 832 elementorFrontend.hooks.addAction('frontend/element_ready/thim-our-team.default', 833 thim_eduma.thim_carousel); 834 835 elementorFrontend.hooks.addAction('frontend/element_ready/thim-gallery-images.default', 836 thim_eduma.thim_carousel); 837 838 elementorFrontend.hooks.addAction('frontend/element_ready/thim-list-instructors.default', 839 thim_eduma.thim_carousel); 840 841 elementorFrontend.hooks.addAction('frontend/element_ready/thim-testimonials.default', 842 thim_eduma.thim_contentslider); 843 844 elementorFrontend.hooks.addAction('frontend/element_ready/thim-counters-box.default', 845 thim_eduma.counter_box); 846 }); 847})(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.