PageSourceSearch

https://solnustec.com/wp-content/plugins/droit-elementor-addons/modules/widgets/widgets.js?ver=3.1.5

js solnustec.com collected 2026-10-02 15:47:25 UTC 20,043 bytes, 655 lines download raw bytes

1/** @format */
2
3(function ($, window) {
4	'use strict';
5	var $window = $(window);
6	var dlWidgets = {
7		LoadWidgets: function () {
8			var e_front = elementorFrontend,
9				e_module = elementorModules;
10			var widgetsMap = {
11				'droit-testimonial.default': dlWidgets.swiperSlider,
12				'droit-blog.default': dlWidgets.DL_Blog_Isotope,
13				'droit-card.default': dlWidgets.DL_Card_Parallax,
14				'droit-tab.default': dlWidgets.DL_Adv_Tab,
15				'droit-accordion.default': dlWidgets.DL_Adv_Accordion,
16				'droit-faq.default': dlWidgets.DL_Adv_Faq,
17				'droit-countdown.default': dlWidgets.DL_Adv_Countdown,
18				'droit-process.default': dlWidgets.DL_Adv_Process,
19				'droit-image_Carousel.default': dlWidgets.swiperSlider,
20				'droit-img-carousel.default': dlWidgets.dl_img_carousel,
21				'droit-timeline-slider.default': dlWidgets.DL_Owl_Carousel,
22				'droit-animated-text.default': dlWidgets.Animated_Heading,
23				'droit-alert.default': dlWidgets.Alert,
24				'droit-bar-chart.default': dlWidgets.DL_Bar_Chart,
25				'droit-progress-bar.default': dlWidgets.DL_Progress_Bar,
26				'droit-skill-bar.default': dlWidgets.DL_Skill_Bar,
27			};
28			$.each(widgetsMap, function (name, callback) {
29				e_front.hooks.addAction('frontend/element_ready/' + name, callback);
30			});
31			// section link
32			dlWidgets.Droit_Wrapper_Link($);
33		},
34		
35		// test
36		drth_test: function ($scope) {},
37
38		//Swiper Carousel
39		swiperSlider: function ($scope) {
40			var $swiperContainer = $scope.find('.swiper-container'),
41				controls = null,
42				autoplay = true,
43				slider_speed = 500,
44				slider_loop = true,
45				slider_space = 50,
46				slider_item = 1,
47				slider_drag = false,
48				slider_next = '.image_slider_next_one',
49				slider_prev = '.image_slider_prev_one',
50				slider_paginationtype = 'bullets',
51				slider_pagination = '.img_carousel_pagination',
52				slider_effect = '',
53				slider_center = false,
54				slider_breakpoints = '';
55
56			if ($swiperContainer.attr('data-controls')) {
57				var controls = JSON.parse($swiperContainer.attr('data-controls'));
58				autoplay = controls.slide_autoplay == 'yes' ? true : false;
59				slider_speed = controls.slider_speed;
60				slider_loop = controls.slider_loop == 'yes' ? true : false;
61				slider_space = controls.slider_space;
62				slider_item = controls.slider_item;
63				slider_next = controls.slider_next;
64				slider_prev = controls.slider_prev;
65				(slider_paginationtype = controls.slider_paginationtype),
66					(slider_pagination = controls.slider_pagination),
67					(slider_center = controls.slider_center == 'yes' ? true : false);
68				slider_drag = controls.slider_drag == 'yes' ? true : false;
69				slider_breakpoints = controls.slider_breakpoints;
70			}
71
72			new Swiper($swiperContainer, {
73				slidesPerView: slider_item,
74				spaceBetween: slider_space,
75				loop: slider_loop,
76				speed: slider_speed,
77				simulateTouch: slider_drag,
78				effect: slider_effect,
79				breakpoints: slider_breakpoints,
80				centeredSlides: slider_center,
81				autoplay: autoplay,
82				disableOnInteraction: autoplay,
83				pagination: {
84					el: slider_pagination,
85					type: slider_paginationtype,
86					clickable: !0,
87				},
88				navigation: {
89					nextEl: slider_next,
90					prevEl: slider_prev,
91				},
92			});
93			$($swiperContainer).hover(
94				function () {
95					this.swiper.autoplay.stop();
96				},
97				function () {
98					if (autoplay == true) {
99						this.swiper.autoplay.start();
100					}
101				}
102			);
103		},
104
105		dl_img_carousel: function ($scope) {
106			var $slider = $scope.find(
107					'.dl_advance_slider, .dl_pro_testimonial_slider, .dl_pro_post_slider, .dl_pro_wooslider'
108				),
109				$item = $scope.find('.swiper-slide'),
110				$dat = $slider.data('settings');
111
112			// render slider
113			new Swiper($slider, $dat);
114
115			// auto slider
116			if ($dat.dl_mouseover) {
117				$slider.hover(
118					function () {
119						this.swiper.autoplay.stop();
120					},
121					function () {
122						this.swiper.autoplay.start();
123					}
124				);
125			}
126
127			if ($dat.dl_autoplay) {
128				$slider.each(function () {
129					this.swiper.autoplay.start();
130				});
131			} else {
132				$slider.each(function () {
133					this.swiper.autoplay.stop();
134				});
135			}
136
137			let $delay = $dat.speed;
138			if ($dat.autoplay) {
139				$delay = $dat.autoplay.delay;
140			}
141		},
142
143		//Owl Carousel
144		DL_Owl_Carousel: function ($scope) {
145			var $owlContainer = $scope.find('.dl_timeline_inner');
146			var $data = $owlContainer.data('owl');
147			if ($data) {
148				$owlContainer.owlCarousel($data);
149			}
150		},
151
152		//Isotop
153		DL_Blog_Isotope: function ($scope) {
154			var $selector = $scope.find('.dl_addons_grid_wrapper');
155			$selector.dlAddonsGridLayout();
156			/*$( $selector ).each(function() {
157
158	'use strict';
159	var $window = $(window);
160	var dlWidgets = {
161		LoadWidgets: function () {
162			var e_front = elementorFrontend,
163				e_module = elementorModules;
164			var widgetsMap = {
165				'droit-testimonial.default': dlWidgets.swiperSlider,
166				'droit-blog.default': dlWidgets.DL_Blog_Isotope,
167				'droit-card.default': dlWidgets.DL_Card_Parallax,
168				'droit-tab.default': dlWidgets.DL_Adv_Tab,
169				'droit-accordion.default': dlWidgets.DL_Adv_Accordion,
170				'droit-faq.default': dlWidgets.DL_Adv_Faq,
171				'droit-countdown.default': dlWidgets.DL_Adv_Countdown,
172				'droit-process.default': dlWidgets.DL_Adv_Process,
173				'droit-image_Carousel.default': dlWidgets.swiperSlider,
174				'droit-timeline-slider.default': dlWidgets.DL_Owl_Carousel,
175				'droit-animated-text.default': dlWidgets.Animated_Heading,
176				'droit-alert.default': dlWidgets.Alert,
177				'droit-bar-chart.default': dlWidgets.DL_Bar_Chart,
178				'droit-progress-bar.default': dlWidgets.DL_Progress_Bar,
179				'droit-skill-bar.default': dlWidgets.DL_Skill_Bar,
180			};
181			$.each(widgetsMap, function (name, callback) {
182				e_front.hooks.addAction('frontend/element_ready/' + name, callback);
183			});
184			// section link
185			dlWidgets.Droit_Wrapper_Link($);
186		},
187		// test
188		drth_test: function ($scope) {},
189
190		//Swiper Carousel
191		swiperSlider: function ($scope) {
192			var $swiperContainer = $scope.find('.swiper-container'),
193				controls = null,
194				autoplay = true,
195				slider_speed = 500,
196				slider_loop = true,
197				slider_space = 50,
198				slider_item = 1,
199				slider_drag = false,
200				slider_next = '.image_slider_next_one',
201				slider_prev = '.image_slider_prev_one',
202				slider_paginationtype = 'bullets',
203				slider_pagination = '.img_carousel_pagination',
204				slider_effect = '',
205				slider_center = false,
206				slider_breakpoints = '';
207
208			if ($swiperContainer.attr('data-controls')) {
209				var controls = JSON.parse($swiperContainer.attr('data-controls'));
210				autoplay = controls.slide_autoplay == 'yes' ? true : false;
211				slider_speed = controls.slider_speed;
212				slider_loop = controls.slider_loop == 'yes' ? true : false;
213				slider_space = controls.slider_space;
214				slider_item = controls.slider_item;
215				slider_next = controls.slider_next;
216				slider_prev = controls.slider_prev;
217				(slider_paginationtype = controls.slider_paginationtype),
218					(slider_pagination = controls.slider_pagination),
219					(slider_center = controls.slider_center == 'yes' ? true : false);
220				slider_drag = controls.slider_drag == 'yes' ? true : false;
221				slider_breakpoints = controls.slider_breakpoints;
222			}
223
224			new Swiper($swiperContainer, {
225				slidesPerView: slider_item,
226				spaceBetween: slider_space,
227				loop: slider_loop,
228				speed: slider_speed,
229				simulateTouch: slider_drag,
230				effect: slider_effect,
231				breakpoints: slider_breakpoints,
232				centeredSlides: slider_center,
233				autoplay: autoplay,
234				// disableOnInteraction: autoplay,
235				pagination: {
236					el: slider_pagination,
237					type: slider_paginationtype,
238					clickable: !0,
239				},
240				navigation: {
241					nextEl: slider_next,
242					prevEl: slider_prev,
243				},
244			});
245			$($swiperContainer).hover(
246				function () {
247					this.swiper.autoplay.stop();
248				},
249				function () {
250					if (autoplay == true) {
251						this.swiper.autoplay.start();
252					}
253				}
254			);
255		},
256
257		//Owl Carousel
258		DL_Owl_Carousel: function ($scope) {
259			var $owlContainer = $scope.find('.dl_timeline_inner');
260			var $data = $owlContainer.data('owl');
261			if ($data) {
262				$owlContainer.owlCarousel($data);
263			}
264		},
265
266		//Isotop
267		DL_Blog_Isotope: function ($scope) {
268			var $selector = $scope.find('.dl_addons_grid_wrapper');
269			$selector.dlAddonsGridLayout();
270			/*$( $selector ).each(function() {
271
272                if($selector.length){
273                    $(this).dlAddonsGridLayout();
274                }
275            });*/
276		},
277
278		//Card Paralax
279		DL_Card_Parallax: function ($scope) {
280			var $selector = $scope.find('.mouse_move_animation');
281			if ($($selector).length > 0) {
282				$($selector).parallax({
283					scalarX: 10.0,
284					scalarY: 8.0,
285				});
286			}
287		},
288
289		//Adv Tab
290		DL_Adv_Tab: function ($scope, t, e) {
291
292			var a = '#' + $scope.find('.dl_tab_container').attr('id').toString();
293
294			t(a + ' ul.dl_tab_menu > li').each(function (e) {
295				t(this).hasClass('active-default')
296					? (t(a + ' ul.dl_tab_menu > li')
297							.removeClass('dl_active')
298							.addClass('dl_inactive'),
299					  t(this).removeClass('dl_inactive'))
300					: 0 == e && t(this).removeClass('dl_inactive').addClass('dl_active');
301			}),
302				t(a + ' .tab_container div').each(function (e) {
303					t(this).hasClass('active-default')
304						? t(a + ' .tab_container > div').removeClass('dl_active')
305						: 0 == e &&
306						  t(this).removeClass('dl_inactive').addClass('dl_active');
307				}),
308				t(a + ' ul.dl_tab_menu > li').click(function () {
309					var e = t(this).index(),
310						a = t(this).closest('.droit-advance-tabs'),
311						n = t(a).children('.droit-tabs-nav').children('ul').children('li'),
312						i = t(a).children('.tab_container').children('div');
313					t(this).parent('li').addClass('dl_active'),
314						t(n)
315							.removeClass('dl_active active-default')
316							.addClass('dl_inactive'),
317						t(this).addClass('dl_active').removeClass('dl_inactive'),
318						t(i).removeClass('dl_active').addClass('dl_inactive'),
319						t(i).eq(e).addClass('dl_active').removeClass('dl_inactive');
320
321					t(i).each(function (e) {
322						t(this).removeClass('active-default');
323					});
324				});
325		},
326
327		//Adv Accordion
328		DL_Adv_Accordion: function ($scope, $) {
329			var t = $scope.find('.droit-accordion-wrapper'),
330				h = $scope.find('.dl_accordion_item_title'),
331				r = $scope.data('type'),
332				s = 400;
333			h.each(function () {
334				$(this).hasClass('dl-active-default') &&
335					($(this).addClass('dl-open dl-active'), $(this).next().slideDown(s));
336			}),
337				h.click(function (e) {
338					e.preventDefault();
339					var $this = $(this);
340					$this.hasClass('dl-open')
341						? ($this.removeClass('dl-open dl-active'), $this.next().slideUp(s))
342						: ($this.parent().parent().find(h).removeClass('dl-open dl-active'),
343						  $this.parent().parent().find('.dl_accordion_panel').slideUp(s),
344						  $this.toggleClass('dl-open dl-active'),
345						  $this.next().slideToggle(s));
346				});
347		},
348
349		//Adv FAQ
350		DL_Adv_Faq: function ($scope, $) {
351			var t = $scope.find('.droit-accordion-wrapper'),
352				h = $scope.find('.dl_accordion_item_title'),
353				r = $scope.data('type'),
354				s = 400;
355			h.each(function () {
356				$(this).hasClass('dl-active-default') &&
357					($(this).addClass('dl-open dl-active'), $(this).next().slideDown(s));
358			}),
359				h.click(function (e) {
360					e.preventDefault();
361					var $this = $(this);
362					$this.hasClass('dl-open')
363						? ($this.removeClass('dl-open dl-active'), $this.next().slideUp(s))
364						: ($this.parent().parent().find(h).removeClass('dl-open dl-active'),
365						  $this.parent().parent().find('.dl_accordion_panel').slideUp(s),
366						  $this.toggleClass('dl-open dl-active'),
367						  $this.next().slideToggle(s));
368				});
369		},
370
371		//Adv Countdown
372		DL_Adv_Countdown: function ($scope, t) {
373			var $selector = $scope.find('.droit-countdown-wrapper'),
374				$countdown_id =
375					void 0 !== $selector.data('countdown-id')
376						? $selector.data('countdown-id')
377						: '',
378				$end_type =
379					void 0 !== $selector.data('end-type')
380						? $selector.data('end-type')
381						: '',
382				$end_title =
383					void 0 !== $selector.data('end-title')
384						? $selector.data('end-title')
385						: '',
386				$end_text =
387					void 0 !== $selector.data('end-text')
388						? $selector.data('end-text')
389						: '',
390				$redirect_url =
391					void 0 !== $selector.data('redirect-url')
392						? $selector.data('redirect-url')
393						: '',
394				$item = $scope.find('#droit-countdown-' + $countdown_id);
395
396			$item.countdown({
397				end: function () {
398					if ('text' == $end_type)
399						$item.html(
400							'<div class="droit-countdown-action-message"><h4 class="droit-countdown-end-title">' +
401								$end_title +
402								'</h4><div class="droit-countdown-end-text">' +
403								$end_text +
404								'</div></div>'
405						);
406					else if ('url' === $end_type) {
407						droit_countdown_redirect($redirect_url);
408					}
409				},
410			});
411		},
412
413		//Adv Process
414		DL_Adv_Process: function ($scope) {
415			var t = $scope.find('.droit-process-box-hover');
416			t.each(function () {
417				$(this).hasClass('process-default-active') &&
418					$(this).addClass('process-active-default');
419			}),
420				$(t).hover(
421					function () {
422						$(this).addClass('process-active');
423						$('.process-default-active').removeClass('process-active-default');
424					},
425					function () {
426						$(this).removeClass('process-active');
427						$('.process-default-active').addClass('process-active-default');
428					}
429				);
430		},
431
432		//Animated Heading
433		Animated_Heading: function ($scope) {
434			
435			var $item = $scope.find('.dl_animated_headline'),
436				$animationDelay = $item.data('animation-delay');
437			droitAnimatedText({
438				selector: $item,
439				animationDelay: $animationDelay,
440			});
441		},
442
443		//Alert
444		Alert: function ($scope) {
445			var $item = $scope.find('.dl_alert_close');
446			$($item).on('click', function () {
447				$(this).parents('.dl_alert_box').hide();
448			});
449		},
450		Droit_Wrapper_Link: function ($) {
451			$('[data-section-link').each(function () {
452				var url = $(this).data('section-link');
453				$(this).on('click.SectionOnClick', function () {
454					if (url.is_external) {
455						window.open(url.url);
456					} else {
457						location.href = url.url;
458					}
459				});
460			});
461		},
462
463		/**
464		 * DL_Bar_Chart
465		 * return bar chart
466		 */
467
468		DL_Bar_Chart: function ($scope) {
469			let $wrap = $scope.find('.droit-barchart');
470			let $ids = $wrap.data('barchatid');
471			let $settings = $wrap.data('settings');
472
473			if ($ids) {
474				var $chart_type = $settings.hasOwnProperty('chart_type')
475						? $settings.chart_type
476						: 'x',
477					$labels = $settings.hasOwnProperty('labels')
478						? $settings.labels
479						: ['January', 'February', 'March', 'April', 'May', 'June'],
480					$datasets = $settings.hasOwnProperty('datasets')
481						? $settings.datasets
482						: $sampleDatasets,
483					$x_axes_grid_line = $settings.hasOwnProperty('x_axes_grid_line')
484						? $settings.x_axes_grid_line
485						: true,
486					$y_axes_grid_line = $settings.hasOwnProperty('y_axes_grid_line')
487						? $settings.y_axes_grid_line
488						: true,
489					$x_axes_labels = $settings.hasOwnProperty('x_axes_labels')
490						? $settings.x_axes_labels
491						: true,
492					$y_axes_labels = $settings.hasOwnProperty('y_axes_labels')
493						? $settings.y_axes_labels
494						: true,
495					$show_tooltips = $settings.hasOwnProperty('show_tooltips')
496						? $settings.show_tooltips
497						: true,
498					$show_title = $settings.hasOwnProperty('show_title')
499						? $settings.show_title
500						: true,
501					$title_text = $settings.hasOwnProperty('title')
502						? $settings.title
503						: 'Droit Bar Charts',
504					$title_position = $settings.hasOwnProperty('title_position')
505						? $settings.title_position
506						: 'center',
507					$show_legend = $settings.hasOwnProperty('show_legend')
508						? $settings.show_legend
509						: true,
510					$legend_position = $settings.hasOwnProperty('legend_position')
511						? $settings.legend_position
512						: 'top',
513					$usePointStyle =
514						$settings.hasOwnProperty('legend_type') &&
515						$settings.legend_type === 'point'
516							? true
517							: false,
518					$set_scale_axes = $settings.hasOwnProperty('set_scale_axes')
519						? $settings.set_scale_axes
520						: 10,
521					$set_scale_step = $settings.hasOwnProperty('set_scale_step')
522						? $settings.set_scale_step
523						: 2;
524
525				let $ctx = document.getElementById('barchat-' + $ids).getContext('2d');
526				let $ctOptions = {
527					type: 'bar',
528					options: {},
529					data: {},
530				};
531
532				if ($labels.length > 0) {
533					$ctOptions.data.labels = $labels;
534				}
535
536				if ($datasets.length > 0) {
537					$ctOptions.data.datasets = $datasets;
538				}
539
540				if ($chart_type != '') {
541					$ctOptions.options.indexAxis = $chart_type;
542				}
543
544				$ctOptions.options.maintainAspectRatio = false;
545				$ctOptions.options.scales = {};
546
547				// y
548				$ctOptions.options.scales.y = {
549					beginAtZero: true,
550					max: parseInt($set_scale_axes),
551					ticks: {
552						stepSize: parseInt($set_scale_step),
553					},
554					grid: {
555						display: $y_axes_grid_line,
556					},
557					display: $y_axes_labels,
558				};
559
560				// x
561				$ctOptions.options.scales.x = {
562					grid: {
563						display: $x_axes_grid_line,
564					},
565					display: $x_axes_labels,
566				};
567
568				// plugin
569				$ctOptions.options.plugins = {
570					tooltip: {
571						enabled: $show_tooltips,
572					},
573					title: {
574						display: $show_title,
575						text: $title_text,
576						align: $title_position,
577					},
578					legend: {
579						display: $show_legend,
580						position: $legend_position,
581						labels: {
582							usePointStyle: $usePointStyle,
583						},
584					},
585					axes: {
586						display: $show_legend,
587						labels: {
588							usePointStyle: $usePointStyle,
589						},
590					},
591				};
592
593				new Chart($ctx, $ctOptions);
594			}
595		},
596		// end dl bar chart..
597
598		DL_Progress_Bar: function ($scope) {
599			// Remove svg.radial-progress .complete inline styling
600			$('svg.radial-progress').each(function (index, value) {
601				$(this).find($('circle.complete')).removeAttr('style');
602			});
603
604			$(window)
605				.scroll(function () {
606					$('svg.radial-progress').each(function (index, value) {
607						// If svg.radial-progress is approximately 25% vertically into the window when scrolling from the top or the bottom
608						if (
609							$(window).scrollTop() >
610								$(this).offset().top - $(window).height() * 0.75 &&
611							$(window).scrollTop() <
612								$(this).offset().top +
613									$(this).height() -
614									$(window).height() * 0.25
615						) {
616							// Get percentage of progress
617							var percent = $(value).data('percentage');
618
619							// Get radius of the svg's circle.complete
620							var radius = $(this).find($('circle.complete')).attr('r');
621
622							// Get circumference (2πr)
623							var circumference = 2 * Math.PI * radius;
624
625							// Get stroke-dashoffset value based on the percentage of the circumference
626							var strokeDashOffset =
627								circumference - (percent * circumference) / 100;
628
629							// Transition progress for 1.25 seconds
630							$(this)
631								.find($('circle.complete'))
632								.animate({ 'stroke-dashoffset': strokeDashOffset }, 1250);
633						}
634					});
635				})
636				.trigger('scroll');
637		},
638
639		DL_Skill_Bar: function ($scope) {
640			var $find = $scope.find('.dl-progress-bar');
641			if ($find.length > 0) {
642				$find.each(function () {
643					$(this).css('width', $(this).data('value') + '%');
644					$(this).css('transition-duration', $(this).data('duration') + 'ms');
645				});
646			}
647		},
648	};
649
650	function droit_countdown_redirect(url) {
651		window.location.replace(url);
652	}
653	// load elementor
654	$window.on('elementor/frontend/init', dlWidgets.LoadWidgets);
655})(jQuery, window);

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.