PageSourceSearch

https://gaussianos.com/wp-content/themes/Extra/epanel/shortcodes/js/et_shortcodes_frontend.js?ver=4.27.8

js gaussianos.com collected 2026-09-24 09:12:07 UTC 13,869 bytes, 381 lines download raw bytes

1/*! ET et_shortcodes_frontend.js */
2// et_switcher plugin v2.2
3(function($)
4{
5	$.fn.et_shortcodes_switcher = function(options)
6	{
7		var defaults =
8		{
9		   slides: '>div',
10		   activeClass: 'active',
11		   linksNav: '',
12		   findParent: true, //use parent elements to define active states
13		   lengthElement: 'li', //parent element, used only if findParent is set to true
14		   useArrows: false,
15		   arrowLeft: 'a#prev-arrow',
16		   arrowRight: 'a#next-arrow',
17		   auto: false,
18		   autoSpeed: 5000,
19		   slidePadding: '',
20		   pauseOnHover: true,
21		   fx: 'fade',
22		   sliderType: ''
23		};
24
25		var options = $.extend(defaults, options);
26
27		return this.each(function()
28		{
29			var slidesContainer = jQuery(this).parent().css('position','relative'),
30				$slides = jQuery(this).css({'overflow':'hidden','position':'relative'}),
31				$slides_wrapper_box = slidesContainer.find('.et-tabs-content-wrapper'),
32				$slides_wrapper = $slides_wrapper_box.parent(),
33				$slide = $slides.find( '.et-tabs-content-wrapper' + options.slides),
34				slidesNum = $slide.length,
35				zIndex = slidesNum,
36				currentPosition = 1,
37				slideHeight = 0,
38				$activeSlide,
39				$nextSlide,
40				slides_wrapper_width = $slides_wrapper.width(),
41				$et_shortcodes_mobile_nav,
42				$et_shortcodes_mobile_controls;
43
44			if (options.fx === 'slide') {
45				$slides_wrapper_box.width( ( ( slidesNum + 2 ) * 200 ) + '%' );
46				$slide.css({
47					'width': slides_wrapper_width + 'px',
48					'visibility': 'visible',
49				});
50
51				$slides_wrapper_box.append($slide.first().clone().removeClass().addClass('et_slidecontent_cloned'));
52				$slides_wrapper_box.prepend( $slide.last().clone().removeClass().addClass('et_slidecontent_cloned') );
53
54				$slides_wrapper_box.css('left', - slides_wrapper_width + 'px');
55			}
56
57			$slide.first().css({ 'display': 'block' }).addClass('et_shortcode_slide_active');
58
59			if ('' !== options.slidePadding) {
60				var slidePaddingOption = 'number' === typeof options.slidePadding ? options.slidePadding + 'px' : options.slidePadding;
61				$slide.css('padding', slidePaddingOption);
62			}
63
64			if (options.linksNav != '') {
65				var linkSwitcher = jQuery(options.linksNav);
66
67				var linkSwitcherTab = '';
68				if (options.findParent) linkSwitcherTab = linkSwitcher.parent();
69				else linkSwitcherTab = linkSwitcher;
70
71				if (!linkSwitcherTab.filter('.active').length) linkSwitcherTab.first().addClass('active');
72
73				linkSwitcher.on('click', function() {
74					var targetElement, orderNum;
75
76					if (options.findParent) targetElement = jQuery(this).parent();
77					else targetElement = jQuery(this);
78
79					orderNum = targetElement.prevAll(options.lengthElement).length+1;
80
81					if (orderNum > currentPosition) gotoSlide(orderNum, 1);
82					else gotoSlide(orderNum, -1);
83
84					return false;
85				});
86			}
87
88
89			if (options.useArrows) {
90				var $right_arrow = jQuery(options.arrowRight),
91					$left_arrow = jQuery(options.arrowLeft);
92
93				$right_arrow.on('click', function(){
94					et_shortcodes_go_to_next_slide();
95					return false;
96				});
97
98				$left_arrow.on('click', function(){
99					et_shortcodes_go_to_previous_slide();
100					return false;
101				});
102
103			}
104
105			function changeTab(){
106				if (linkSwitcherTab != '') {
107					linkSwitcherTab.siblings().removeClass('active');
108					linkSwitcherTab.eq(currentPosition - 1).addClass('active');
109				}
110			}
111
112			function gotoSlide(slideNumber,dir){
113				if ($slide.filter(':animated').length) return;
114
115				$activeSlide = $slide.parent().find('.et_slidecontent').eq(currentPosition - 1);
116
117				if (currentPosition === slideNumber) return;
118
119				$activeSlide.removeClass('et_shortcode_slide_active');
120
121				$nextSlide = $slide.parent().find('.et_slidecontent').eq(slideNumber - 1).addClass('et_shortcode_slide_active');
122
123				if ((currentPosition > slideNumber || currentPosition === 1) && (dir === -1)) {
124					if (options.fx === 'slide') slideBack(500);
125					if (options.fx === 'fade') slideFade(500);
126				} else {
127					if (options.fx === 'slide') slideForward(500);
128					if (options.fx === 'fade') slideFade(500);
129				}
130
131				currentPosition = $nextSlide.prevAll('.et_slidecontent').length + 1;
132
133				if (options.linksNav != '') changeTab();
134
135				if ( options.sliderType === 'images' || options.sliderType === 'simple' ){
136					$et_shortcodes_mobile_controls.find('li').removeClass('et_shortcodes_active_control');
137					$et_shortcodes_mobile_controls.find('li').eq(currentPosition-1).addClass('et_shortcodes_active_control');
138				}
139
140				return false;
141			}
142
143
144			if (options.auto) {
145				auto_rotate();
146				var pauseSlider = false;
147			}
148
149			if (options.pauseOnHover) {
150				slidesContainer.on('mouseenter', function(){
151					pauseSlider = true;
152				}).on('mouseleave', function(){
153					pauseSlider = false;
154				});
155			}
156
157			function auto_rotate(){
158				interval_shortcodes = setInterval(function(){
159					if (!pauseSlider) {
160						if (currentPosition === slidesNum)
161							gotoSlide(1,1);
162						else
163							gotoSlide(currentPosition+1,1);
164
165						if (options.linksNav != '') changeTab();
166					}
167				},options.autoSpeed);
168			}
169
170			function slideFade(speed){
171				$activeSlide.css( { 'display' : 'none', 'opacity' : '0' } );
172
173				$nextSlide.css({'opacity' : '0', 'display':'block'}).animate( { opacity : 1 }, 700 );
174			}
175
176			function slideForward(speed){
177				var next_slide_order = $nextSlide.prevAll('.et_slidecontent').length+1,
178					go_to_first_slide = false;
179
180				if ( $activeSlide.next('.et_slidecontent_cloned').length ) {
181					next_slide_order = $activeSlide.prevAll().length+1;
182					go_to_first_slide = true;
183				}
184
185				$slides_wrapper_box.animate( { left : - ( $slides_wrapper.width() * next_slide_order ) }, 500, function(){
186					if (go_to_first_slide) {
187						$slides_wrapper_box.css('left', - $slides_wrapper.width() + 'px');
188					}
189				} );
190			}
191
192			function slideBack(speed){
193				var next_slide_order = $nextSlide.prevAll('.et_slidecontent').length+1,
194					go_to_last_slide = false;
195
196				if ( $activeSlide.prev('.et_slidecontent_cloned').length ) {
197					next_slide_order = 0;
198					go_to_last_slide = true;
199				}
200
201				$slides_wrapper_box.animate( { left : - ( $slides_wrapper.width() * next_slide_order ) }, 500, function(){
202					if (go_to_last_slide) {
203						$slides_wrapper_box.css('left', - ($slides_wrapper.width() * slidesNum) + 'px');
204					}
205				} );
206			}
207
208			if (options.fx === 'slide') {
209				$(window).on('resize', function(){
210					$slides_wrapper_box.find('>div').css({ 'width' : $slides_wrapper.width() + 'px' });
211					$slides_wrapper_box.css('left', - ($slides_wrapper.width() * currentPosition) + 'px');
212				} );
213			}
214
215			et_generate_mobile_nav();
216
217			function et_generate_mobile_nav(){
218				var et_shortcodes_slides_num = slidesContainer.find( '.et_slidecontent' ).length,
219					et_shortcodes_controllers_html = '';
220
221				if ( et_shortcodes_slides_num > 1 && ( options.sliderType === 'images' || options.sliderType === 'simple' ) ){
222					slidesContainer.append( '<div class="et_shortcodes_controller_nav">' + '<ul class="et_shortcodes_controls"></ul>' + '<ul class="et_shortcodes_controls_arrows"><li><a href="#" class="et_sc_nav_next">' + et_shortcodes_strings.next + '<span></span></a></li><li><a href="#" class="et_sc_nav_prev">' + et_shortcodes_strings.previous + '<span></span></a></li></ul>' + '</div>' );
223
224					$et_shortcodes_mobile_controls = slidesContainer.find('.et_shortcodes_controls');
225					for ( var i = 0; i < et_shortcodes_slides_num; i++ ) {
226						et_shortcodes_controllers_html += '<li><a href="#"></a></li>';
227					}
228					$et_shortcodes_mobile_controls.prepend( et_shortcodes_controllers_html );
229					$et_shortcodes_mobile_controls.find('li').first().addClass('et_shortcodes_active_control');
230					$et_shortcodes_mobile_controls.find('a').on('click', function() {
231						var $this_control = $(this),
232							$this_control_li = $this_control.parent('li'),
233							this_order = $this_control_li.prevAll().length+1;
234
235						if ( this_order == currentPosition ) return false;
236
237						if ( this_order > currentPosition ) gotoSlide(this_order, 1);
238						else gotoSlide(this_order, -1);
239
240						return false;
241					});
242
243					$et_shortcodes_mobile_nav = slidesContainer.find('.et_shortcodes_controls_arrows');
244					$et_shortcodes_mobile_nav.find('a').on('click', function() {
245						var $this_link = jQuery(this),
246							et_active_slide_order;
247
248						if ( $this_link.hasClass( 'et_sc_nav_next' ) )
249							et_shortcodes_go_to_next_slide();
250
251						if ( $this_link.hasClass( 'et_sc_nav_prev' ) )
252							et_shortcodes_go_to_previous_slide();
253
254						$et_shortcodes_mobile_controls.find('li').removeClass('et_shortcodes_active_control');
255
256						et_active_slide_order = currentPosition - 1;
257
258						$et_shortcodes_mobile_controls.find('li').eq( et_active_slide_order ).addClass('et_shortcodes_active_control');
259
260						return false;
261					});
262				} else if ( options.sliderType !== 'images' && options.sliderType !== 'simple' ) {
263					slidesContainer.prepend( '<ul class="et_shortcodes_mobile_nav"><li><a href="#" class="et_sc_nav_next">' + et_shortcodes_strings.next + '<span></span></a></li><li><a href="#" class="et_sc_nav_prev">' + et_shortcodes_strings.previous + '<span></span></a></li></ul>' );
264					$et_shortcodes_mobile_nav = slidesContainer.find('.et_shortcodes_mobile_nav');
265					$et_shortcodes_mobile_nav.find('a').on('click', function() {
266						var $this_link = jQuery(this);
267
268						if ( $this_link.hasClass( 'et_sc_nav_next' ) )
269							et_shortcodes_go_to_next_slide();
270
271						if ( $this_link.hasClass( 'et_sc_nav_prev' ) )
272							et_shortcodes_go_to_previous_slide();
273
274						return false;
275					});
276				}
277			}
278
279			function et_shortcodes_go_to_next_slide(){
280				if (currentPosition === slidesNum)
281					gotoSlide(1,1);
282				else
283					gotoSlide(currentPosition+1,1);
284
285				if (options.linksNav != '') changeTab();
286			}
287
288			function et_shortcodes_go_to_previous_slide(){
289				if (currentPosition === 1)
290					gotoSlide(slidesNum,-1);
291				else
292					gotoSlide(currentPosition-1,-1);
293
294				if (options.linksNav != '') changeTab();
295			}
296		});
297	}
298
299	window.et_shortcodes_init = function( $container ) {
300		var $processed_container = typeof $container !== 'undefined' ? $container : $( 'body' );
301		var $et_pricing_table_button = $processed_container.find('.pricing-table a.icon-button');
302
303		$et_tooltip = $processed_container.find('.et-tooltip');
304		$et_tooltip.on('mouseover mouseout', function(event){
305			if (event.type == 'mouseover') {
306				$(this).find('.et-tooltip-box').stop(true,true).animate({ opacity: 'show', bottom: '25px' }, 300);
307			} else {
308				$(this).find('.et-tooltip-box').delay(200).animate({ opacity: 'hide', bottom: '35px' }, 300);
309			}
310		});
311		// learn more
312		$et_learn_more = $processed_container.find('.et-learn-more .heading-more');
313		$et_learn_more.on('click', function() {
314			if ( $(this).hasClass('open') ) {
315				$(this).removeClass('open');
316			} else {
317				$(this).addClass('open');
318			}
319
320			$(this).parent('.et-learn-more').find('.learn-more-content').animate({ opacity: 'toggle', height: 'toggle' }, 300);
321		});
322
323		$processed_container.find('.et-learn-more').not('.et-open').find('.learn-more-content').css( { 'visibility' : 'visible', 'display' : 'none' } );
324
325		$et_pricing_table_button.each( function(){
326			var $this_button 			= $(this),
327				this_button_width 		= $this_button.width(),
328				this_button_innerwidth 	= $this_button.innerWidth();
329
330			$this_button.css({
331				width: this_button_width + 'px',
332				'marginLeft': '-' + (this_button_innerwidth / 2) + 'px',
333				'visibility': 'visible',
334			});
335		} );
336
337		var $et_shortcodes_tabs = $processed_container.find('.et-tabs-container, .tabs-left, .et-simple-slider, .et-image-slider');
338		$et_shortcodes_tabs.each(function(i){
339			var et_shortcodes_tab_class = $(this).attr('class'),
340				et_shortcodes_tab_autospeed_class_value = /et_sliderauto_speed_(\d+)/g,
341				et_shortcodes_tab_autospeed = et_shortcodes_tab_autospeed_class_value.exec( et_shortcodes_tab_class ),
342				et_shortcodes_tab_auto_class_value = /et_sliderauto_(\w+)/g,
343				et_shortcodes_tab_auto = et_shortcodes_tab_auto_class_value.exec( et_shortcodes_tab_class ),
344				et_shortcodes_tab_type_class_value = /et_slidertype_(\w+)/g,
345				et_shortcodes_tab_type = et_shortcodes_tab_type_class_value.exec( et_shortcodes_tab_class ),
346				et_shortcodes_tab_fx_class_value = /et_sliderfx_(\w+)/g,
347				et_shortcodes_tab_fx = et_shortcodes_tab_fx_class_value.exec( et_shortcodes_tab_class ),
348				et_shortcodes_tab_apply_to_element = '.et-tabs-content',
349				et_shortcodes_tab_settings = {};
350
351			et_shortcodes_tab_settings.linksNav = $(this).find('.et-tabs-control li a');
352			et_shortcodes_tab_settings.findParent = true;
353			et_shortcodes_tab_settings.fx = et_shortcodes_tab_fx[1];
354			et_shortcodes_tab_settings.auto = 'false' === et_shortcodes_tab_auto[1] ? false : true;
355			et_shortcodes_tab_settings.autoSpeed = et_shortcodes_tab_autospeed[1];
356
357			if ( 'simple' === et_shortcodes_tab_type[1] ){
358				et_shortcodes_tab_settings = {};
359				et_shortcodes_tab_settings.fx = et_shortcodes_tab_fx[1];
360				et_shortcodes_tab_settings.auto = 'false' === et_shortcodes_tab_auto[1] ? false : true;
361				et_shortcodes_tab_settings.autoSpeed = et_shortcodes_tab_autospeed[1];
362				et_shortcodes_tab_settings.sliderType = 'simple';
363				et_shortcodes_tab_apply_to_element = '.et-simple-slides';
364			} else if ( 'images' === et_shortcodes_tab_type[1] ){
365				et_shortcodes_tab_settings.sliderType = 'images';
366				et_shortcodes_tab_settings.linksNav = '#' + $(this).attr('id') + ' .controllers a.switch';
367				et_shortcodes_tab_settings.findParent = false;
368				et_shortcodes_tab_settings.lengthElement = '#' + $(this).attr('id') + ' a.switch';
369				et_shortcodes_tab_apply_to_element = '.et-image-slides';
370			}
371
372			$(this).find(et_shortcodes_tab_apply_to_element).et_shortcodes_switcher( et_shortcodes_tab_settings );
373		});
374	}
375})(jQuery);
376// end et_switcher plugin v2
377
378/////// Shortcodes Javascript ///////
379jQuery(function($){
380	window.et_shortcodes_init();
381});

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.