PageSourceSearch

https://diamantemente.es/wp-content/themes/eduma/assets/js/thim-scripts.js?ver=6ac6efff2c392

js diamantemente.es collected 2026-10-08 01:22:00 UTC 30,649 bytes, 943 lines download raw bytes

1/*
2* Re-structure JS
3* */
4(function ($) {
5	'use strict'
6
7	/*
8	* Helper functions
9	* */
10	function thim_get_url_parameters(sParam) {
11		var sPageURL = window.location.search.substring(1)
12
13		var sURLVariables = sPageURL.split('&')
14		for (var i = 0; i < sURLVariables.length; i++) {
15			var sParameterName = sURLVariables[i].split('=')
16
17			if (sParameterName[0] === sParam) {
18				return sParameterName[1]
19			}
20		}
21
22	}
23
24	var thim_eduma = {
25		el_thim_pop_up_login   : null,
26		el_loginpopopform      : null,
27		el_registerPopupForm   : null,
28		el_form_purchase_course: null,
29		el_form_enroll_course: null,
30
31		ready: function () {
32			this.getElements()
33			if (this.el_thim_pop_up_login.length) {
34				this.el_loginpopopform = this.el_thim_pop_up_login.find('form[name=loginpopopform]')
35				this.el_registerPopupForm = this.el_thim_pop_up_login.find('form[name=registerformpopup]')
36				this.login_form_popup()
37			}
38
39			this.form_submission_validate()
40			this.thim_TopHeader()
41			this.ctf7_input_effect()
42			this.mobile_menu_toggle()
43			this.thim_backgroud_gradient()
44			this.thim_single_image_popup()
45			this.full_right(),
46				this.course_sidebar_right_offset_top();
47			this.thim_carousel()
48
49
50		},
51
52		getElements: function () {
53			this.el_thim_pop_up_login = $('#thim-popup-login')
54			this.el_form_purchase_course = $('form[name=purchase-course]')
55			this.el_form_enroll_course = $('form[name=enroll-course]')
56		},
57
58		load: function () {
59			this.thim_menu()
60			// this.thim_carousel()
61			this.thim_contentslider()
62			this.counter_box()
63			if ($('#contact-form-registration').length) {
64				this.thim_course_offline_popup_form_register();
65			}
66		},
67
68		resize: function () {
69			this.full_right()
70			this.thim_carousel()
71		},
72
73		validate_form: function (form) {
74			var valid = true,
75				email_valid = /[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}/igm
76
77			form.find('input.required').each(function () {
78				// Check empty value
79				if (!$(this).val()) {
80					$(this).addClass('invalid')
81					valid = false
82				}
83
84				// Uncheck
85				if ($(this).is(':checkbox') && !$(this).is(':checked')) {
86					$(this).addClass('invalid')
87					valid = false
88				}
89
90				// Check email format
91				if ('email' === $(this).attr('type')) {
92					if (!email_valid.test($(this).val())) {
93						$(this).addClass('invalid')
94						valid = false
95					}
96				}
97
98				// Check captcha
99				if ($(this).hasClass('captcha-result')) {
100					let captcha_1 = parseInt($(this).data('captcha1')),
101						captcha_2 = parseInt($(this).data('captcha2'))
102
103					if ((captcha_1 + captcha_2) !== parseInt($(this).val())) {
104						$(this).addClass('invalid').val('')
105						valid = false
106					}
107				}
108			})
109
110			// Check repeat password
111			if (form.hasClass('auto_login')) {
112				let $pw = form.find('input[name=password]'),
113					$repeat_pw = form.find('input[name=repeat_password]')
114
115				if ($pw.val() !== $repeat_pw.val()) {
116					$pw.addClass('invalid')
117					$repeat_pw.addClass('invalid')
118					valid = false
119				}
120			}
121
122			$('form input.required').on('focus', function () {
123				$(this).removeClass('invalid')
124			})
125
126			return valid
127		},
128
129		login_form_popup: function () {
130			var teduma = this
131
132			$(document).on('click', '#thim-popup-login .close-popup', function (event) {
133				event.preventDefault()
134				$('body').removeClass('thim-popup-active')
135				teduma.el_thim_pop_up_login.removeClass()
136
137				// Remove param purchase course on login popup
138				teduma.el_loginpopopform.find('.params-purchase-code').remove()
139				// Remove param enroll course on login popup
140				teduma.el_loginpopopform.find('.params-enroll-code').remove()
141			})
142
143			$('body .thim-login-popup a.js-show-popup').on('click', function (event) {
144				event.preventDefault()
145
146				$('body').addClass('thim-popup-active')
147				teduma.el_thim_pop_up_login.addClass('active')
148
149				if ($(this).hasClass('login')) {
150					teduma.el_thim_pop_up_login.addClass('sign-in')
151				} else {
152					teduma.el_thim_pop_up_login.addClass('sign-up')
153				}
154			})
155
156			//when login in single page event, show login-popup ,remove redirect to page account
157			$('body .widget_book-event a.js-show-popup').on('click', function (event) {
158				event.preventDefault()
159				$('body').addClass('thim-popup-active')
160				teduma.el_thim_pop_up_login.addClass('active')
161			})
162
163			teduma.el_thim_pop_up_login.find('.link-bottom a').on('click', function (e) {
164				e.preventDefault()
165
166				if ($(this).hasClass('login')) {
167					teduma.el_thim_pop_up_login.removeClass('sign-up').addClass('sign-in')
168				} else {
169					teduma.el_thim_pop_up_login.removeClass('sign-in').addClass('sign-up')
170				}
171			})
172
173			// Show login popup when click to LP buttons
174			$('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)').on('click', function (e) {
175				e.preventDefault()
176
177				if ($('body').hasClass('thim-popup-feature')) {
178					$('.thim-link-login.thim-login-popup .login').trigger('click')
179
180					// Add param purchase course to login and Register form if exists
181					teduma.add_params_purchase_course_to_el(teduma.el_loginpopopform)
182					teduma.add_params_purchase_course_to_el(teduma.el_registerPopupForm)
183
184				} else {
185					window.location.href = $(this).parent().find('input[name=redirect_to]').val()
186				}
187			})
188			$('.learn-press-content-protected-message .lp-link-login').on('click', function (e) {
189				e.preventDefault()
190
191				if ($('body').hasClass('thim-popup-feature')) {
192					$('.thim-link-login.thim-login-popup .login').trigger('click')
193					// Add param purchase course to login and Register form if exists
194					teduma.add_params_purchase_course_to_el(teduma.el_loginpopopform)
195					teduma.add_params_purchase_course_to_el(teduma.el_registerPopupForm)
196				} else {
197					window.location.href = $(this).href()
198				}
199			})
200
201			$(document).on('click', this.el_thim_pop_up_login, function (e) {
202				if ($(e.target).attr('id') === 'thim-popup-login') {
203					$('body').removeClass('thim-popup-active')
204					teduma.el_thim_pop_up_login.removeClass()
205
206					// remove param purchase course on login popup
207					teduma.el_loginpopopform.find('.params-purchase-code').remove()
208					teduma.el_registerPopupForm.find('.params-purchase-code').remove()
209					// remove param enroll course on login popup
210					teduma.el_loginpopopform.find('.params-enroll-code').remove()
211					teduma.el_registerPopupForm.find('.params-enroll-code').remove()
212				}
213			})
214
215			this.el_loginpopopform.submit(function (e) {
216				if (!thim_eduma.validate_form($(this))) {
217					e.preventDefault()
218					return false
219				}
220
221				var $elem = teduma.el_thim_pop_up_login.find('.thim-login-container')
222				$elem.addClass('loading')
223			})
224
225			teduma.el_thim_pop_up_login.find('form[name=registerformpopup]').on('submit', function (e) {
226				if (!thim_eduma.validate_form($(this))) {
227					e.preventDefault()
228					return false
229				}
230
231				var $elem = teduma.el_thim_pop_up_login.find('.thim-login-container')
232				$elem.addClass('loading')
233			})
234		},
235
236		/**
237		 * Add params purchase course to element
238		 * @purpose When register, login via buy course will send params purchase to action
239		 *
240		 * @param el
241		 * @since 4.2.6
242		 * @author tungnx
243		 */
244		add_params_purchase_course_to_el: function (el) {
245			const teduma = this
246			// Purchase course.
247			if (teduma.el_form_purchase_course.length) {
248				el.append('<p class="params-purchase-code"></p>')
249
250				var el_paramsPurchaseCode = el.find('.params-purchase-code')
251
252				$.each(teduma.el_form_purchase_course.find('input'), function (i) {
253					const inputName = $(this).attr('name')
254					const inputPurchaseCourse = $(this).clone()
255
256					if ( el_paramsPurchaseCode.find('input[name=' + inputName + ']').length === 0 ) {
257						el_paramsPurchaseCode.append(inputPurchaseCourse)
258					}
259				})
260			}
261
262			// Enroll course
263			if (teduma.el_form_enroll_course.length) {
264				el.append('<p class="params-enroll-code"></p>')
265				const el_paramsEnrollCode = el.find('.params-enroll-code')
266
267				$.each(teduma.el_form_enroll_course.find('input'), function (i) {
268					const inputName = $(this).attr('name')
269					const inputEnrollCourse = $(this).clone()
270
271					if ( el_paramsEnrollCode.find('input[name=' + inputName + ']').length === 0 ) {
272						el_paramsEnrollCode.append(inputEnrollCourse)
273					}
274				})
275			}
276		},
277
278		form_submission_validate: function () {
279			// Form login
280			$('.form-submission-login form[name=loginform]').on('submit', function (e) {
281				if (!thim_eduma.validate_form($(this))) {
282					e.preventDefault()
283					return false
284				}
285			})
286
287			// Form register
288			$('.form-submission-register form[name=registerform]').on('submit', function (e) {
289				if (!thim_eduma.validate_form($(this))) {
290					e.preventDefault()
291					return false
292				}
293			})
294
295			// Form lost password
296			$('.form-submission-lost-password form[name=lostpasswordform]').on('submit', function (e) {
297				if (!thim_eduma.validate_form($(this))) {
298					e.preventDefault()
299					return false
300				}
301			})
302		},
303
304		thim_TopHeader: function () {
305			var header = $('#masthead'),
306				height_sticky_header = header.outerHeight(true),
307				content_pusher = $('#wrapper-container .content-pusher'),
308				top_site_main = $('#wrapper-container .top_site_main')
309			$('body').removeClass('fixloader');
310			if (header.hasClass('header_overlay')) { // Header overlay
311				top_site_main.css({'padding-top': height_sticky_header + 'px'})
312				$(window).resize(function () {
313					let height_sticky_header = header.outerHeight(true)
314					top_site_main.css({'padding-top': height_sticky_header + 'px'})
315				})
316			} else if (header.hasClass('sticky-header') & header.hasClass('header_default')) { // Header default
317				content_pusher.css({'padding-top': height_sticky_header + 'px'})
318				$(window).resize(function () {
319					let height_sticky_header = header.outerHeight(true)
320					content_pusher.css({'padding-top': height_sticky_header + 'px'})
321				})
322			}
323		},
324
325		ctf7_input_effect: function () {
326			let $ctf7_edtech = $('.form_developer_course'),
327				$item_input = $ctf7_edtech.find('.field_item input'),
328				$submit_wrapper = $ctf7_edtech.find('.submit_row')
329
330			$item_input.focus(function () {
331				$(this).parent().addClass('focusing')
332			}).blur(function () {
333				$(this).parent().removeClass('focusing')
334			})
335
336			$submit_wrapper.on('click', function () {
337				$(this).closest('form').submit()
338			})
339		},
340
341		mobile_menu_toggle: function () {
342			$(document).on('click', '.menu-mobile-effect', function (e) {
343				e.stopPropagation()
344				$('body').toggleClass('mobile-menu-open')
345			})
346
347			$(document).on('click', '.wrapper-container', function (e) {
348				$('body').removeClass('mobile-menu-open')
349			})
350
351			$(document).on('click', '.mobile-menu-inner', function (e) {
352				e.stopPropagation()
353			})
354		},
355
356		thim_menu: function () {
357
358			//Add class for masthead
359			var $header = $('#masthead.sticky-header'),
360				off_Top = ($('.content-pusher').length > 0) ? $('.content-pusher').offset().top : 0,
361				menuH = $header.outerHeight(),
362				latestScroll = 0
363			var $imgLogo = $('.site-header .thim-logo img'),
364				srcLogo = $($imgLogo).attr('src'),
365				dataRetina = $($imgLogo).data('retina'),
366				dataSticky = $($imgLogo).data('sticky'),
367				dataMobile = $($imgLogo).data('mobile'),
368				dataStickyMobile = $($imgLogo).data('sticky_mobile');
369			if ($(window).scrollTop() > 2) {
370				$header.removeClass('affix-top').addClass('affix')
371			}
372			if ($(window).outerWidth() < 769) {
373				if (dataMobile != null) {
374					$($imgLogo).attr('src', dataMobile);
375				}
376			} else {
377				if (window.devicePixelRatio > 1 && dataRetina != null) {
378					$($imgLogo).attr('src', dataRetina);
379				}
380			}
381
382			$(window).scroll(function () {
383				var current = $(this).scrollTop()
384				if (current > 2) {
385					$header.removeClass('affix-top').addClass('affix');
386					if ($(window).outerWidth() < 769) {
387						if (dataStickyMobile != null) {
388							$($imgLogo).attr('src', dataStickyMobile);
389						} else {
390							if (dataSticky != null) {
391								$($imgLogo).attr('src', dataSticky);
392							}
393						}
394					} else {
395						if (dataSticky != null) {
396							$($imgLogo).attr('src', dataSticky);
397						}
398					}
399				} else {
400					$header.removeClass('affix').addClass('affix-top');
401					if ($(window).outerWidth() < 769) {
402						if (dataMobile != null) {
403							$($imgLogo).attr('src', dataMobile);
404						} else if (srcLogo != null) {
405							$($imgLogo).attr('src', srcLogo);
406						}
407					} else {
408						if (window.devicePixelRatio > 1 && dataRetina != null) {
409							$($imgLogo).attr('src', dataRetina);
410						} else if (srcLogo != null) {
411							$($imgLogo).attr('src', srcLogo);
412						}
413					}
414				}
415
416				if (current > latestScroll && current > menuH + off_Top) {
417					if (!$header.hasClass('menu-hidden')) {
418						$header.addClass('menu-hidden')
419					}
420				} else {
421					if ($header.hasClass('menu-hidden')) {
422						$header.removeClass('menu-hidden')
423					}
424				}
425
426				latestScroll = current
427			})
428
429
430			//Submenu position
431			$('.wrapper-container:not(.mobile-menu-open) .site-header .navbar-nav > .menu-item').each(function () {
432				if ($('>.sub-menu', this).length <= 0) {
433					return
434				}
435
436				let elm = $('>.sub-menu', this),
437					off = elm.offset(),
438					left = off.left,
439					width = elm.width()
440
441				let navW = $('.thim-nav-wrapper').width(),
442					isEntirelyVisible = (left + width <= navW)
443
444				if (!isEntirelyVisible) {
445					elm.addClass('dropdown-menu-right')
446				} else {
447					let subMenu2 = elm.find('>.menu-item>.sub-menu')
448
449					if (subMenu2.length <= 0) {
450						return
451					}
452
453					let off = subMenu2.offset(),
454						left = off.left,
455						width = subMenu2.width()
456
457					let isEntirelyVisible = (left + width <= navW)
458
459					if (!isEntirelyVisible) {
460						elm.addClass('dropdown-left-side')
461					}
462				}
463			})
464
465			let $headerLayout = $('header#masthead')
466			let magicLine = function () {
467				if ($(window).width() > 768) {
468					//Magic Line
469					var menu_active = $(
470						'#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')
471					if (menu_active.length > 0) {
472						menu_active.before('<span id="magic-line"></span>')
473						var menu_active_child = menu_active.find(
474								'>a,>span.disable_link,>span.tc-menu-inner'),
475							menu_left = menu_active.position().left,
476							menu_child_left = parseInt(menu_active_child.css('padding-left')),
477							magic = $('#magic-line')
478
479						magic.width(menu_active_child.width()).css('left', Math.round(menu_child_left + menu_left)).data('magic-width', magic.width()).data('magic-left', magic.position().left)
480
481					} else {
482						var first_menu = $(
483							'#masthead .navbar-nav>li.menu-item:first-child')
484						first_menu.before('<span id="magic-line"></span>')
485						var magic = $('#magic-line')
486						magic.data('magic-width', 0)
487					}
488
489					var nav_H = parseInt($('.site-header .navigation').outerHeight())
490					magic.css('bottom', nav_H - (nav_H - 90) / 2 - 64)
491					if ($headerLayout.hasClass('item_menu_active_top')) {
492						magic.css('bottom', nav_H - 2)
493					}
494					$('#masthead .navbar-nav>li.menu-item').on({
495						'mouseenter': function () {
496							var elem = $(this).find('>a,>span.disable_link,>span.tc-menu-inner'),
497								new_width = elem.width(),
498								parent_left = elem.parent().position().left,
499								left = parseInt(elem.css('padding-left'))
500							if (!magic.data('magic-left')) {
501								magic.css('left', Math.round(parent_left + left))
502								magic.data('magic-left', 'auto')
503							}
504							magic.stop().animate({
505								left : Math.round(parent_left + left),
506								width: new_width,
507							})
508						},
509						'mouseleave': function () {
510							magic.stop().animate({
511								left : magic.data('magic-left'),
512								width: magic.data('magic-width'),
513							})
514						},
515					})
516				}
517			}
518
519			if (!$headerLayout.hasClass('noline_menu_active')) {
520				magicLine()
521			}
522
523			var subMenuPosition = function (menuItem) {
524				var $menuItem = menuItem,
525					$container = $menuItem.closest('.container, .header_full'),
526					$subMenu = $menuItem.find('>.sub-menu'),
527					$menuItemWidth = $menuItem.width(),
528					$containerWidth = $container.width(),
529					$subMenuWidth = $subMenu.width(),
530					$subMenuDistance = $subMenuWidth / 2,
531					paddingContainer = 15
532
533			}
534		},
535
536		thim_carousel: function () {
537			if (jQuery().owlCarousel) {
538				let is_rtl = $('body').hasClass('rtl') ? true : false ;
539				$('.thim-gallery-images').owlCarousel({
540					rtl: is_rtl,
541					autoplay   : false,
542					singleItem : true,
543					stopOnHover: true,
544					autoHeight : false,
545					loop: true,
546					loadedClass: 'owl-loaded owl-carousel',
547				})
548
549				$('.thim-carousel-wrapper').each(function () {
550
551					var item_visible = $(this).data('visible') ? parseInt(
552							$(this).data('visible')) : 4,
553						item_desktopsmall = $(this).data('desktopsmall') ? parseInt(
554							$(this).data('desktopsmall')) : item_visible,
555						itemsTablet = $(this).data('itemtablet') ? parseInt(
556							$(this).data('itemtablet')) : 2,
557						itemsMobile = $(this).data('itemmobile') ? parseInt(
558							$(this).data('itemmobile')) : 1,
559						pagination = !!$(this).data('pagination'),
560						navigation = !!$(this).data('navigation'),
561						autoplay = $(this).data('autoplay') ? parseInt(
562							$(this).data('autoplay')) : false,
563						navigation_text = ($(this).data('navigation-text') &&
564							$(this).data('navigation-text') === '2') ? [
565							'<i class=\'fa fa-long-arrow-left \'></i>',
566							'<i class=\'fa fa-long-arrow-right \'></i>',
567						] : [
568							'<i class=\'fa fa-chevron-left \'></i>',
569							'<i class=\'fa fa-chevron-right \'></i>',
570						]
571					$(this).owlCarousel({
572						items            : item_visible,
573						// itemsDesktop     : [1200, item_visible],
574						// itemsDesktopSmall: [1024, item_desktopsmall],
575						// itemsTablet      : [768, itemsTablet],
576						// itemsMobile      : [480, itemsMobile],
577						nav       : navigation,
578						dots       : pagination,
579						loop: ($(this).children().length > item_visible) ? true: false,
580						rewind: true,
581						rtl: is_rtl,
582						// dots       : true,
583						loadedClass: 'owl-loaded owl-carousel',
584						navContainerClass: 'owl-nav owl-buttons',
585						dotsClass :'owl-dots owl-pagination',
586						dotClass:'owl-page',
587						responsive:{
588							0:{
589								items:itemsMobile,
590								dots: true,
591								nav: false
592							},
593							480:{
594								items:itemsTablet
595							},
596							1024:{
597								items:item_desktopsmall
598							},
599							1200:{
600								items:item_visible
601							}
602						},
603						lazyLoad         : true,
604						autoplay         : autoplay,
605						navText   : navigation_text,
606						afterAction      : function () {
607							var width_screen = $(window).width()
608							var width_container = $('#main-home-content').width()
609							var elementInstructorCourses = $('.thim-instructor-courses')
610							var button_full_left = $('.thim_full_right.thim-event-layout-6')
611							if (button_full_left.length) {
612								var full_left = (jQuery(window).width() - button_full_left.width()) / 2;
613								button_full_left.find('.owl-controls .owl-buttons').css("margin-left", "-" + full_left + "px")
614								button_full_left.find('.owl-controls .owl-buttons').css({
615									'margin-left' : '-' + full_left + 'px',
616									'padding-left': full_left + 'px',
617									'margin-right': full_left + 'px',
618								})
619							}
620							if (elementInstructorCourses.length) {
621								if (width_screen > width_container) {
622									var margin_left_value = (width_screen - width_container) / 2
623									$('.thim-instructor-courses .thim-course-slider-instructor .owl-controls .owl-buttons').css('left', margin_left_value + 'px')
624								}
625							}
626						}
627					})
628					thim_eduma.addWrapOwlControls($(this));
629
630				})
631
632				$('.thim-course-slider-instructor').each(function () {
633					var item_visible = $(this).data('visible') ? parseInt( $(this).data('visible')) : 4,
634						item_desktopsmall = $(this).data('desktopsmall') ? parseInt(
635							$(this).data('desktopsmall')) : item_visible,
636						itemsTablet = $(this).data('itemtablet') ? parseInt(
637							$(this).data('itemtablet')) : 2,
638						itemsMobile = $(this).data('itemmobile') ? parseInt(
639							$(this).data('itemmobile')) : 1,
640						pagination = !!$(this).data('pagination'),
641						navigation = !!$(this).data('navigation'),
642						autoplay = $(this).data('autoplay') ? parseInt(
643							$(this).data('autoplay')) : false,
644						navigation_text = ($(this).data('navigation-text') &&
645							$(this).data('navigation-text') === '2') ? [
646							'<i class=\'fa fa-long-arrow-left \'></i>',
647							'<i class=\'fa fa-long-arrow-right \'></i>',
648						] : [
649							'<i class=\'fa fa-chevron-left \'></i>',
650							'<i class=\'fa fa-chevron-right \'></i>',
651						]
652
653					$(this).owlCarousel({
654						items            : item_visible,
655						rtl: is_rtl,
656						// itemsDesktop     : [1400, item_desktopsmall],
657						// itemsDesktopSmall: [1024, itemsTablet],
658						// itemsTablet      : [768, itemsTablet],
659						// itemsMobile      : [480, itemsMobile],
660						responsive:{
661							0:{
662								items:itemsMobile
663							},
664							480:{
665								items:itemsTablet
666							},
667							1024:{
668								items:itemsTablet
669							},
670							1400:{
671								items:item_desktopsmall
672							}
673						},
674						nav       : navigation,
675						dots       : pagination,
676						loop: ($(this).children().length > item_visible) ? true: false,
677						rewind: true,
678						lazyLoad         : true,
679						autoplay         : autoplay,
680						navText   : navigation_text,
681						loadedClass: 'owl-loaded owl-carousel',
682						navContainerClass: 'owl-nav owl-buttons',
683						dotsClass :'owl-dots owl-pagination',
684						dotClass:'owl-page',
685						afterAction      : function () {
686							var width_screen = $(window).width()
687							var width_container = $('#main-home-content').width()
688							var elementInstructorCourses = $('.thim-instructor-courses')
689
690							if (elementInstructorCourses.length) {
691								if (width_screen > width_container) {
692									var margin_left_value = (width_screen - width_container) / 2
693									$('.thim-instructor-courses .thim-course-slider-instructor .owl-controls .owl-buttons').css('left', margin_left_value + 'px')
694								}
695							}
696						}
697					})
698					thim_eduma.addWrapOwlControls($(this));
699				})
700
701				$('.thim-carousel-course-categories .thim-course-slider, .thim-carousel-course-categories-tabs .thim-course-slider').each(function () {
702
703					var item_visible = $(this).data('visible') ? parseInt($(this).data('visible')) : 7,
704						item_desktop = $(this).data('desktop') ? parseInt($(this).data('desktop')) : item_visible,
705						item_desktopsmall = $(this).data('desktopsmall') ? parseInt($(this).data('desktopsmall')) : 6,
706						item_tablet = $(this).data('tablet') ? parseInt($(this).data('tablet')) : 4,
707						item_mobile = $(this).data('mobile') ? parseInt($(this).data('mobile')) : 2,
708						pagination = !!$(this).data('pagination'),
709						navigation = !!$(this).data('navigation'),
710						autoplay = $(this).data('autoplay') ? parseInt($(this).data('autoplay')) : false
711					$(this).owlCarousel({
712						items            : item_visible,
713						loop: ($(this).children().length > item_visible) ? true: false,
714						rewind: true,
715						rtl: is_rtl,
716						responsive:{
717
718							0:{
719								items:item_mobile
720							},
721							480:{
722								items:item_tablet
723							},
724							1024:{
725								items:item_desktopsmall
726							},
727							1800:{
728								items:item_desktop
729							}
730						},
731						nav       : navigation,
732						dots       : pagination,
733						loadedClass: 'owl-loaded owl-carousel',
734						autoplay         : autoplay,
735						navContainerClass: 'owl-nav owl-buttons',
736						dotsClass :'owl-dots owl-pagination',
737						dotClass:'owl-page',
738						navText   : [
739							'<i class=\'fa fa-chevron-left \'></i>',
740							'<i class=\'fa fa-chevron-right \'></i>',
741						],
742					})
743					thim_eduma.addWrapOwlControls($(this));
744				})
745			}
746		},
747
748		thim_contentslider: function () {
749			$('.thim-testimonial-slider').each(function () {
750				var elem = $(this),
751					item_visible = parseInt(elem.data('visible')),
752					item_time = parseInt(elem.data('time')),
753					autoplay = elem.data('auto') ? true : false,
754					item_ratio = elem.data('ratio') ? elem.data('ratio') : 1.18,
755					item_padding = elem.data('padding') ? elem.data('padding') : 15,
756					item_activepadding = elem.data('activepadding') ? elem.data(
757						'activepadding') : 0,
758					item_width = elem.data('width') ? elem.data('width') : 100,
759					mousewheel = !!elem.data('mousewheel')
760				if (jQuery().thimContentSlider) {
761					var testimonial_slider = $(this).thimContentSlider({
762						items            : elem,
763						itemsVisible     : item_visible,
764						mouseWheel       : mousewheel,
765						autoPlay         : autoplay,
766						pauseTime        : item_time,
767						itemMaxWidth     : item_width,
768						itemMinWidth     : item_width,
769						activeItemRatio  : item_ratio,
770						activeItemPadding: item_activepadding,
771						itemPadding      : item_padding,
772					})
773				}
774
775			})
776		},
777
778		counter_box: function () {
779			if (jQuery().waypoint) {
780				jQuery('.counter-box').waypoint(function () {
781					jQuery(this).find('.display-percentage').each(function () {
782						var percentage = jQuery(this).data('percentage')
783						jQuery(this).countTo({
784							from           : 0,
785							to             : percentage,
786							refreshInterval: 40,
787							speed          : 2000,
788						})
789					})
790				}, {
791					triggerOnce: true,
792					offset     : '80%',
793				})
794			}
795		},
796
797		thim_backgroud_gradient: function () {
798			var background_gradient = jQuery('.thim_overlay_gradient')
799			var background_gradient_2 = jQuery('.thim_overlay_gradient_2')
800			if (background_gradient.length) {
801				$('.thim_overlay_gradient rs-sbg-px > rs-sbg-wrap > rs-sbg').addClass('thim-overlayed')
802			}
803
804			if (background_gradient_2.length) {
805				$('.thim_overlay_gradient_2 rs-sbg-px > rs-sbg-wrap > rs-sbg').addClass('thim-overlayed')
806			}
807		},
808
809		thim_single_image_popup: function () {
810			if (jQuery().magnificPopup) {
811				$('.thim-single-image-popup').magnificPopup({
812					type: 'image',
813					zoom: {
814						enabled : true,
815						duration: 300,
816						easing  : 'ease-in-out',
817					}
818				})
819			}
820		},
821
822		full_right: function () {
823			$('.thim_full_right').each(function () {
824				var full_right = (jQuery(window).width() - jQuery(this).width()) / 2;
825				jQuery(this).children().css("margin-right", "-" + full_right + "px");
826			});
827			$('.thim_full_left').each(function () {
828				var full_left = (jQuery(window).width() - jQuery(this).width()) / 2;
829				jQuery(this).children().css("margin-left", "-" + full_left + "px");
830			});
831			$('.thim_coundown_full_left').each(function () {
832				var full_left = (jQuery(window).width() - jQuery(this).width()) / 2;
833				var number =   full_left + 'px';
834				jQuery(this).find('.thim-widget-countdown-box').parent().css({"margin-left": '-' + number, "padding-left": number});
835			});
836		},
837		thim_course_offline_popup_form_register : function() {
838			if ($('#contact-form-registration >.wpcf7').length) {
839				var el = $('#contact-form-registration >.wpcf7');
840				el.append('<a href="#" class="thim-close fa fa-times"></a>');
841			}
842			$(document).on('click', '#contact-form-registration .wpcf7-form-control.wpcf7-submit', function () {
843				$(document).on('mailsent.wpcf7', function (event) {
844					setTimeout(function(){
845						$('body').removeClass('thim-contact-popup-active');
846						$('#contact-form-registration').removeClass('active');
847					}, 3000);
848				});
849			});
850			$(document).on('click', '.course-payment .thim-enroll-course-button', function (e) {
851				e.preventDefault();
852				$('body').addClass('thim-contact-popup-active');
853				$('#contact-form-registration').addClass('active');
854			});
855
856			$(document).on('click', '#contact-form-registration', function (e) {
857				if ($(e.target).attr('id') == 'contact-form-registration') {
858					$('body').removeClass('thim-contact-popup-active');
859					$('#contact-form-registration').removeClass('active');
860				}
861			});
862
863			$(document).on('click', '#contact-form-registration .thim-close', function (e) {
864				e.preventDefault();
865				$('body').removeClass('thim-contact-popup-active');
866				$('#contact-form-registration').removeClass('active');
867			});
868		},
869		course_sidebar_right_offset_top : function(){
870			var elementInfoTop = $('.course-info-top');
871			if(elementInfoTop.length){
872				var InfoTopHeight = elementInfoTop.innerHeight(),
873					elementInfoRight = $('.thim-style-content-layout_style_3 .sticky-sidebar');
874				elementInfoRight.css('margin-top', '-' + ( InfoTopHeight - 20 ) + 'px' );
875			}
876		},
877		addWrapOwlControls: function ( el ) {
878			const elOwlControls = el.find('.owl-controls');
879			if ( ! elOwlControls.length ) {
880				el.find('.owl-nav, .owl-dots').wrapAll("<div class='owl-control
880s'></div>");
881			}
882		}
883	}
884
885	$(document).ready(function () {
886		thim_eduma.ready();
887
888		$(window).resize(function () {
889			thim_eduma.resize()
890		})
891
892	})
893
894	$(window).on('load', function () {
895		thim_eduma.load();
896	})
897
898	$(window).on('elementor/frontend/init', function() {
899		elementorFrontend.hooks.addAction('frontend/element_ready/thim-carousel-post.default',
900			thim_eduma.thim_carousel)
901		elementorFrontend.hooks.addAction('frontend/element_ready/thim-twitter.default',
902			thim_eduma.thim_carousel)
903
904		elementorFrontend.hooks.addAction('frontend/element_ready/thim-courses.default',
905			thim_eduma.thim_carousel);
906
907		elementorFrontend.hooks.addAction('frontend/element_ready/thim-list-event.default',
908			thim_eduma.thim_carousel);
909
910		elementorFrontend.hooks.addAction('frontend/element_ready/thim-course-categories.default',
911			thim_eduma.thim_carousel)
912
913		elementorFrontend.hooks.addAction('frontend/element_ready/thim-our-team.default',
914			thim_eduma.thim_carousel)
915
916		elementorFrontend.hooks.addAction('frontend/element_ready/thim-gallery-images.default',
917			thim_eduma.thim_carousel)
918
919		elementorFrontend.hooks.addAction('frontend/element_ready/thim-list-instructors.default',
920			thim_eduma.thim_carousel)
921
922		elementorFrontend.hooks.addAction('frontend/element_ready/thim-testimonials.default',
923			thim_eduma.thim_carousel)
924
925		elementorFrontend.hooks.addAction('frontend/element_ready/thim-courses-collection.default',
926			thim_eduma.thim_carousel)
927
928		elementorFrontend.hooks.addAction('frontend/element_ready/thim-testimonials.default',
929			thim_eduma.thim_contentslider)
930
931		elementorFrontend.hooks.addAction('frontend/element_ready/thim-counters-box.default',
932			thim_eduma.counter_box)
933
934		elementorFrontend.hooks.addAction('frontend/element_ready/global', function($scope) {
935			var $carousel = $scope.find('.owl-carousel')
936			if ($carousel.length) {
937				var carousel = $carousel.data('owlCarousel')
938				carousel && carousel.reload()
939			}
940		})
941
942	})
943})(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.