PageSourceSearch

https://institutoresonare.com.br/wp-content/themes/Divi/epanel/sho…/js/et_shortcodes_frontend.js?ver=4.7.7

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

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.