PageSourceSearch

https://apeconcerts.com/wp-content/themes/apechild/js/child-scripts.js?ver=7.0.5

js apeconcerts.com collected 2026-10-02 07:33:06 UTC 6,807 bytes, 201 lines download raw bytes

1jQuery(document).ready(function($) {
2
3    // Keyboard Navigation of Dropdown Menus
4    $("#menu-primary a").focus(function() {
5        $(this).parents("li").addClass("focus");
6    }).blur(function() {
7        $(this).parents("li").removeClass("focus");
8    });
9
10	// Ticketmaster Styling
11  $('.show-title').html(function(index,text){
12    return text.replace("|", "<br>");
13  });
14
15  $('.tm_just_announced-class').html(function(index,text){
16    return text.replace("|", "<br>");
17  });
18
19	// ScrollTo Plugin
20	$(window).scroll(function(){
21	  if ($(window).scrollTop() > 110) {
22	    $('.site-header').addClass('resize');
23	    $('.toggled').parent().removeClass('resize');
24	  }
25	  else{
26	  	$('.site-header').removeClass('resize');
27		}
28	});
29
30	// Add Foundation data attributes to hook in Magellan sticky nav
31	$('.ol-anchor').attr('data-magellan-arrival', 'outsideLands');
32	$('.lib-anchor').attr('data-magellan-arrival', 'lifeisbeautiful');
33	$('.ti-anchor').attr('data-magellan-arrival', 'treasureisland');
34	$('.cf-anchor').attr('data-magellan-arrival', 'clusterfest');
35	$('.mp-anchor').attr('data-magellan-arrival', 'montereypop');
36
37	//  Venue Page
38	$('.gt-anchor').attr('data-magellan-arrival', 'greekTheatre');
39	$('.bg-anchor').attr('data-magellan-arrival', 'billGraham');
40	$('.ft-anchor').attr('data-magellan-arrival', 'foxTheater');
41	$('.hlt-anchor').attr('data-magellan-arrival', 'lakeTahoe');
42	$('.indie-anchor').attr('data-magellan-arrival', 'independent');
43
44	//  FAQ Page
45	$('.ticket-anchor').attr('data-magellan-arrival', 'ticketInfo');
46	$('.directions-anchor').attr('data-magellan-arrival', 'directions');
47	$('.parking-anchor').attr('data-magellan-arrival', 'parking');
48	$('.seating-anchor').attr('data-magellan-arrival', 'seatingMaps');
49	$('.ada-anchor').attr('data-magellan-arrival', 'ada');
50	$('.faqs-anchor').attr('data-magellan-arrival', 'faqs');
51
52  // Smooth Scrolling
53  $('a[href*="#"]').not('[href="#"]').not('[href="#0"]').click(function(t){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=$(this.hash);(e=e.length?e:$("[name="+this.hash.slice(1)+"]")).length&&(t.preventDefault(),$("html, body").animate({scrollTop:e.offset().top},1e3,function(){var t=$(e);if(t.focus(),t.is(":focus"))return!1;t.attr("tabindex","-1"),t.focus()}))}});
54
55	// Create line breaks for long venue names
56	$('.page-template-page-home .venue-location span, .search-results .venue-location span').html(function(){
57    return $(this).html().replace('Grand Theatre at','Grand Theatre at<br/>');
58	});
59
60	$('.page-template-page-home .venue-location span, .search-results .venue-location span').html(function(){
61    return $(this).html().replace('Lake Tahoe Outdoor','Lake Tahoe Outdoor<br/>');
62	});
63
64	$('.page-template-page-home .venue-location span').html(function(){
65    return $(this).html().replace('Bill Graham','Bill Graham<br/>');
66	});
67
68	$('.search-results .venue-location span').html(function(){
69    return $(this).html().replace('Grand Theatre at','Grand Theatre at<br/>');
70	});
71
72	$('.search-results .venue-location span').html(function(){
73    return $(this).html().replace('Lake Tahoe Outdoor','Lake Tahoe Outdoor<br/>');
74	});
75
76	$('.search-results .venue-location span').html(function(){
77    return $(this).html().replace('Bill Graham','Bill Graham<br/>');
78	});
79
80});
81
82// Add to Calendar
83(function(exports) {
84  var MS_IN_MINUTES = 60 * 1000;
85
86  var formatTime = function(date) {
87    return date.toISOString().replace(/-|:|\.\d+/g, '');
88  };
89
90  var calculateEndTime = function(event) {
91    return event.end ?
92      formatTime(event.end) :
93      formatTime(new Date(event.start.getTime() + (event.duration * MS_IN_MINUTES)));
94  };
95
96  var calendarGenerators = {
97    google: function(event) {
98      var startTime = formatTime(event.start);
99      var endTime = calculateEndTime(event);
100
101      var href = encodeURI([
102        'https://www.google.com/calendar/render',
103        '?action=TEMPLATE',
104        '&text=' + (event.title || ''),
105        '&dates=' + (startTime || ''),
106        '/' + (endTime || ''),
107        '&details=' + (event.description || ''),
108        '&location=' + (event.address || ''),
109        '&sprop=&sprop=name:'
110      ].join(''));
111      return '<a class="icon-google" target="_blank" href="' +
112        href + '">Google</a>';
113    },
114
115    ics: function(event, eClass, calendarName) {
116      var startTime = formatTime(event.start);
117      var endTime = calculateEndTime(event);
118
119      var href = encodeURI(
120        'data:text/calendar;charset=utf8,' + [
121          'BEGIN:VCALENDAR',
122          'VERSION:2.0',
123          'BEGIN:VEVENT',
124          'URL:' + document.URL,
125          'DTSTART:' + (startTime || ''),
126          'DTEND:' + (endTime || ''),
127          'SUMMARY:' + (event.title || ''),
128          'DESCRIPTION:' + (event.description || ''),
129          'LOCATION:' + (event.address || ''),
130          'END:VEVENT',
131          'END:VCALENDAR'].join('\n'));
132
133      return '<a class="' + eClass + '" target="_blank" href="' +
134        href + '">' + calendarName + '</a>';
135    },
136
137    ical: function(event) {
138      return this.ics(event, 'icon-ical', 'iCal');
139    },
140
141    outlook: function(event) {
142      return this.ics(event, 'icon-outlook', 'Outlook');
143    }
144  };
145
146  var generateCalendars = function(event) {
147    return {
148      google: calendarGenerators.google(event),
149      ical: calendarGenerators.ical(event),
150      outlook: calendarGenerators.outlook(event)
151    };
152  };
153
154  // Make sure we have the necessary event data, such as start time and event duration
vendor: 1,286 bytes, lines 155-201
155  var validParams = function(params) {
156    return params.data !== undefined && params.data.start !== undefined &&
157      (params.data.end !== undefined || params.data.duration !== undefined);
158  };
159
160  var generateMarkup = function(calendars, clazz, calendarId) {
161    var result = document.createElement('div');
162
163    result.innerHTML = '';
164
165    Object.keys(calendars).forEach(function(services) {
166      result.innerHTML += calendars[services];
167    });
168
169    result.className = 'add-to-calendar';
170    if (clazz !== undefined) {
171      result.className += (' ' + clazz);
172    }
173
174    result.id = calendarId;
175    return result;
176  };
177
178  var getClass = function(params) {
179    if (params.options && params.options.class) {
180      return params.options.class;
181    }
182  };
183
184  var getOrGenerateCalendarId = function(params) {
185    return params.options && params.options.id ?
186      params.options.id :
187      Math.floor(Math.random() * 1000000); // Generate a 6-digit random ID
188  };
189
190  exports.createCalendar = function(params) {
191    if (!validParams(params)) {
192      console.log('Event details missing.');
193      return;
194    }
195
196    return generateMarkup(generateCalendars(params.data),
197                          getClass(params),
198                          getOrGenerateCalendarId(params));
199  };
200
201})(this);

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.