PageSourceSearch

https://go-eat-do.com/wp-content/themes/seasonal-child/assets/dist/js/functions.js?ver=1790362398

js go-eat-do.com collected 2026-09-25 18:53:36 UTC 6,191 bytes, 279 lines download raw bytes

1/**
2 * Theme functions file.
3 */
4
5
6 (function($) {
7 	"use strict";
8
9
10
11 	var $win = $(window),
12 		$doc = $(document),
13 		win_w = $win.outerWidth(),
14 		win_h = $win.outerHeight(),
15 		doc_w = $doc.outerWidth(),
16 		doc_h = $doc.outerHeight();
17
18
19 	$win.on('resize', function(e)
20 	{
21 		win_w = $win.outerWidth();
22 		win_h = $win.outerHeight();
23 		doc_w = $doc.outerWidth();
24 		doc_h = $doc.outerHeight();
25
26 		console.log( win_w, win_h, doc_w, doc_h );
27
28
29 		updateOwlCarousel();
30 		//updateCarouselTitles();
31 	});
32
33 	updateCarouselTitles();
34
35 	$win.trigger('resize');
36
37 	function updateOwlCarousel()
38 	{
39
40 	}
41
42 	function updateCarouselTitles()
43 	{
44 		$('.carousel.carousel-multi-item .carousel-slide-heading a').each(function()
45 		{
46 			var $this = $(this);
47 			var truncated_title = $this.data('truncated-title');
48 			if( truncated_title != '' )
49 				$this.html( truncated_title );
50 		});
51 	}
52
53
54 	$(document).ready(function($){
55
56 		var $body = $('body');
57
58    // Navigation toggle buttons
59    $('.nav-toggle').on( 'click', function() {
60    	$body.toggleClass('nav-open');
61    });
62    
63    // Primary Navigation
64    var $navMenu = $('.primary-navigation .nav-menu');
65    
66    if( $navMenu.length ) {
67
68    	$navMenu.find('.menu-item-has-children > .sub-menu-toggler').each(function()
69    	{
70    		var a_w = $(this).prev('a').outerWidth();
71    		$(this).css({
72    			marginLeft: a_w / 2 + 'px'
73    		})
74    	});
75
76    	$navMenu.children('li').addClass('menu-item-parent');
77
78    	$navMenu.find('.menu-item-has-children > .sub-menu-toggler').on( 'click', function(e) {
79	    		e.preventDefault();
80	    		var item = $(this),
81	    		itemSub = item.next('.sub-menu'),
82	    		parentSubs = item.closest('.menu-item-parent').find('.sub-menu');
83
84	    		$navMenu.find('.sub-menu').not(parentSubs).slideUp(250);
85	    		itemSub.slideToggle(250);
86	    	}); 
87	    }
88
89	});
90
91
92
93    /*
94    var multiItemCarousel = $(".carousel.carousel-multi-item");
95
96    multiItemCarousel.owlCarousel({
97      items: 3,
98      startPosition: 1,
99      nav: false,
100      loop: true,
101      margin: 0,
102      dots: false,
103      stagePadding: 0
104    });
105    */
106
107    
108
109})(jQuery);
110
111(function($) 
112{	
113
114	(function($)
115	{
116		
117	    var $singleItemCarousel = $(".carousel.carousel-single-item");
118	    var $multiItemCarousel = $(".carousel.carousel-multi-item");
119
120	    var oldSlide = 0;
121		var lastSlide = $singleItemCarousel.find('.carousel-slide').length - 1;
122
123	    $singleItemCarousel.owlCarousel({
124	    	autoplay: false,
125	    	items: 1,
126	    	loop: true,
127	    	margin: 0,
128	    	center: true,
129	    	nav: true,
130	    	dots: true,
131	    	stagePadding: 0,
132	    	responsiveRefreshRate: 0,
133	    	navText: ['<div class="arrow arrow-left arrow-white"></div>', '<div class="arrow arrow-right arrow-white"></div>'],
134	    	onInitialized: function()
135	    	{
136	    		setTimeout(function(){
137	    			$singleItemCarousel.trigger('refresh.owl.carousel');
138	    		}, 100);
139
140	    		$multiItemCarousel.owlCarousel({
141	    			autoplay: false,
142			    	items: 3,
143			    	startPosition: 1,
144			    	nav: false,
145			    	loop: true,
146			    	margin: 0,
147			    	dots: false,
148			    	stagePadding: 0,
149			    	touchDrag: false,
150			    	mouseDrag: false,
151			    	pullDrag: false,
152			    	responsiveRefreshRate: 0,
153			    	responsiveClass:true,
154			    	responsive:{
155			    		0:{
156			    			items:1
157			    		},
158			    		480:{
159			    			items:2
160			    		},
161			    		768:{
162			    			items:3
163			    		}
164			    	},
165			    	onInitialized: function()
166			    	{
167			    		
168			    		
169
170			    		$singleItemCarousel.on('changed.owl.carousel', function( property )
171			    		{
172
173			    			var newSlide = $(property.target).find(".owl-item").eq( property.item.index ).find('.carousel-slide').data('index') ;
174			    			//console.log( oldSlide, lastSlide, newSlide );
175			    			if( oldSlide == lastSlide && newSlide == 0 ) 
176			    			{
177			    				$multiItemCarousel.trigger('next.owl.carousel');
178			    			}
179			    			else if( oldSlide == 0 && newSlide == lastSlide )
180			    			{
181			    				$multiItemCarousel.trigger('prev.owl.carousel');
182			    			}
183			    			else if( newSlide > oldSlide )
184			    			{
185			    				$multiItemCarousel.trigger('next.owl.carousel');
186			    			}
187			    			else if( oldSlide > newSlide )
188			    			{
189			    				$multiItemCarousel.trigger('prev.owl.carousel');
190			    			}
191			    			oldSlide = newSlide;
192			    		});
193			    	}
194			    });
195		        /*
196
197		        console.log('initialized');
198		        setTimeout(function()
199		        {
200		          $singleItemCarousel.trigger('refresh.owl.carousel');
201		          $singleItemCarousel.css({opacity: 0}).animate({opacity: 1});
202		        }, 1000);
203		        $('.carousel.carousel-single-item .owl-next').on('click', function(e)
204		        {
205		        
206		          $multiItemCarousel.trigger('next.owl.carousel');
207		        });
208
209		        $('.carousel.carousel-single-item .owl-prev').on('click', function(e)
210		        {
211		          $multiItemCarousel.trigger('prev.owl.carousel');
212		        });
213		        */
214		    }
215		});
216
217
218
219	})($);
220
221	(function($)
222	{
223		$('.search-form-button-search').on('click', function(e)
224		{
225			e.preventDefault();
226
227			$('#searchform').addClass('active');
228		});
229
230		$('.search-form-button-close').on('click', function(e)
231		{
232			e.preventDefault();
233
234			$('#searchform').removeClass('active');
235		});
236
237		// Submit the search form on Enter key press.
238		// Native "Enter submits form" behaviour is unreliable on Android Chrome
239		// since there is no real submit button (both buttons are type="button").
240		$('#s').on('keydown', function(e)
241		{
242			if( e.key === 'Enter' || e.keyCode === 13 )
243			{
244				e.preventDefault();
245				$('#searchform')[0].submit();
246			}
247		});
248	})($);
249
250	(function($)
251	{
252		$('.sign-up-form').on('submit', function(e)
253		{
254			var $this = $(this);
255			var email = $this.find('input[name=email]').val();
256			if( email == '' ) return false;
257
258			$.ajax({
259				type: 'post',
260				url: ged.ajaxurl,
261				data: {
262					action: 'mailchimp_subscribe',
263					email: email
264				}
265			}).done(function(response)
266			{
267				if( response.success )
268				{
269					$this.find('input[name=email]').val('');
270					alert('Thanks! You will receive a confirmation email shortly.');
271				}
272			});
273			return false;
274		});
275	})($);
276
277
278		
279})(jQuery);

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.