PageSourceSearch

https://www.chq.org/wp-content/themes/chq/assets/js/events-display.js?ver=02102026025143

js chq.org collected 2026-10-02 02:52:50 UTC 31,103 bytes, 880 lines download raw bytes

1var catFilters = []; // create empty global catFilters ARRAY
2var dateFilters = [['arrival'],['departure']]; //create an empty global dateFilters array
3var favCookieName = 'wp-chq-favorites';
4var favCookieVal = Cookies.get('wp-chq-favorites');
5window.favoriteEvents = []; // set window.favoriteEvents array to empty as default
6
7
8window.setFavorites = function(){
9	if (window.favoriteEvents.length > 0 && window.favoriteEvents[0] !== ''){
10		for (i = 0; i <window.favoriteEvents.length; i++) {
11			$('.event-item[data-favorite-id*='+window.favoriteEvents[i]+']').addClass('favorited');
12			$('.event-details-inner[data-favorite-id*='+window.favoriteEvents[i]+']').addClass('favorited');
13		}
14		if (window.favoriteEvents.length > 0) {
15			$('.fav-cta').addClass('active-favorite');
16			$('.favorites-counter').html(window.favoriteEvents.length);
17		}
18	}
19}
20window.setFilterCount = function(){
21	console.log('fired');
22	var totalCount = 0;
23	if (FWP.facets['event_venue']) {
24		totalCount = totalCount + FWP.facets['event_venue'].length;
25		$('.venue-filter-counter').html('&nbsp;(' + FWP.facets['event_venue'].length + ')');
26	} else {
27		$('.venue-filter-counter').html('');
28	}
29	if (FWP.facets['event_cats']){
30		totalCount = totalCount + FWP.facets['event_cats'].length;
31		$('.cat-filter-counter').html('&nbsp;(' + FWP.facets['event_cats'].length + ')');
32	} else {
33		$('.cat-filter-counter').html('');
34	}
35	if (FWP.facets['weekly_themes']){
36		totalCount = totalCount + FWP.facets['weekly_themes'].length;
37  }
38	
39	if (FWP.facets['event_dates'] && FWP.facets['event_dates'].length > 1){
40		totalCount++;
41	}
42	// console.log(totalCount);
43	if (totalCount > 0){
44		$('.filter-counter').html(' (' + totalCount + ') ');
45	} else {
46		$('.filter-counter').html(' (0) ');
47	}
48}
49var curQuery = location.search;
50
51if (curQuery.indexOf('clearfav') > -1){
52	localStorage.removeItem('wp-chq-favorites');
53	Cookies.remove('wp-chq-favorites')
54	checkFavTip();
55} else if (!!Cookies.get('wp-chq-favorites')) {
56 	// have cookie so set it to window.favoriteEvents array
57	 window.favoriteEvents = Cookies.get('wp-chq-favorites');
58	//console.log('vvv');
59	window.favoriteEvents = window.favoriteEvents.replace(/"/g,'');
60	//console.log(window.favoriteEvents);
61	if (window.favoriteEvents.indexOf('[')< 0){
62 		
63		 window.favoriteEvents = window.favoriteEvents.replace('\"','');
64		 window.favoriteEvents = window.favoriteEvents.split(',');
65	} else {
66		var trimmedString = window.favoriteEvents.slice(1,-1);
67
68		window.favoriteEvents = trimmedString.replace('\"','');
69		window.favoriteEvents = window.favoriteEvents.split(',');
70		//console.log(window.favoriteEvents);
71	}
72	 if (window.favoriteEvents.length > 0 && window.favoriteEvents[0] !== ''){
73		window.setFavorites();
74	}
75}
76
77else {
78	// no cookie - create the favorites cookie
79	//$.cookie('wp-chq-favorites', '',{'path':'/'});
80}
81
82/*else if (localStorage.getItem('wp-chq-favorites') !== null) {
83	window.favoriteEvents = localStorage.getItem('wp-chq-favorites').split(',');
84	if (window.favoriteEvents.length > 0 && window.favoriteEvents[0] !== ''){
85		window.setFavorites();
86	}
87} */
88
89// var window.favoriteEvents = []; // set window.favoriteEvents array to empty as default
90var favoritesQuery = ''; //and favoritesQuery 
91var hasFilters = false;
92var postsPerPage = 6; // TODO: number of events should be set in WP ACF fields / block
93var jsonFlag = true;
94var isLoadingEvents = false;
95var currentCount = 0;
96
97function closeAccordion(){
98	$('.accordion.events-filters-container .accordion-close').closest('.accordion.events-filters-container .events-accordion-item').find('.accordion-body').slide
98Up(400,function(){$('.accordion-body').css('height','')});
99	$('.accordion.events-filters-container .accordion-close').closest('.accordion.events-filters-container .events-accordion-item').removeClass('active');
100	$('.events-list-wrapper .events-list-inner').removeClass('no-border');
101	//Scroll to top of bar
102	$("body,html").animate(
103		{
104		  scrollTop: $(".events-filters-container").offset().top - 182
105		},
106		600 //speed
107	);
108}
109
110$(document).ready(function() {
111	// EVENTS FILTERS ACCORDION FUNCTIONALITY
112	// manual override for events filter accordion
113	// event type filter accordion
114	$('.accordion.events-filters-container .accordion-toggle, .accordion.events-filters-container .accordion-close').click(function () {
115      $(this).closest('.accordion.events-filters-container .events-accordion-item').find('.weekly-themes.accordion-body').stop().slideToggle(400, function () {
116        $('.accordion-body').css('height', '')
117      });
118	    $(this).closest('.accordion.events-filters-container .events-accordion-item').find('.accordion-body').stop().slideToggle(400, function () {
119	      $('.accordion-body').css('height', '')
120	    });
121	    $(this).closest('.accordion.events-filters-container .events-accordion-item').toggleClass('active');
122	});
123	// toggle SELECTED class to selected filters, but NOT disabled/empty filters
124	$('.accordion.events-filters-container .filters .filter').not('.empty').click(function() {
125		
126		var catFilterId = $(this).attr('data-filter-id');
127		$(this).toggleClass('selected');
128		
129		if ($(this).hasClass('selected')) {
130			// add the selected filter to filters array
131			catFilters.push(catFilterId);
132		}
133		else {
134			// remove selected filter from filters array
135			catFilters.splice($.inArray(catFilterId, catFilters), 1);
136		}
137		// console.log('filter clicked: ' + catFilterId);
138		// console.log('selected filters: ' + catFilters);
139	});
140
141
142	// add class ACTIVE to animate date picker toggle
143	$('.events-filters-container .date-selectors label .toggle-icon, .events-filters-container .date-selectors input.datepicker').click(function() {
144		$(this).closest('.date-picker-wrapper').toggleClass('active');
145
146		// console.log('Datepicker toggled');
147	});
148	
149	// grab SELECTED date filters
150	$('.accordion.events-filters-container .dates-tab-inner .datepicker').change(function() {
151		// set the Arrival and Departure dates vars to empty strings by default
152		// dateFilters['arrival'] = '';
153		// dateFilters['departure'] = '';
154		// is this the ARRIVAL oR DEPARTURE date?
155		if ($(this).is('#arrival-date')) {
156			// ARRIVIAL date
157			dateFilters['arrival'] = $(this).val();
158			// console.log ('Arrival Date: ' + dateFilters['arrival']);
159		}
160		else {
161			// DEPARTURE date
162			dateFilters['departure'] = $(this).val();
163			// console.log ('Departure Date: ' + dateFilters['departure']);
164		}
165	});
166	
167});
168// show the date when selected
169function showDate(input){
170	// $(input).addClass('active');
171	$(input).css('opacity', '1');
172
173	// console.log('show date');
174}
175
176function prepRSVPLink(){
177	$('.rsvp-fresh-link').click(function() {
178		// alert('boo');
179		// grab the event's  RSVP DATA
180		var rsvpPhone = $(this).attr('data-rsvp-phone');
181		var rsvpEmail = $(this).attr('data-rsvp-email');
182		var rsvpTitle = $(this).attr('data-rsvp-title');
183		var rsvpDate = $(this).attr('data-rsvp-date');
184		
185		
186
187		$(this).attr('data-fancybox','');
188		$(this).attr('href', '#speedbump-rsvp');
189
190		// $('#rsvp-modal').parent().css('display', 'block');
191
192		// set the RSVP MODAL's data
193		// $('#speedbump-rsvp  .modal-heading').html('Book your seat now.');
194		$('#speedbump-rsvp .modal-content .rsvp-title').html(rsvpTitle); 
195		$('#speedbump-rsvp .modal-content .rsvp-date').html(rsvpDate); 
196		
197		if (rsvpPhone) {
198			$('#speedbump-rsvp .modal-content .rsvp-contact').css('display', 'block');
199			$('#speedbump-rsvp .modal-content .rsvp-phone').css('display', 'block');
200			$('#speedbump-rsvp .modal-content .rsvp-phone .phone').html(rsvpPhone).css;	
201			// console.log('phone');
202		}
203		if (rsvpEmail) {
204			$('#speedbump-rsvp .modal-content .rsvp-contact').css('display', 'block');
205			$('#speedbump-rsvp .modal-content .rsvp-email').css('display', 'block');
206			$('#speedbump-rsvp .modal-content .rsvp-email .email').html('<a href="' + rsvpEmail + '">' + rsvpEmail + '</a>').css;	
207			// console.log('email');
208		}
209		
210		// $('#speedbump-rsvp  .btn-close a').html('Close');
211		// $('#speedbump-rsvp  .btn-cta').remove();
212
213		// console.log($(this).attr('data-rsvp-phone'));
214		// console.log($(this).attr('data-rsvp-email'));
215		// console.log($(this).attr('data-rsvp-title'));
216		// console.log($(this).attr('data-rsvp-date'));
217	});
218	$('.rsvp-fresh-link').removeClass('rsvp-fresh-link');
219}
220
221$(document).ready(function() {
222	
223
224	$('#speedbump-rsvp .speedbump-continue').on('click', function () {
225		$.fancybox.close();
226	});
227});
228
229function checkFavTip(){
230	if (window.favoriteEvents.length < 1){
231		window.hasTip = true;
232		Tipped.create(".fav-item .favorite-toggle","Click to add this to your favorites",{ skin: 'primary', position: 'top',size:'x-small'});
233	}
234}
235
236$(document).ready(function(){
237	checkFavTip();
238	Tipped.create('.cta-tooltip',null,{ skin: 'primary', position: 'top',size:'x-small',maxWidth: 200});
239});
240
241$(document).on('click', '.fav-item .favorite-toggle', function (e) {
242	// get items from local storage
243	  // if(localStorage.getItem('wp-chq-favorites') && favoritesQuery){
244	  //  favoritesQuery.html(localStorage.getItem('wp-chq-favorites'));
245	  // }
246	
247
248	e.preventDefault();
249	if (!($(this).closest('.fav-item').hasClass('favorited'))) {
250		
251		// check if this item already exists in the array
252		// console.log('Event ID: ' + $(this).closest('.event-item').attr('data-favorite-id'));
253		// console.log('Current COOKIE: ' + $.cookie('wp-chq-favorites'));
254		// $.inArray(event_id.toString(), window.favoriteEvents) !== -1
255		if (window.hasTip == true){
256			Tipped.hideAll();
257			Tipped.disable(".fav-item .favorite-toggle");
258			window.hasTip = false;
259		}
260		$('.fav-cta').addClass('active-favorite');
261		if ($.inArray($(this).closest('.fav-item').attr('data-favorite-id'), window.favoriteEvents) == -1) {
262			// item noit already in array so add it
263			window.favoriteEvents.push( $(this).closest('.fav-item').attr('data-favorite-id'));
264			$(this).closest('.fav-item').addClass('favorited');
265			// update Favorites Counter
266			$('.favorites-counter').html(window.favoriteEvents.length);
267			// console.log('Added event: ' + window.favoriteEvents);
268		}
269		if (window.favoriteEvents.length == 1){
270			Tipped.create(".fav-cta","Access your favorites here",{ skin: 'primary', position: 'top',fixed:true, target:'element',size:'x-small',offset:{y:-10}});
271			Tipped.show('.fav-cta');
272			setTimeout(function(){
273				Tipped.hide('.fav-cta');
274				setTimeout(function(){
275					Tipped.disable('.fav-cta');
276				},200);
277			},2000);
278		}
279	}
280	else {
281
282		var itemToRemove = $(this).closest('.fav-item').attr('data-favorite-id');
283		window.favoriteEvents.splice($.inArray(itemToRemove, window.favoriteEvents), 1);
284		$(this).closest('.fav-item').removeClass('favorited');
285		// update Favorites Counter
286		$('.favorites-counter').html(window.favoriteEvents.length);
287		if (window.favoriteEvents.length == 0){
288			$('.fav-cta').removeClass('active-favorite');
289		}
290		// console.log('Removed event from favorites: ' + itemToRemove);
291	}
292	// console.log(window.favoriteEvents);
293	//save changes to local storage
294	if (window.favoriteEvents.length > 0 && window.favoriteEvents[0] !== ''){
295		localStorage.setItem('wp-chq-favorites', window.favoriteEvents);
296		Cookies.set('wp-chq-favorites', window.favoriteEvents);
297		console.log('full favs');
298		console.log(window.favoriteEvents);
299	} else {
300		localStorage.removeItem('wp-chq-favorites');
301		Cookies.remove('wp-chq-favorites');
302		console.log('empty favs');
303		console.log(window.favoriteEvents);
304		checkFavTip();
305	}
306	// console.log('Cookie Updated: ' + $.cookie('wp-chq-favorites'));
307	// console.log('LS Updated: ' + localStorage.getItem('wp-chq-favorites'));
308
309});
310$(document).ready(function() {
311	
312	// is the Favorite Events cookie set and NOT empty?
313	if (!!Cookies.get('wp-chq-favorites') && (window.favoriteEvents.length > 0)) {
314		// console.log('Ready to build WP_Query: ' + window.favoriteEvents);
315	 	// var favEventsArr = window.favoriteEvents;
316		
317	}
318	// create a WP Query to grab the Favorite Events by ID
319
320	// pass the WP Query to the functions file to load
321	
322
323});
324
325
326
327$(document).ready(function() {
328	var postsPerPage = '';
329	var pull_page = 1; 
330
331	var cats = '';
332	var dates = '';
333	
334
335
336	// clear selected filters
337	$('.btn-clear-filters').click(function() {
338		$('.accordion.events-filters-container .filters .filter').removeClass('selected');
339		$('.accordion.events-filters-container .date-selectors .datepicker').val('').css('opacity', '0');
340		$('.clear-filter').fadeOut();
341		closeAccordion();
342		// console.log('remove filter selects');
343		loadEvents(true,false,false,false,true);
344		return false;
345	});
346
347	$('.events-reload').click(function(e) {
348		$loadMore = false;
349		$catSearch = false;
350		$dateSearch = false;
351		$favSearch = false;
352		if ($(this).hasClass('events-loadmore')) {
353			$loadMore = true;
354		} 
355		if ($(this).attr('data-reload-by') === 'categories') {
356			$catSearch = true;
357		} 
358		if ($(this).attr('data-reload-by') === 'dates') {
359			$dateSearch = true;
360		} 
361		if ($(this).attr('data-reload-by') === 'favorites') {
362			$favSearch = true;
363		} 
364		loadEvents($loadMore,$catSearch,$dateSearch,$favSearch);
365		return false;
366	});
367	function loadEvents(loadMore,catSearch,dateSearch,favSearch,resetSearch = false){
368		isLoadingEvents = true;
369		//Hardcoded this value, not sure why we would need to dynamically adjust this?
370		//$(this).attr('data-posts-per-page');
371		$('.events-reload').addClass('disabled');
372		$('.clear-filter').addClass('disabled');
373		$('.events-reload').text('Loading...');	
374		if (loadMore == false || resetSearch == true){
375			$('.events-loadmore').stop().fadeOut();
376		}
377
378		//If we need to reset the entire search (Like when we clear the filters)
379		if (resetSearch == true){
380			loadMore = true;
381			pull_page = 1;
382			hasFilters = false;
383			// clear out the CATEGORY and DATE vars
384			cats = '';
385			dates = '';
386			favs = '';
387			// clear out the CATEGORY and DATE FILTER vars
388			catFilters = [];
389			dateFilters = [['arrival'],['departure']];
390			favorites = window.favoriteEvents;
391			$('h4.heading').text('All Events');
392			currentCount = 0;
393			// set the json flag to true
394			jsonFlag = true;
395
396		//If someone hit the more button, increment the page
397		} else if (loadMore == true){
398
399			pull_page++;
400		//Otherwise this is a filter query, so reset the page count
401		} else {
402			cats = '';
403			dates = '';
404			favs = '';
405			loadMore = false;
406			pull_page = 1;
407			currentCount = 0;
408		}
409
410		// console.log('Post per page: ' + postsPerPage );
411		
412		// console.log('Load more events!');
413		// console.log($("#event-blocks-wrapper").children().length);
414		// console.log($("#event-blocks-wrapper").children().last().attr('data-counter'));
415		// console.log('posts per page: ' + postsPerPage);
416		if (resetSearch == false){
417			var filterHeader = 'Events Filtered By';
418			// is this a FILTERS button?
419
420			// DATE FILTERS
421			if (dateSearch == true) {
422				hasFilters = true;
423				if (dateFilters) {
424					//console.log('Dates: ');
425					//console.log(dateFilters);
426
427					dates = dateFilters['arrival'] + ',' + dateFilters['departure'];
428					dates = dates.split(',');
429				}
430				// set the json flag to true
431				jsonFlag = true;
432
433				//console.log('dates selected:');
434				// console.log(dates);
435				// console.log('refresh by Dates');
436
437				filterHeader = filterHeader + ' Date';
438			}
439			// CATEGORY SEARCH
440			if (catSearch == true) {
441				// CATEGORY FILTERS
442				hasFilters = true;
443				// console.log('refresh by Category Filters');
444				if (catFilters) {
445					// console.log('Selected categories: ' + catFilters);
446					cats = catFilters;
447				}
448				catString = ' Category';
449				if (cats.length > 1){
450					catString = ' Multiple Categories';
451				} 
452				filterHeader = filterHeader + catString;
453			}
454			// FAVORITES
455			if (favSearch == true) {
456				hasFilters = true;
457				// console.log('refresh by Favorites');
458				if (favorites) {
459					// console.log('Favorites: ' + favorites);
460					favs = favorites;
461				}
462				favString = 'Favorite Event';
463				if (favs.length > 1){
464					favString = 'Favorite Events';
465				} 
466				filterHeader = favString;
467			}
468			
469			if (hasFilters == true){
470				$('h4.heading').text(filterHeader);
471			} else {
472				$('h4.heading').text('All Events');
473			}
474		}
475		if (loadMore !== true && hasFilters == true){
476			closeAccordion();
477		}
478		// console.log(resetSearch);
479		//If this is a fresh filters search, make sure we clear out content
480		if (resetSearch == true || (hasFilters == true && pull_page == 1)){
481			$(".events-list-inner").html('');
482			$('.loading').fadeIn();
483		}
484	
485		// TODO : get the counter working properly: if RELOADING FIRST TIME by FILTER or DATE: need to set Countrer to 0, else if RELOADING MORE, counter should be set to current number of items
486		// start the counter from wherever the current event counter left off
487		var counter = $("#event-blocks-wrapper").children().last().attr('data-counter');
488		
489	
490		if (counter == null){
491			counter = 0;
492		} else {
493			// increment counter
494			counter++;
495			if (counter >= 3) {
496				counter = 0;
497			}
498		}
499
500
501		var counter_j = $("#event-blocks-wrapper").children().length;
502		if (counter_j == null){
503			counter_j = 1;
504		}
505	
506	
507		
508        // grab the currently set season
509        var season = 'season';
510        if (readCookie('season') != null) {
511        	season += ' ' + readCookie('season')
512        }
513		// TODO: display LOADER animation on LOADMORE click
514		// $('#Loading').fadeIn();
515
516		if(jsonFlag){
517			jsonFlag = false; 
518			// console.log('making JSON call');
519			$.getJSON("/wp-json/schedule/events?page=" + pull_page + "&cats=" + cats + "&dates=" + dates + "&favs=" + favs, function(data){
520
521				// console.log("/wp-json/schedule/events?page=" + pull_page + "&cats=" + cats + "&dates=" + dates + "&favs=" + favs);
522				/*console.log ('data!');
523				console.log(data);
524				console.log('found ' + data['found_posts']);
525				console.log(data['events']);*/
526				if(data['found_posts'] > 0){
527					$('#ajax-no-posts').fadeOut(); 
528					// console.log ('fade out #ajax-no-posts');
529					var items = [];
530					// counter used to properly layout / order event blocks
531					var i = 0;
532					// counter used to provide a running tally of events an used to set as a class counter for css
533					var j = counter_j + 1; 
534					currentCount = data['events'].length + $("#event-blocks-wrapper").children().length;
535					// console.log(data);
536					$.each(data['events'], function(key, val){
537						
538						// const arr = $.map(val, function(el) { return el });
539						var event_tags = [];
540						var event_categories = [];
541						var event_cat = '';
542						var event_featured = '';
543						var event_ticket_url = '';
544						var event_venue = '';
545						var event_id = '';
546						var event_url = '';
547						var event_title = '';
548						var event_img = '';
549						var event_start = '';
550						var event_end = '';
551						var event_phone = '';
552						var event_email = '';
553						var event_classes = '';
554
555						event_classes += ' event-item-' + j;
556
557						if (data['events'][i]['categories'] != null) {
558							event_categories = data['events'][i]['categories'];
559						}
560						
561						if ($.isArray(event_categories) && event_categories.length > 0) { 
562							// console.log (event_categories);
563							event_cat = event_categories[0]['name'];
564						}
565						
566						if (data['events'][i]['tags'] != null) {
567							event_tags = data['events'][i]['tags'];
568						}
569						// event_content = data['content'];
570						if (data['events'][i]['is_featured'] != null) {
571							event_featured = data['events'][i]['is_featured'];
572						}
573						if (data['events'][i]['ticket_url'] != null) {
574							event_ticket_url = data['events'][i]['ticket_url'];
575						}
576						if (data['events'][i]['venue'] != null) {
577							event_venue = data['events'][i]['venue'];
578						}
579						if (data['events'][i]['id'] != null) {
580							event_id = data['events'][i]['id'];
581						}
582						if (data['events'][i]['url'] != null) {
583							event_url = data['events'][i]['url'];
584						}
585						if (data['events'][i]['title'] != null) {
586							event_title = data['events'][i]['title'];
587						}
588						if (data['events'][i]['featured_img_src'] != null) {
589							event_img = data['events'][i]['featured_img_src'];
590						}
591						if (data['events'][i]['start_date'] != null) {
592							event_start = data['events'][i]['start_date'];;
593						}
594						if (data['events'][i]['end_date'] != null) {
595							event_end = data['events'][i]['end_date'];
596						}
597						if (data['events'][i]['rsvp_phone'] != null) {
598							event_phone = data['events'][i]['rsvp_phone'];
599						}
600						if (data['events'][i]['rsvp_email'] != null) {
601							event_email = data['events'][i]['rsvp_email'];
602						}
603						// if no image, add 'no-img' class
604						if (event_img == '') {
605							event_classes += ' ' + 'no-img';
606						}
607
608						var featured = '';
609						if(event_featured){
610							featured = 'featured';
611						}
612						
613						var position = '';
614						if (counter === 0) {
615							postion = 'first';
616						}
617						else if (counter === 1) {
618							postion = 'second';
619						}
620						else {
621							// counter === 2
622							postion = 'last';
623						}
624						// console.log (window.favoriteEvents + ' : ' + event_id.toString());
625						if ($.inArray(event_id.toString(), window.favoriteEvents) !== -1) {
626							event_classes += ' favorited ';
627						}
628
629						var item_string = `<div class="wp-block-column xs-12 sm-6 lg-4 xl-4 event-item initial-fade ` + postion + ' ' + event_classes + `" data-counter="` + counter + `" data-favorite-id="` + event_id+ `">
630		                      <div class="event-item-inner">
631		                        <span class="favorite-toggle"><span class="favorite-icon"></span></span>
632                                <div class="wp-block-image event-image">
633	                              <a href="` + event_url + `" title="View this event">
634	                                <div class="img-wrapper aligncenter size-large primary-rect ` + season + `" style="background-image: url('` + event_img + `');">
635	                                	<img src="` + event_img + `" alt="Image of this event" />
636	                                </div>
637	                              </a>
638	                            </div>
639                            	<div class="event-details">
640		                          	<p class="event-date">
641		                            	<span class="event-start-date">` + event_start + `</span>
642		                            </p>
643		                          	<h4 class="event-title"><a href="` + event_url + `" title="View this event">` + event_title + `</a></h4>
644                                    <p class="has-small-font-size venue"></p>
645                                    <div class="event-cta-links">
646																				<a href="` + event_url + `" class="cta-link cta-details" title="Get details about this event"><svg xmlns="http://www.w3.org/2000/svg" width="22.991" height="23.158" viewBox="0 0 22.991 23.158"><g id="Group_224" data-name="Group 224" transform="translate(-959.25 -3604.25)"><g id="Group_222" data-name="Group 222" transform="translate(-908 3493)"><g id="Group_138" data-name="Group 138" transform="translate(1868 112)"><circle id="Ellipse_5" data-name="Ellipse 5" cx="9.251" cy="9.251" r="9.251" transform="translate(0)" fill="none" stroke="#a86dd0" stroke-miterlimit="10" stroke-width="1.5"/><line id="Line_40" data-name="Line 40" x2="5.232" y2="5.232" transform="translate(15.948 16.115)" fill="none" stroke="#a86dd0" stroke-linecap="round" stroke-miterlimit="10" stroke-width="1.5"/></g></g><g id="Group_223" data-name="Group 223"><line id="Line_104" data-name="Line 104" y2="8" transform="translate(969.5 3610.5)" fill="none" stroke="#a86dd0" stroke-linecap="round" stroke-width="1.5"/><line id="Line_105" data-name="Line 105" y2="8" transform="translate(973.5 3614.5) rotate(90)" fill="none" stroke="#a86dd0" stroke-linecap="round" stroke-width="1.5"/></g></g></svg><span class="link-text">View Details</span></a>
647		                          	</div>
648		                        </div>
649		                      </div>
650		                    </div>`; 
651							//<a href="` + event_url + `" class="cta-link cta-ticket rsvp-link rsvp-fresh-link" data-rsvp-title="` + event_title + `" data-rsvp-email="` + event_email + `" data-rsvp-date="` + event_start + `" data-rsvp-phone="` + event_phone + `" title="Reserve your spot for this event"><span class="icon"></span> <span class="link-text">Free</span></a>
652						items.push(item_string);
653						// items.push(post_id);
654
655						// increment the counter
656						counter++;
657						if (counter >= 3) {
658		                    counter = 0;
659		                }
660
661		                // iterate i
662		                i++;
663
664		                // iterate j
665		                j++;
666					}); 
667					/*console.log('ITEMS!');
668					console.log(items);*/
669
670					
671					setTimeout(function(){
672						$('.loading').fadeOut();
673						$(".events-list-inner").append(items);
674						setTimeout(function(){
675	
676							$(".events-list-inner .initial-fade").removeClass('initial-fade'); 
677						},200);
678						isLoadingEvents = false;
679
680						if (hasFilters == true){
681							$('.clear-filter').fadeIn();
682							$('.clear-filter').removeClass('disabled');
683						}
684						$('.events-reload').removeClass('disabled');
685	
686						$('.events-loadmore').text('Show More');
687						$('.btn-refresh-events').text('Refresh');
688
689						if (currentCount >= data['found_posts']) {
690							$('.events-loadmore').stop().fadeOut().hide();
691						} else {
692							$('.events-loadmore').stop().fadeIn().show();
693						}
694						//prepRSVPLink();
695					}, 0);
696		
697					
698					
699				
700					
701				}
702				// TODO: hide LOADER animation on EVENTS load
703				else{ 
704					// no more posts to display, remove the LOAD MORE button
705					$('.events-loadmore').stop().fadeOut().hide();
706					// $('#Loading').hide(); 
707					$('#ajax-no-posts').fadeIn(); 
708
709					// console.log('no posts found');
710					setTimeout(function(){
711						$('.loading').hide();
712						
713						isLoadingEvents = false;
714
715						
716						$('.clear-filter').fadeIn();
717						$('.clear-filter').removeClass('disabled');
718						
719						$('.events-reload').removeClass('disabled');
720	
721						$('.btn-refresh-events').text('Refresh');
722
723						if (currentCount >= data['found_posts']) {
724							$('.events-loadmore').stop().fadeOut().hide();
725						} else {
726							$('.events-loadmore').stop().fadeIn().show();
727						}
728						$('#ajax-no-posts').fadeIn().show();
729						//prepRSVPLink();
730					}, 0);
731
732				} 
733			}).done(function(data){ 
734				if(data['events'].length){ jsonFlag = true; } 
735			});
736		}
737		
738	}
739
740	//This triggers the initial load of events
741	
742	if ($('.page-template-page-events').length || $('body.home').length) {
743		//$('.events-loadmore').hide();
744		//loadEvents(true,false,false,false,true);
745	}
746});
747
748function readCookie(name) {
749    var nameEQ = name + "=";
750    var ca = document.cookie.split(';');
751    for(var i=0;i < ca.length;i++) {
752        var c = ca[i];
753        while (c.charAt(0)==' ') c = c.substring(1,c.length);
754        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
755    }
756    return null;
757}
758
759$(document).ready(function() {
760	$('.events-accordion-item .accordion-toggle').click(function () {
761		$('.events-list-wrapper .events-list-inner').toggleClass('no-border');
762		     //$('html, body').animate({ scrollTop: 0 }, 500);
763		
764	});
765	$('.events-accordion-item .accordion-close').click(function () {
766		if ($('.events-list-wrapper .events-list-inner').hasClass('no-border')) {
767			$('.events-list-wrapper .events-list-inner').removeClass('no-border');
768		}
769	});
770});
771
772
773(function($) {
774    $(document).on('facetwp-loaded', function() {
775
776		$('.facetwp-facet-experience_category_types .facetwp-radio').removeClass('disabled');
777		$('.facetwp-facet-event_cats .facetwp-checkbox').removeClass('disabled');
778		$('.facetwp-facet-experience_cats .facetwp-checkbox').removeClass('disabled');
779
780		$('.facetwp-facet-places_to_stay .facetwp-checkbox').removeClass('disabled');
781		$('.facetwp-facet-places_to_eat .facetwp-checkbox').removeClass('disabled');
782		$('.facetwp-facet-places_to_shop .facetwp-checkbox').removeClass('disabled');
783		$('.facetwp-facet-experience_location .facetwp-checkbox').removeClass('disabled');
784		$('.facetwp-facet-event_venue .facetwp-checkbox').removeClass('disabled');
785	
786     });
787	    
788})(jQuery);
789
790(function($) {
791    $(document).on('facetwp-refresh', function() {
792       setFavorites();
793	   setFilterCount();
794	   
795     });
796	 $(document).on('facetwp-refresh', function() {
797		if (window.firstFacet !== true){
798
799			setTimeout(function(){
800				window.firstFacet = true;
801				var $path = window.location.href;
802				console.log($path);
803				if ($path.indexOf('_search_events') !== -1){
804					
805					FWP.refresh();
806				}
807			},1000);
808		}
809	 });
810})(jQuery);
811
812$( document ).ready(function() {
813	window.expandFirstFacet = false;
814	$('.sidebar-accordion-item a').click(function(){
815		// self clicking close
816		if($(this).parent().hasClass('active')){
817			$(this).parent().removeClass('active');
818			$(this).parent().find('.sidebar-accordion-content').slideUp();
819			
820		}else{
821			//$('.sidebar-accordion-item .sidebar-accordion-content').slideUp();
822			//$(".sidebar-accordion-item").removeClass('active');
823			$(this).parent().addClass('active');
824			$(this).parent().find('.sidebar-accordion-content').slideDown();
825			//Opens main Chautauqua Instiution Program subnav by default
826			if (window.expandFirstFacet == false){
827				console.log('oppp2');
828				$('div[data-value="chautauqua-institution-program"] .facetwp-expand').click();
829				window.expandFirstFacet = true;
830			}
831		}
832		return false;
833	});
834	$('.btn-print').click(function(e){
835		e.preventDefault();
836		window.print();
837		
838	});
839	$('.btn-save-trip').click(function(e){
840		//var newURL = window.location.protocol + "//" + window.location.host + "" + window.location.pathname + window.location.search
841		var newURL = window.location.protocol + "//" + window.location.host + "/favorites/"; // + window.location.pathname;
842		//console.log(window.favoriteEvents);
843		if (!!Cookies.get('wp-chq-favorites')) {	
844			// have cookie so set it to window.favoriteEvents array
845			//window.favoriteEvents = Cookies.get('wp-chq-favorites').split(',');
846		}
847		/*
848		else if (localStorage.getItem('wp-chq-favorites') !== null) {
849			window.favoriteEvents = localStorage.getItem('wp-chq-favorites').split(',');
850		} */
851		newURL = newURL + '?fav='+encodeURI(window.favoriteEvents);
852		console.log('favURL EP Page ' + newURL);
853		$('#input_2_3').val(newURL);
854	});
855	$('.btn-save-fav').click(function(e){
856		var newURL = window.location.protocol + "//" + window.location.host + "" + window.location.pathname;
857		//console.log(window.favoriteEvents);
858		if (!!Cookies.get('wp-chq-favorites')) {	
859			// have cookie so set it to window.favoriteEvents array
860			//window.favoriteEvents = Cookies.get('wp-chq-favorites').split(',');
861		}
862		/*
863		else if (localStorage.getItem('wp-chq-favorites') !== null) {
864			window.favoriteEvents = localStorage.getItem('wp-chq-favorites').split(',');
865		} */
866		
867		newURL = newURL + '?fav='+encodeURI(window.favoriteEvents);
868		console.log('favURL FAV Page ' + newURL);
869		$('#input_3_3').val(newURL);
870	});
871	$('.experience-jump').click(function(e){
872		e.preventDefault();
873		$cHeight = $('.custom-links').outerHeight();
874		$nHeight = $('.main-nav').outerHeight();
875		console.log('c '+$cHeight + ' n ' +$nHeight );
876		$('html,body').animate({
877			scrollTop: $("a[name='experience-results']").offset().top - $cHeight - $nHeight
878		}, 800);
879	});
880});

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.