PageSourceSearch

https://www.aquatoursalmeria.es/wp-content/themes/aquatours/themif…/js/themify.builder.script.js?ver=2.0.8

js aquatoursalmeria.es collected 2026-10-07 18:43:11 UTC 14,238 bytes, 528 lines download raw bytes

1;var ThemifyBuilderModuleJs;
2(function($, window, document, undefined) {
3
4	'use strict';
5
6	ThemifyBuilderModuleJs = {
7
8		wow: null,
9
10		fwvideos: [], // make it accessible to public
11
12		init: function() {
13			this.setupBodyClasses();
14			this.bindEvents();
15		},
16
17		bindEvents: function() {
18			var self = ThemifyBuilderModuleJs;
19
20			$(document).ready(function(){
21
22				self.wowInit();
23				self.showcaseGallery();
24				self.touchdropdown();
25				self.accordion();
26				
27				if ( 'undefined' !== typeof $.fn.themifyScrollHighlight ) {
28					$('body').themifyScrollHighlight();
29				}
30
31				if(tbLocalScript.isTouch) return;
32				// put code for mobile on
33			});
34
35			$(window).load(function(){
36				self.carousel();
37				self.tabs();
38				self.tabsDeepLink();
39				self.animatedBackground();
40				self.charts();
41				self.backgroundSlider();
42
43				if ( tbLocalScript.isTouch ) {
44					self.fullheight();
45					return;
46				}
47				self.fullwidthVideo();
48				if ( tbLocalScript.isParallaxActive ) {
49					self.backgroundScrolling();
50				}
51			});
52
53			$(window).bind( 'hashchange', function(){
54				self.tabsDeepLink();
55			} );
56		},
57
58		wowInit: function() {
59			var self = this;
60			if ( tbLocalScript.animationInviewSelectors.length == 0 ) return;
61
62			self.animationOnScroll();
63			self.wow = new WOW({live: false});
64			self.wow.init();
65
66			$('body').on( 'builder_load_module_partial builder_toggle_frontend', function(){
67				self.wow.doSync();
68				self.wow.sync();
69			});
70		},
71
72		loadOnAjax: function() {
73			ThemifyBuilderModuleJs.touchdropdown();
74			ThemifyBuilderModuleJs.accordion();
75			ThemifyBuilderModuleJs.tabs();
76			ThemifyBuilderModuleJs.carousel(true);
77			ThemifyBuilderModuleJs.charts();
78		},
79
80		fullheight: function() {
81			// Set full-height rows to viewport height
82			if ( navigator.userAgent.match(/(iPad)/g) ) {
83				var didResize = false,
84					selector = '.themify_builder_row.fullheight';
85				$(window).resize(function() {
86					didResize = true;
87				});
88				setInterval(function() {
89					if ( didResize ) {
90						didResize = false;
91						$(selector).each(function(){
92							$(this).css({
93								'height': $(window).height()
94							});
95						});
96					}
97				}, 250);
98			}
99		},
100
101		// Row: Background Slider
102		backgroundSlider: function() {
103
104			var $rowSliders = $('.row-slider');
105
106			if ( 'undefined' === typeof themifySectionVars ) {
107				// Define vars if they aren't
108				var themifySectionVars = {
109					autoplay: '5000',
110					speed: '2000',
111					play: 'yes',
112					wrap: 'yes'
113				};
114			}
115
116			// Parse injected vars
117			themifySectionVars.autoplay = parseInt(themifySectionVars.autoplay, 10);
118			if ( themifySectionVars.autoplay <= 10 ) {
119				themifySectionVars.autoplay *= 1000;
120			}
121			themifySectionVars.speed = parseInt(themifySectionVars.speed, 10);
122			themifySectionVars.play = themifySectionVars.play != 'no';
123			themifySectionVars.wrap = themifySectionVars.wrap != 'no';
124
125			if ( $rowSliders.length > 0 ) {
126
127				// Initialize slider
128				$rowSliders.each( function() {
129					var $thisRowSlider = $(this),
130						$backel = $thisRowSlider.closest('.row_inner'),
131						rsImages = [],
132						bgMode = $thisRowSlider.data('bgmode');
133
134					// Initialize images array with URLs
135					$thisRowSlider.find('li').each(function(){
136						rsImages.push( $(this).attr('data-bg') );
137					});
138
139					// Call backstretch for the first time
140					$backel.backstretch(rsImages, {
141						fade : themifySectionVars.speed,
142						mode: bgMode
143					});
144					// Cache Backstretch object
145					var thisBGS = $backel.data('backstretch');
146
147					// Previous and Next arrows
148					$thisRowSlider.find('.row-slider-prev').on('click', function(e){
149						e.preventDefault();
150						thisBGS.prev();
151					});
152					$thisRowSlider.find('.row-slider-next').on('click', function(e){
153						e.preventDefault();
154						thisBGS.next();
155					});
156
157					// Dots
158					$thisRowSlider.find('.row-slider-dot').each(function(){
159						var $dot = $(this);
160						$dot.on('click', function(){
161							thisBGS.show( $dot.data('index') );
162						});
163					});
164
165				});
166			}
167
168		},
169
170		// Row: Animated Color Background
171		animatedBackground: function(){
172			if ( 'undefined' !== typeof $.fn.animatedBG && 'object' === typeof themifyScript ) {
173				if ( ( 'string' === typeof themifyScript.colorAnimationSet && 'string' === typeof themifyScript.colorAnimationSpeed ) && ( '' != themifyScript.colorAnimationSet && '' != themifyScript.colorAnimationSpeed ) ) {
174					$('.themify_builder_row.animated-bg').animatedBG({
175						colorSet: themifyScript.colorAnimationSet.split(','),
176						speed: parseInt( themifyScript.colorAnimationSpeed, 10 )
177					});
178				}
179			}
180		},
181
182		// Row: Fullwidth video background
183		fullwidthVideo: function(){
184			if ( typeof $.BigVideo !== 'undefined' ) {
185				var $videos = $('.themify_builder_row[data-fullwidthvideo]'),
186					self = ThemifyBuilderModuleJs;
187				$.each($videos, function (i, elm) {
188					self.fwvideos[i] = new $.BigVideo({
189						useFlashForFirefox: true,
190						container: $(elm).find('.row_inner'),
191						doLoop : true,
192						id: i
193					});
194					self.fwvideos[i].init();
195					self.fwvideos[i].show($(elm).data('fullwidthvideo'));
196				});
197			}
198		},
199
200		touchdropdown: function(){
201			if( typeof jQuery.fn.themifyDropdown == 'function' ) {
202				$( '.module-menu .nav' ).themifyDropdown();
203			}
204		},
205
206		accordion: function() {
207			$('.module.module-accordion').themify_accordion();
208		},
209
210		charts: function() {
211			$('.module-feature .module-feature-chart').each(function(){
212				$(this).waypoint(function(){
213					var $self = $(this),
214						barColor = $self.data('color'),
215						percent = $self.data('percent');
216
217					$self.easyPieChart( {
218						'percent' : percent,
219						'barColor' : barColor,
220						'trackColor' : $self.data('trackcolor'),
221						'scaleColor' : $self.data('scalecolor'),
222						'lineCap' : $self.data('linecap'),
223						'rotate' : $self.data('rotate'),
224						'size' : $self.data('size'),
225						'lineWidth' : $self.data('linewidth'),
226						'animate' : $self.data('animate')
227					} );
228				}, {
229					offset: '100%',
230					triggerOnce: true
231				});
232			});
233		},
234
235		showcaseGallery : function() {
236			$( 'body' ).on( 'click', '.module.module-gallery.layout-showcase a', function(){
237				$( this ).closest( '.gallery' ).find( '.gallery-showcase-image img' ).prop( 'src', $(this).data( 'image' ) );
238				return false;
239			});
240		},
241
242		tabs: function() {
243			$(".module.module-tab").each(function(){
244				var $height = $(".tab-nav", this).outerHeight();
245				if($height > 200) {
246					$(".tab-content", this).css('min-height', $height);
247				}
248			});
249			$(".module.module-tab").tabify();
250		},
251
252		tabsDeepLink: function() {
253			var hash = window.location.hash;
254			if ( '' != hash && '#' != hash && $( hash + '.tab-content' ).length > 0 ) {
255				var cons = 100,
256					$moduleTab = $( hash ).closest( '.module-tab' );
257				if ( $moduleTab.length > 0 ) {
258					$( 'a[href=' + hash + ']' ).click();
259					$( 'html, body' ).animate( { scrollTop: $moduleTab.offset().top - cons }, 1000 );
260				}
261			}
262		},
263
264		carousel: function(checkImageLoaded) {
265			checkImageLoaded = checkImageLoaded || false;
266			$('.themify_builder_slider').each(function(){
267				var $this = $(this),
268					img_length = $this.find('img').length,
269					$args = {
270					responsive: true,
271					circular: true,
272					infinite: true,
273					items: {
274						visible: { min: 1, max: $this.data('visible') },
275						width: 150,
276						height: 'variable'
277					},
278					onCreate: function( items ) {
279						$('.themify_builder_slider_wrap').css({'visibility':'visible', 'height':'auto'});
280						$this.trigger('updateSizes');
281						$('.themify_builder_slider_loader').remove();
282					}
283				};
284
285				if($this.closest('.themify_builder_slider_wrap').find('.caroufredsel_wrapper').length > 0) {
286					return;
287				}
288
289				// fix the one slide problem
290				if($this.children().length < 2) {
291					$('.themify_builder_slider_wrap').css({'visibility':'visible', 'height':'auto'});
292					$('.themify_builder_slider_loader').remove();
293					$(window).resize();
294					return;
295				}
296
297				// Auto
298				if(parseInt($this.data('auto-scroll')) > 0) {
299					$args.auto = {
300						play: true,
301						timeoutDuration: parseInt($this.data('auto-scroll') * 1000)
302					};
303				}
304				else if($this.data('effect') !== 'continuously' && ( typeof $this.data('auto-scroll') !== 'undefined' || parseInt($this.data('auto-scroll')) == 0 )  ){
305					$args.auto = false;
306				}
307
308				// Touch
309				$args.swipe = true;
310
311				// Scroll
312				if($this.data('effect') == 'continuously'){
313					if(typeof $args.auto !== 'undefined'){
314						delete $args.auto;
315					}
316					var speed = $this.data('speed'), duration;
317					if ( speed == .5 ) {
318						duration = 0.10;
319					} else if ( speed == 4 ) {
320						duration = 0.04;
321					} else {
322						duration = 0.07;
323					}
324					$args.auto = { timeoutDuration: 0 };
325					$args.align = false;
326					$args.scroll = {
327						delay: 1000,
328						easing: 'linear',
329						items: $this.data('scroll'),
330						duration: duration,
331						pauseOnHover: $this.data('pause-on-hover')
332					};
333				} else {
334					$args.scroll = {
335						items: $this.data('scroll'),
336						pauseOnHover: $this.data('pause-on-hover'),
337						duration: parseInt($this.data('speed') * 1000),
338						fx: $this.data('effect')
339					}
340				}
341
342				if($this.data('arrow') == 'yes') {
343					$args.prev = '#' + $this.data('id') + ' .carousel-prev';
344					$args.next = '#' + $this.data('id') + ' .carousel-next';
345				}
346
347				if($this.data('pagination') == 'yes') {
348					$args.pagination = { container: '#' + $this.data('id') + ' .carousel-pager' };
349				}
350
351				if($this.data('wrapper') == 'no') {
352					$args.wrapper = {
353						element: false
354					}
355				}
356
357				if ( checkImageLoaded && img_length > 0 ) {
358					$(this).find('img').themifyBuilderImagesLoaded(function(){
359						$this.carouFredSel($args);
360					});
361				} else {
362					$this.carouFredSel($args);
363				}
364
365				$('.mejs-video').on('resize', function(e){
366					e.stopPropagation();
367				});
368
369				var didResize = false, afterResize;
370				$(window).resize(function() {
371					didResize = true;
372				});
373				setInterval(function() {
374					if ( didResize ) {
375						didResize = false;
376						clearTimeout(afterResize);
377						afterResize = setTimeout(function(){
378							$('.mejs-video').resize();
379							$this.trigger('updateSizes');
380						}, 100);
381					}
382				}, 250);
383
384			});
385		},
386
387		request: 0,
388
389		initialize: function(address, num, zoom, type, scroll, drag) {
390			var delay = this.request++ * 500;
391			setTimeout( function(){
392				var geo = new google.maps.Geocoder(),
393					latlng = new google.maps.LatLng(-34.397, 150.644),
394					mapOptions = {
395						'zoom': zoom,
396						center: latlng,
397						mapTypeId: google.maps.MapTypeId.ROADMAP,
398						scrollwheel: scroll,
399						draggable: drag
400					};
401				switch( type.toUpperCase() ) {
402					case 'ROADMAP':
403						mapOptions.mapTypeId = google.maps.MapTypeId.ROADMAP;
404						break;
405					case 'SATELLITE':
406						mapOptions.mapTypeId = google.maps.MapTypeId.SATELLITE;
407						break;
408					case 'HYBRID':
409						mapOptions.mapTypeId = google.maps.MapTypeId.HYBRID;
410						break;
411					case 'TERRAIN':
412						mapOptions.mapTypeId = google.maps.MapTypeId.TERRAIN;
413						break;
414				}
415				var	map = new google.maps.Map( document.getElementById( 'themify_map_canvas_' + num ), mapOptions );
416				geo.geocode( { 'address': address}, function(results, status) {
417					if (status == google.maps.GeocoderStatus.OK) {
418						map.setCenter(results[0].geometry.location);
419						var marker = new google.maps.Marker({
420							map: map,
421							position: results[0].geometry.location
422						}),
423
424						info = $('#themify_map_canvas_' + num).data('info-window'),
425
426						contentString = '<div class="themify_builder_map_info_window">'+ info +'</div>',
427
428						infowindow = new google.maps.InfoWindow({
429							content: contentString
430						});
431
432						google.maps.event.addListener( marker, 'click', function() {
433							infowindow.open( map, marker );
434						});
435					}
436				});
437			}, delay );
438		},
439
440		backgroundScrolling: function() {
441			$('.builder-parallax-scrolling').each(function(){
442				$(this).builderParallax('50%', 0.1);
443			});
444		},
445
446		animationOnScroll: function() {
447			var self = ThemifyBuilderModuleJs;
448			if(!self.supportTransition()) return;
449
450			$('body').addClass('animation-on')
451			.on('builder_toggle_frontend', function(event, is_edit){
452				self.doAnimation();
453			});
454			self.doAnimation();
455		},
456
457		doAnimation: function( resync ){
458			resync = resync || false;
459			// On scrolling animation
460			var self = ThemifyBuilderModuleJs, selectors = tbLocalScript.animationInviewSelectors,
461				newSelectors = tbLocalScript.animationNewSelectors,
462				iterate = 0, animateEnd, $body = $('body'), $overflow = $('body');
463
464			if(!ThemifyBuilderModuleJs.supportTransition()) return;
465
466			if ( $body.find(selectors).length > 0 ) {
467				if( !$overflow.hasClass('animation-running')){
468					$overflow.addClass('animation-running');
469				}
470			} else {
471				if( $overflow.hasClass('animation-running')){
472					$overflow.removeClass('animation-running');
473				}
474			}
475
476			// Global Animation
477			if ( tbLocalScript.createAnimationSelectors.selectors ) {
478				$.each(tbLocalScript.createAnimationSelectors.selectors, function(key, val){
479					$(val).addClass(tbLocalScript.createAnimationSelectors.effect);
480				});
481			}
482			
483			// Specific Animation
484			if ( tbLocalScript.createAnimationSelectors.specificSelectors ) {
485				$.each(tbLocalScript.createAnimationSelectors.specificSelectors, function(selector, effect){
486					$(selector).addClass(effect);
487				});
488			}
489
490			// Core Builder Animation
491			$.each(selectors, function(i,selector){
492				$(selector).addClass('wow');
493			});
494
495			if ( resync ) 
496				self.wow.doSync();
497		},
498
499		supportTransition: function() {
500			var b = document.body || document.documentElement,
501				s = b.style,
502				p = 'transition';
503
504			if (typeof s[p] == 'string') { return true; }
505
506			// Tests for vendor specific prop
507			var v = ['Moz', 'webkit', 'Webkit', 'Khtml', 'O', 'ms'];
508			p = p.charAt(0).toUpperCase() + p.substr(1);
509
510			for (var i=0; i<v.length; i++) {
511				if (typeof s[v[i] + p] == 'string') { return true; }
512			}
513			return false;
514		},
515
516		setupBodyClasses: function(){
517			var classes = [];
518			if(tbLocalScript.isTouch) 
519				classes.push( 'builder-is-touch' );
520
521			$('body').addClass( classes.join(' ') );
522		}
523	};
524
525	// Initialize
526	ThemifyBuilderModuleJs.init();
527
528}(jQuery, window, document));

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.