PageSourceSearch

https://hurricanessuites.com/wp-content/themes/responsive/js/lightbox.js?2

js hurricanessuites.com collected 2026-10-06 14:10:24 UTC 13,463 bytes, 462 lines download raw bytes

1/*
2lightbox = {
3	fadetime: 500
4	,
5	show: function(){
6		//jQuery('.lightbox')style.display='block';
7		//jQuery('.lightbox').html();
8		jQuery('.lightbox').offset({ top: '25%', right: '25%'});
9		jQuery('.blackout').fadeIn(this.fadetime);
10		jQuery('.lightbox').fadeIn(this.fadetime);
11                jQuery('.lightbox_left').jScrollPane({showArrows:true});
12	}
13	,
14	hide: function(){
15		jQuery('.blackout').fadeOut(this.fadetime);
16		jQuery('.lightbox').fadeOut(this.fadetime);
17	}
18}
19jQuery(document).ready(function(){
20    jQuery('.blackout,.lightbox').bind('mousewheel DOMMouseScroll', function(e){
21        e.preventDefault();
22    });
23});
24*/
25
26jQuery(document).ready(function(){
27
28	jQuery('body').on('click', '#blackout, #blackout .lightbox_close_container a, #blackout a.lightbox_close, #blackout span.close, #blackout_filter, #blackout_filter span.close, #whiteout span.close', function() {
29		close_all_lightboxes();
30		hide_blackout();
31		jQuery('#whiteout').css('display','none');
32	});
33	jQuery(document).keyup(function(e) { 
34        if (e.keyCode == 27) { // esc keycode
35			
36			if(
37				jQuery('#lightbox7').is(':visible') && 
38				jQuery('.galleria-lightbox-overlay').is(':visible')
39			) {
40				var gallerias = Galleria.get();
41				gallerias[gallerias.length-1].closeLightbox();
42			} else if(
43				jQuery('#lightbox7').is(':visible') &&
44				(jQuery('#lb7_lightbox1').is(':visible') || jQuery('#lb7_lightbox2').is(':visible'))
45			) {
46				close_all_sm_lightbox();
47			} else {
48				close_all_lightboxes();
49				hide_blackout();
50				jQuery('#whiteout').css('display','none');
51        	}
52        }
53    });
54	jQuery('body').on('click', '[id^="lightbox"], .lightbox', function(event) {
55		event.stopPropagation();
56	});
57
58});
59
60var fadeout_time = 0;
61var fadein_time = 200;
62
63function toggle() {
64	
65	if (document.getElementById("lightbox").style.display=='none') {
66		//jQuery('body').scrollTo('#header',{duration:'slow'});
67		show_blackout(function() { 
68			jQuery('#lightbox').appendTo('#blackout');
69			jQuery('#lightbox').fadeIn(fadein_time);
70		} );
71				
72	} else {
73		jQuery('#lightbox').fadeOut(fadeout_time);
74		hide_blackout();
75
76	}
77}
78
79function toggle2() {
80	if (document.getElementById("lightbox2").style.display=='none') {
81		//document.getElementById("lightbox").style.display='block';
82		//jQuery('body').scrollTo('#header',{duration:'slow'});
83		jQuery('#lightbox2').removeClass('lightbox6');
84		jQuery('.lightbox2_title').show();
85		jQuery('.lightbox6_title').hide();
86		jQuery('.lightbox2_instructions').show();
87		jQuery('.lightbox6_instructions').hide();
88		jQuery('.lightbox6_postform').hide();
89		
90		show_blackout(function() { 
91			jQuery('#lightbox2').appendTo('#blackout');
92			jQuery('#lightbox2').fadeIn(fadein_time);
93		} );
94
95	} else {
96		jQuery('#lightbox2').fadeOut(fadeout_time);
97		hide_blackout();
98	}
99	
100}
101
102function toggle3(stadium_id) { //seating chart lightbox
103	// if(jQuery(window).width() < 426) {
104	// 	window.open('https://' + location.hostname + '/all-suites/suite-map/?mode=map&ref='+stadium_id);
105	// } else {
106
107		var lightboxElement = jQuery('#lightbox3[data-id="' + stadium_id + '"]');
108		if (lightboxElement.css('display') === 'none') {
109			show_blackout(function() { 
110				lightboxElement.appendTo('#blackout');
111				lightboxElement.fadeIn(fadein_time);
112			} );
113		} else {
114			lightboxElement.fadeOut(fadeout_time);
115			hide_blackout();
116		}
117		
118	// }
119	
120}
121
122function toggle4(imageFile, imageName) { //photo lightbox
123	
124	if(imageFile && imageName) {
125
126		if(jQuery(window).width() < 426) {
127			window.open('https://' + location.hostname + '/all-suites/suite-photo/?mode=photo&file='+imageFile+'&desc='+imageName);
128		} else {
129			imageName = imageName.replace("%26","&");
130			imageFile = '../../../wp-content/themes/responsive/images/'+imageFile;
131			document.getElementById("lb4_img").src = imageFile;
132			document.getElementById("lb4_img").alt = imageName;
133			document.getElementById("lb4_img").title = imageName;
134			
135			document.getElementById("lb4_title").innerHTML = imageName;
136
137		}//not mobile device
138
139	}
140
141	if(jQuery(window).width() >= 426) {
142
143		if (document.getElementById("lightbox4").style.display=='none') {
144			show_blackout(function() { 
145				jQuery('#lightbox4').appendTo('#blackout');
146				jQuery('#lightbox4').fadeIn(fadein_time);
147			} );
148		} else {
149			jQuery('#lightbox4').fadeOut(fadeout_time);
150			hide_blackout();
151		}
152	}
153	
154}
155
156function toggle5() { //price FAQ lightbox
157
158	if (document.getElementById("lightbox5").style.display=='none') {
159		show_blackout(function() { 
160			jQuery('#lightbox5').appendTo('#blackout');
161			jQuery('#lightbox5').fadeIn(fadein_time);
162		} );
163	} else {
164		jQuery('#lightbox5').fadeOut(fadeout_time);
165		hide_blackout();
166	}
167	
168}
169function toggle6() { //stadium page book a suite lightbox
170	/* toggle6 really toggles lightbox2, and adds the lightbox6 class to morph the lightbox2 look and feel into a larger form */
171	if (document.getElementById("lightbox2").style.display=='none') {
172		//document.getElementById("lightbox").style.display='block';
173		//jQuery('body').scrollTo('#header',{duration:'slow'});
174		jQuery('#lightbox2').addClass('lightbox6');
175		jQuery('.lightbox2_title').hide();
176		jQuery('.lightbox6_title').show();
177		jQuery('.lightbox2_instructions').hide();
178		jQuery('.lightbox6_instructions').show();
179		jQuery('.lightbox6_postform').show();
180		jQuery('#lightbox2').fadeIn(fadein_time);
181		if(team_name != "" && stadium_name != "") {
182			document.getElementById("mc_mv_TEAMEVENT").value = team_name + " / " + stadium_name;
183		}
184	} else {
185		//document.getElementById("lightbox").style.display='none';
186		jQuery('#lightbox2').fadeOut(fadeout_time);
187	}
188	if (document.getElementById("blackout").style.display=='none') {
189		//document.getElementById("blackout").style.display='block';
190		jQuery('#blackout').height(jQuery(document).height());
191		jQuery('#blackout').fadeIn(fadein_time);
192		
193	} else {
194		//document.getElementById("blackout").style.display='none';
195		jQuery('#blackout').fadeOut(fadeout_time);
196	}
197	
198}
199function close_all_lightboxes() {
200	
201	if( jQuery('#lightbox7').is(':visible') ) {
202				
203		galleria_garbage_collection();
204
205		//re-render the main galleria widget
206		if( jQuery('.galleria').length ) {
207			show_main_galleria();
208		}
209		//remove the history url param 
210		history.replaceState(null, null, ".");
211
212		lb7_close_prep();
213	}
214	jQuery('.lightbox').fadeOut(fadeout_time);
215	jQuery('#lightbox').fadeOut(fadeout_time);
216	jQuery('#lightbox2').fadeOut(fadeout_time);
217	jQuery('#lightbox3').fadeOut(fadeout_time);
218	jQuery('#lightbox4').fadeOut(fadeout_time);
219	jQuery('#lightbox5').fadeOut(fadeout_time);
220	jQuery('#lightbox6').fadeOut(fadeout_time);
221	jQuery('#lightbox7').fadeOut(fadeout_time);
222	//jQuery('#blackout').fadeOut(fadeout_time);
223}
224function show_blackout(callback) {
225	//close_all_lightboxes();
226	// jQuery('body').css('overflow-x', 'hidden');
227	
228
229	jQuery('#blackout').fadeIn(0, function() { 
230		jQuery('body').css('overflow', 'hidden');
231		jQuery('html').css('overflow', 'hidden');
232		if(jQuery(window).width() > 425) { jQuery('body').css('padding-right', '15px'); }
233		if(callback && typeof(callback) === "function") { 
234			callback();
235		} 
236	});
237}
238function hide_blackout() {
239	jQuery('#blackout, #blackout_filter').fadeOut(fadeout_time, function() {
240		// jQuery('body').css('overflow-x', 'initial');
241		jQuery('body').css('overflow', 'visible');
242		jQuery('html').css('overflow', 'visible');
243
244		if(jQuery(window).width() > 425) { jQuery('body').css('padding-right', 'initial'); }
245
246	});
247}
248function show_lightbox(id) {
249
250	if(id != null) {
251		show_blackout(function() { 
252			jQuery('#'+id).appendTo('#blackout');
253			jQuery('#'+id).fadeIn(fadein_time);
254		} );
255	} 
256	
257	//TODO: may want to add GA event tracking
258}
259
260function lb7_open_prep() {
261
262	//update scrolling and positioning
263	$('#lightbox7').css('position', '');
264
265	if(isMobile) {
266		$('#blackout span.close').hide();
267		if( !$('#lightbox7 .lightbox_title .close').length ) {
268			var close = document.createElement("span");
269			close.setAttribute("class", "close");
270			close.textContent = '×';
271			$('#lightbox7 .lightbox_title').prepend(close);
272		}
273	} else {
274		if( $('#lightbox7.no-listings').length ||  $('#lightbox7.listing_details').length ) {
275			$('#blackout').css('overflow-y', 'scroll');
276		} else if( $('#lightbox7.listing_list').length ) {
277			$('#blackout').css('overflow-y', 'hidden');
278		}
279	
280		$('#blackout span.close').css('z-index', '10000');
281		$('#blackout span.close').css('display','block');
282	}
283
284	lb7_resize();
285
286	if( $('#lightbox7 .listing_list_container').length && !isMobile) {
287
288		//calculate listing list height
289		var non_list_container_height = 125 /*lb7 header*/ + 28 /*margins*/ + 158 /*suite expert box*/;
290		var list_container_height = 0;
291		$('.listing_list_container').children('.listing_list_row').each(function(){
292	        list_container_height += $(this).outerHeight();
293	    });
294	    
295		if(list_container_height > (viewport_height-non_list_container_height)) {
296
297			$('.listing_list_container').on('scroll wheel DOMMouseScroll', function(e) { 
298				var scroll_pos = $(this).scrollTop();
299				var scroll_amount = (-1*e.originalEvent.deltaY);
300
301				// console.log('list_container scroll detected. pos = ' + scroll_pos + ', amount = '+scroll_amount);
302				
303				if(!isNaN(scroll_amount)) {
304					$('.listing_list_container').scrollTop( scroll_pos - scroll_amount ); 
305					e.stopPropagation(); 
306					e.preventDefault(); 
307				}
308			});
309
310		}
311	}
312}
313
314function lb7_resize() {
315	// console.log('');
316	// console.log('lb7_resize start');
317	
318	if(isMobile) {
319		return;
320	}
321
322	if( $('#lightbox7.listing_list').length ) {
323
324		//resize map
325		if( $('.map_container').length ) {
326
327			resize_map( $('#lightbox7 .map_container') );
328			
329		}//if map_container exists
330
331		//resize listing list height
332		if( $('.listing_list_container').length && !isMobile ) {
333			var non_list_container_height = 125 /*lb7 header*/ + 28 /*margins*/ + 158 /*suite expert box*/;
334			var list_container_height = 0;
335			$('.listing_list_container').children('.listing_list_row').each(function(){
336		        list_container_height += $(this).outerHeight();
337		    });
338		    
339			if(list_container_height > non_list_container_height) {
340
341				$('.listing_list_container').css({
342					'max-height': (viewport_height-non_list_container_height) + 'px',
343					'overflow-y': 'scroll'
344				});
345				$('#no-location-msg').css('width', $('.map_container').width() + 'px');
346
347			}
348
349		}//if listing list container exists
350	}//if listing list
351
352	if( $('#lightbox7.listing_details').length ) {
353
354		if( $('#lightbox7.listing_details .listing_image').length ) {
355			var screen_width = $(window).width();
356
357			var galleria_width = isMobile ? $('#lightbox7 .listing_list_row_details .galleria_container').outerWidth() : get_lb7_galleria_width();
358			var galleria_height = isMobile ? $('#lightbox7.listing_details .listing_image').outerHeight() : get_lb7_galleria_height();
359
360			$('#lightbox7.listing_details .listing_image').css({
361				'height': '100%',
362				'width': '100%'
363			});
364
365			if(Galleria && Galleria.get().length > 1)
366				Galleria.get(1).resize({'width':galleria_width, 'height': galleria_height});
367		}
368
369		if( $('#lightbox7.listing_details .location_container .mini_map_content').length ) {
370
371			var map_height = $('.location_container .mini_map_content img').height();
372			var map_width = $('.location_container .mini_map_content img').width();
373			var cell_height_after = map_height / 1000;
374			var cell_width_after = map_width / 1000;
375			
376			$('.location_container .mini_map_content').children('.suite_pin_container').each(function() {
377			
378				if($(this).hasClass('med')) pin_size = 2;
379				else if($(this).hasClass('large')) pin_size = 3;
380				else if($(this).hasClass('small')) pin_size = 1;
381
382				offset = (pin_size == 1 ? 30 :
383							(pin_size == 2 ? 37 :
384								(pin_size == 3 ? 47 : 0)));
385
386				var x = $(this).attr('data-x');
387				var y = $(this).attr('data-y');
388			
389				$(this).css({
390					'margin-left': x*cell_width_after - offset + 'px',
391					'margin-top': -1*(1000-y)*cell_height_after - offset + 'px'
392				});
393			});
394		}
395	}//if listing details
396
397	if(!isMobile) {
398		var new_lb7_height = 
399			$('#lightbox7 .lightbox_content').outerHeight() + +$('#lightbox7 .lightbox_middle').
399css('margin-top').replace('px','');
400
401		if( +new_lb7_height > +$('#blackout').outerHeight() ) {
402			$('#lightbox7').css({
403				'position': 'absolute',
404				'height': new_lb7_height + 'px'
405			});
406		} else {
407			$('#lightbox7').css({
408				'position': 'absolute',
409				'height': ''
410			});
411		}
412	} else {
413		$('#lightbox7').css({
414			'overflow-y': 'scroll !important',
415			'height': '100% !important'
416		});
417		
418		//safari
419		$('html').addClass('lb7');
420	}
421}
422
423function lb7_close_prep() {
424	$('#blackout').css('overflow-y', 'scroll');
425	$('#blackout span.close').css('z-index', '');
426
427	if( $('#lightbox7.listing_details').length ) {
428		$('#blackout').unbind('scroll', scroll_listener);
429	}
430	
431	//safari
432	$('html').removeClass('lb7');
433
434	$('#non-header .cta_bar').remove();
435}
436
437function debouncer( func , timeout ) {
438   var timeoutID , timeout = timeout || 200;
439   return function () {
440      var scope = this , args = arguments;
441      clearTimeout( timeoutID );
442      timeoutID = setTimeout( function () {
443          func.apply( scope , Array.prototype.slice.call( args ) );
444      } , timeout );
445   }
446}
447
448function get_lb7_galleria_width() {
449	if($('#lightbox7 .listing_list_row_details').length) {
450		return $('#lightbox7 .listing_list_row_details .galleria_container').outerWidth();
451	} else {
452		return 0;
453	}
454}
455
456function get_lb7_galleria_height() {
457	if($('#lightbox7 .listing_list_row_details').length) {		
458		return 500;
459	} else {
460		return 0;
461	}
462}

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.