PageSourceSearch

https://goldencoastfestival.com/wp-content/plugins/lte-ext/assets/js/frontend.js?ver=1.3.8

js goldencoastfestival.com collected 2026-09-26 07:36:06 UTC 12,055 bytes, 420 lines download raw bytes

1/* LT-Ext Plugin Frontend functions */	
2"use strict";
3jQuery( function() {
4
5	initSwiperWrappers();
6	//initFCSwiper();
7
8	setTimeout(function() { 
9	
10		jQuery('.elementor-tab-title').removeClass('elementor-active');
11		jQuery('.elementor-tab-content').css('display', 'none');
12	}, 100); 
13});
14
15jQuery(window).on('elementor/frontend/init', function () {
16
17    elementorFrontend.hooks.addAction('frontend/element_ready/lte-product-categories.default', initSwiperWrappers);
18    elementorFrontend.hooks.addAction('frontend/element_ready/lte-products.default', initSwiperWrappers);
19    elementorFrontend.hooks.addAction('frontend/element_ready/lte-testimonials.default', initSwiperWrappers);
20    elementorFrontend.hooks.addAction('frontend/element_ready/lte-zoomslider.default', initSwiperWrappers);
21    elementorFrontend.hooks.addAction('frontend/element_ready/lte-gallery.default', initSwiperWrappers);
22
23    elementorFrontend.hooks.addAction('frontend/element_ready/lte-rental-search.default', initCf7Styles);
24    elementorFrontend.hooks.addAction('frontend/element_ready/lte-cf7.default', initCf7Styles);
25
26    elementorFrontend.hooks.addAction('frontend/element_ready/accordion', function() { alert('1'); });
27
28	jQuery('.elementor-tab-title.elementor-active').removeClass('elementor-active');
29  
30});
31
32function initSwiperWrappers() {
33
34	initSwiperSliders();
35	initFilterContainer();	
36}
37
38/* Swiper Slider Containers and Script Initialization */
39function initSwiperSliders() {
40
41	var lteSliders = jQuery('.lte-swiper-slider:not(".lte-inited")');
42
43	jQuery(lteSliders).each(function(i, el) {
44
45		var container = jQuery(el),
46			id = 'lte-id-' + Math.floor(Math.random() * Math.floor(10000)),
47			autoplay = false,
48			autoplay_interact = false,
49			navigation = false,
50			pagination = false,
51			slidesPerView = false,
52			centeredSlides = false,
53			simulateTouch = true,
54			allowTouchMove	= true,
55			spg = 1,
56			slidesPerGroup = 1,
57			spaceBetween = container.data('space-between'),
58			loop = container.data('loop'),
59			effect = container.data('effect'),
60			speed = container.data('speed'),
61			breakpoints_per = container.data('breakpoints').split(';'),
62			breakpoints_viewports = [1599, 1199, 991, 768, 480, 0],
63			breakpoints = {};
64
65		if ( container.data('autoplay') && container.data('autoplay') > 0 ) {
66
67			if ( container.data('autoplay-interaction') === 1 ) {
68
69				autoplay_interact = true;		
70			}
71				else {
72
73				autoplay_interact = false;
74			}
75
76			autoplay = {
77
78				delay: container.data('autoplay'),
79				disableOnInteraction: autoplay_interact,
80			}
81		}
82
83		if ( container.data('center-slide') ) {
84
85			centeredSlides = true;
86		}
87
88		if ( container.data('arrows') ) {
89
90			var arrows_html = '<div class="'+ id + '-arrows lte-arrows lte-arrows-' + container.data('arrows') + '"><a href="#" class="lte-arrow-left"></a><a href="#" class="lte-arrow-right"></a></div>';
91
92			if ( container.data('arrows') == 'right' || container.data('arrows') == 'sides-outside' || container.data('arrows') == 'sides-small' ) {
93
94				jQuery(container).after(arrows_html);
95			}
96				else
97			if ( container.data('arrows') != 'custom' ) {
98
99				jQuery(container).append(arrows_html);
100			}
101
102			navigation = {
103				nextEl: '.' + id + '-arrows .lte-arrow-right',
104				prevEl: '.' + id + '-arrows .lte-arrow-left',
105			}
106		}
107
108		if ( !loop ) loop = false;
109
110		jQuery(breakpoints_per).each(function(i, el) {
111
112			if ( !slidesPerView && el ) {
113
114				slidesPerView = 1;
115				if ( container.data('slides-per-group') ) slidesPerGroup = el;
116				slidesPerGroup = 1;
117			}
118
119			if ( el ) {
120
121
122				if ( container.data('slides-per-group') ) spg = el; else spg = 1;
123				spg = 1;
124				if ( container.data('slides-per-group') == -1 ) spg = -1;
125
126				breakpoints[breakpoints_viewports[i]] = { slidesPerView : el, slidesPerGroup : el };
127				
128				if ( spg == -1 ) delete breakpoints[breakpoints_viewports[i]]['slidesPerGroup']; 		
129			}
130		});
131
132		if ( container.data('pagination') && container.data('pagination') == 'bullets' ) {
133
134			pagination = {
135
136				el: '.swiper-pagination',
137				type: 'bullets',
138				clickable:  true
139			};
140
141			jQuery(container).append('<div class="swiper-pagination"></div>');
142		}
143			else
144		if ( container.data('pagination') && container.data('pagination') == 'fraction' ) {
145
146			pagination = {
147
148				el: '.swiper-pagination',
149				type: 'fraction',			
150			};
151
152			jQuery(container).append('<div class="swiper-pagination"></div>');
153		}
154			else
155		if ( container.data('pagination') && container.data('pagination') == 'custom' ) {
156
157			pagination = {
158				el: '.swiper-pagination-custom',
159				clickable: true,
160				renderBullet: function (index, className) {
161
162					var pages = (container.data('pagination-custom'));
163
164					return '<span class="' + className + ' ' + pages[index]['cats'] +'"><span class="lte-img"><img src="' + pages[index]['image'] + '" alt="' + pages[index]['header'] + '"></span><span class="lte-title">' + pages[index]['header'] + '</span></span>';
165				},
166			};
167		}
168
169		if ( container.data('simulate-touch') ) {
170
171			simulateTouch = false;
172			allowTouchMove = false;
173		}
174
175		if ( !slidesPerView ) slidesPerView = 1;
176
177		var conf = {
178	    	initialSlide	: 0,
179			spaceBetween	: spaceBetween,
180			centeredSlides	: centeredSlides,
181
182			slidesPerView	: slidesPerView,
183			slidesPerGroup	: slidesPerGroup,	
184			breakpoints		: breakpoints,
185
186			loop		: loop,
187			speed		: speed,
188			navigation	: navigation,	
189			autoplay	: autoplay,	
190
191			pagination : pagination,
192
193			simulateTouch : simulateTouch,
194			allowTouchMove : allowTouchMove,
195/*
196		    slideChangeTransitionStart: function(s) {
197
198		        var currentSlide = $(s.slides[s.activeIndex]);
199		        var elems = currentSlide.find(".animated")
200		        elems.each(function() {
201		            var $this = $(this);
202		            var animationType = $this.data('animation');
203		            $this.addClass(animationType, 100).on(animEndEv, function() {
204		                $this.removeClass(animationType);
205		            });
206		        });
207
208		    },
209		    slideChangeTransitionEnd: function(s) {
210		        var currentSlide = $(s.slides[s.activeIndex]);
211
212		    }			
213*/
214			on: {
215				init: function () {
216
217					var activeIndex = this.activeIndex;
218					var realIndex = this.slides.eq(activeIndex).attr('data-swiper-slide-index');
219
220					jQuery('.swiper-slide').removeClass('swiper-slide-nth-prev-2 swiper-slide-nth-next-2');
221					jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').prev().prev().addClass('swiper-slide-nth-prev-2');
222					jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').next().next().addClass('swiper-slide-nth-next-2');
223				},
224				slideChange: function () {
225
226					var activeIndex = this.activeIndex;
227					var realIndex = this.slides.eq(activeIndex).attr('data-swiper-slide-index');
228
229					jQuery('.swiper-slide').removeClass('swiper-slide-nth-prev-2 swiper-slide-nth-next-2');
230					jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').prev().prev().addClass('swiper-slide-nth-prev-2');
231					jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').next().next().addClass('swiper-slide-nth-next-2');
232				},
233			}
234	    };
235
236	    if ( slidesPerGroup == 1) delete conf['slidesPerGroup']; 
237
238	    if ( effect == 'fade') {
239
240	    	conf["effect"] = 'fade';
241	    	conf["fadeEffect"] = { crossFade: true };
242	    }
243	    	else
244	    if ( effect == 'coverflow') {
245
246			var ww = jQuery(window).width();		    
247
248	    	conf['centeredSlides'] = true;
249	    	conf["loop"] = true;
250	    	conf["effect"] = 'coverflow';
251
252	    	if ( ww > 1199 ) {
253
254		    	conf["coverflowEffect"] = {
255
256					rotate : 0,
257					stretch :0,
258					depth: 120,
259					modifier: 1,
260					slideShadows: false,
261				};
262	    	}
263	    		else {
264
265		    	conf["coverflowEffect"] = {
266
267					rotate : 0,
268					stretch :0,
269					depth: 0,
270					modifier: 0,
271					slideShadows: false,
272				};
273    		}
274	    }
275	    	else
276	    if ( effect == 'flip') {
277
278	    	conf["effect"] = 'flip';
279	    	conf["flipEffect"] = { slideShadows: false };
280	    }
281	    	else
282	    if ( effect == 'cube') {
283
284	    	conf["effect"] = 'cube';
285	    	conf["cubeEffect"] = { slideShadows: false };
286	    }
287
288	    var swiper = new Swiper(container, conf);
289		if ( container.data('autoplay') > 0 && container.data('autoplay-interaction') === 1 ) {
290
291			swiper.el.addEventListener("mouseenter", function( event ) { swiper.autoplay.stop(); }, false);
292			swiper.el.addEventListener("mouseout", function( event ) { swiper.autoplay.start(); }, false);
293		}
294
295		container.addClass('lte-inited');
296	    swiper.update();		
297	});
298}
299
300
301/* Tabs Filterered Container */
302function initFilterContainer() {
303
304	var container = jQuery('.lte-filter-container:not(".lte-inited")');
305
306	jQuery(container).each(function(i, el) {
307
308		var wrapper = jQuery(el),
309			tabs = wrapper.find('.lte-tabs-cats');
310
311		if (tabs.length) {
312
313			tabs.on('click', '.lte-tab', function() {
314
315
316				if ( !wrapper.hasClass('hasHeight') ) {
317
318					wrapper.css('height', container.height());
319					wrapper.addClass('hasHeight');
320				}
321
322
323				if ( !tabs.hasClass('animated') ) {
324
325					var el = jQuery(this),
326						filter = el.data('filter');
327
328					el.parent().parent().find('.active').removeClass('active');
329					el.addClass('active');
330
331					if (filter === 0) {
332
333						wrapper.find('.lte-filter-item').show();
334					}
335						else
336					if (filter !== '') {
337
338						wrapper.find('.lte-filter-item').removeClass('show-item').fadeOut(300, function() {
339
340							tabs.addClass('animated');
341
342							setTimeout(function() {
343
344								wrapper.find('.lte-filter-item.lte-filter-id-' + filter).addClass('show-item').fadeIn(300, function() {
345
346									tabs.removeClass('animated');
347								});
348
349								var mySwiper = document.querySelector('.lte-filter-item.lte-filter-id-' + filter + ' .swiper-container');
350								if ( document.querySelector('.lte-filter-item.lte-filter-id-' + filter + ' .swiper-container') !== null ) {
351
352									mySwiper = mySwiper.swiper;
353									mySwiper.update();								
354								}
355
356							}, 500);	
357						});;
358						
359					}
360
361					return false;
362				}
363
364				return false;
365			});
366
367			// First Init, Activating first tab
368			var firstBtn = tabs.find('.lte-tab:first');
369
370			firstBtn.addClass('active');
371
372			if ( firstBtn.data('filter') != 0 ) {
373
374				wrapper.find('.lte-filter-item').hide();
375				wrapper.find('.lte-filter-item.lte-filter-id-' + firstBtn.data('filter') + '').addClass('show-item').show();
376
377				wrapper.closest('.elementor-element').css('min-height', container.height());
378			}
379
380			jQuery(el).addClass('lte-inited');
381
382			jQuery(window).resize();
383
384		}		
385	});
386}
387
388
389function initFCSwiper() {
390
391	var container = jQuery('.elementor-widget-lte-slider-full'),
392		menu = container.find('.lte-slider-fc-menu'),
393		items = container.find('.lte-item');
394
395	var current = menu.find('span').first().addClass('active').data('id');
396
397	container.find('.lte-wrapper-item').fadeOut();
398	container.find('.lte-wrapper-item-' + current).fadeIn();
399
400	menu.on('click', 'span', function() {
401
402		menu.find('span').removeClass('active');
403		current = jQuery(this).addClass('active').data('id');
404
405		container.find('.lte-wrapper-item').fadeOut();
406		container.find('.lte-wrapper-item-' + current).delay(300).fadeIn("slow");
407	});
408
409	if ( document.querySelector('.swiper-container') !== null ) {
410	
411		var swiper = document.querySelector('.swiper-container').swiper;
412		swiper.update();
413	}
414}
415
416function initCf7Styles() {
417
418	jQuery('form.wpcf7-form select').parent(":not(.select-wrap)").find('select').wrap('<div class="select-wrap"></div>');
419	jQuery('form:not(.checkout, .woocommerce-shipping-calculator) select:not(#rating), .wpcf7-form select:not(#rating), .lte-wc-order select, aside select, .lte-footer-widget-area select').parent(":not(.select-wrap)").find('select').wrap('<div class="select-wrap"></div>');
420}

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.