PageSourceSearch

https://www.conestogabuildings.com/wp-content/themes/conestoga-buildings/js/functions.js?ver=1738614855

js conestogabuildings.com collected 2026-10-09 05:14:56 UTC 11,073 bytes, 412 lines download raw bytes

1	;(function($, window, document, undefined) {
2	var $win = $(window);
3	var $doc = $(document);
4	var windowHeight = $win.height();
5	var WindowWidth = $win.width();
6
7	$doc.ready(function() {
8		sliderArticles();
9		sliderImagePrimary(); 
10		VideoImagePopup();
11
12		$(".widget_categories .post-form").dropkick({
13		  mobile: true
14		});
15				
16		$('.nav-trigger').on('click', function (event) {
17			$(this).toggleClass('active');
18
19			$('.nav').toggleClass('active');
20			
21			event.preventDefault();
22		});
23
24		$('.category-title').on('click', function (event) {
25			$(this).toggleClass('active');
26
27			$('.list-category').toggleClass('active');
28			
29			event.preventDefault();
30		});
31
32		$('.nav ul.sub-menu > li.menu-item-has-children > a').on('click', function  (e) {
33			var $this = $(this),
34				$parent = $this.parent();
35			
36			var $ul = $parent.find('.sub-menu');
37
38			if (!$parent.is('.active')) {
39				e.preventDefault();
40
41				$parent.toggleClass('active')
42					.siblings()
43						.removeClass('active');
44
45				$ul.toggleClass('active')
46					$ul.parent()
47						.siblings()
48						.find('.sub-menu')
49						.removeClass('active')
50			}
51		});
52
53		//Slide Image As Background
54		 // $('.slide').each(function(){
55			// var currentImage = $(this).find('img').attr('src');
56			// 	$(this).css('background-image', 'url('+currentImage+')');
57		 // });
58	});
59
60	$win.on('load',function() {
61
62		$('.btn-play, .btn-video').magnificPopup({
63			disableOn: 700,
64			type: 'iframe',
65			mainClass: 'mfp-fade',
66			removalDelay: 160,
67			preloader: false,
68			fixedContentPos: false,
69		});
70
71		$('.fullscreen-image').each(function(){
72			var imagesrc = $(this).attr('src');
73
74			$(this)
75				.closest('.fullscreen-image-container')
76				.css('background-image','url(' + imagesrc + ')' );
77		});
78	});
79
80	$win.on('load resize', function(){
81		$('.text-widgets .footer-widget-text').equalizeHeight();
82
83		if ($win.width()>1024) {
84			$('.equal').css('height', 'auto');
85			$('.equal').equalizeHeight();
86
87		} else {
88			$('.equal').css('height', 'auto');
89		};
90	});
91
92	//Slider Primary
93// 	function IntroSlider () {
94// 		var $IntroSlider = $('.slider-primary .slides');
95
96// 		$IntroSlider.slick({
97// 			dots: false,
98// 			fade: true,
99// 			adaptiveHeight: true,
100// 			cssEase: 'linear',
101// 			slidesToShow: 1,
102// 			speed: 500,
103// 			autoplay: true,
104// 			autoplaySpeed: 4000,
105// 			arrows: true,
106// 			nextArrow: '<i class="fa-solid fa-angle-right"></i>',
107// 			prevArrow: '<i class="fa-solid fa-angle-left"></i>',
108
109// 			responsive: [
110// 				{
111// 					breakpoint: 480,
112// 				      settings: {
113// 				        dots: false,
114// 				        arrows: false,
115// 				    }
116// 				}
117// 			  ]
118
119// 		});
120// 	};
121
122	function sliderArticles () {
123		var $sliderArticles = $('.slider-articles .slides');
124
125		$sliderArticles.owlCarousel({
126			loop: true,
127			autoHeight: true,
128			nav: true,
129			mouseDrag: false,
130			autoHeight: false,
131			autoHeightClass: 'owl-height',
132			slideBy: 2,
133			speed: 4000,
134			items: 2,
135			autoplay: true,
136			autoplaySpeed: 1000,
137			onInitialized: setOwlStageHeight,
138			onResized: setOwlStageHeight,
139			onTranslated: setOwlStageHeight,
140			responsive:{
141				0:{
142					items:1,
143					autoHeight: true,
144				},
145				600:{
146					items:1,
147					autoHeight: true,
148				},
149				1025:{
150					items:2,
151				},
152				1024:{
153					autoHeight: true,
154					items:1
155				}
156			},
157
158		});
159	}
160		
161function initializeImageSlider() {
162    var $imageSlider = $('.slider-image-primary .image-slides');
163
164    if ($imageSlider.length) {
165        $imageSlider.owlCarousel({
166            loop: true,
167            autoHeight: true,
168            nav: true,
169            items: 1,  // Display 1 item per slide
170            autoplay: true,
171            autoplayTimeout: 3000,  // Set autoplay speed
172            navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
173            responsive: {
174                0: {
175                    items: 1,
176                    autoHeight: true,
177                },
178                600: {
179                    items: 1,
180                    autoHeight: true,
181                },
182                1000: {
183                    items: 1,  // 1 item for larger screens
184                }
185            }
186        });
187    }
188}
189
190$(document).ready(function() {
191    initializeImageSlider();  // Initialize only the image slider on non-homepage pages
192});
193
194
195	//Equal Height
196	$.fn.equalizeHeight = function() {
197		var maxHeight = 0, itemHeight;
198
199		for (var i = 0; i < this.length; i++) {
200			itemHeight = $(this[i]).outerHeight();
201			if (maxHeight < itemHeight) {
202				maxHeight = itemHeight;
203			}
204		}
205		return this.outerHeight(maxHeight);
206	};
207	
208	$.fn.VideoImagePopup = function() {
209		VideoImagePopup();
210	};
211	
212	
213	function VideoImagePopup (argument) {
214		var items = [];
215		$('.gallery-item, .blocks-gallery-item, .photo-pop').each(function() {
216			var $box = $(this);
217			var $link = $box.find('a');
218
219			if ($link.hasClass('video')) {
220				items.push({
221					src: $link.attr('href'),
222					type: 'iframe'
223				});
224			} else {
225				items.push({
226					src: $link.attr('href'),
227					type: 'image',
228					link: $link.data('link'),
229					link_text: $link.data('linkText'),
230					caption: $link.data('caption')
231				});
232			}
233		});
234
235		$('.gallery-item a, .blocks-gallery-item a, .photo-pop a').each(function (i, el) {
236			$(this).magnificPopup({
237				index: i,
238				type: items[i].type,
239				tLoading: 'Loading image #%curr%...',
240				mainClass: 'mfp-img-mobile',
241				verticalFit: true,
242				gallery: {
243					enabled: true,
244					navigateByImgClick: true,
245					preload: [0,1] 
246				},
247				items: items,
248				image: {
249					 markup: '<div class="mfp-figure">'+
250						'<div class="mfp-close"></div>'+
251						'<div class="mfp-img"></div>'+
252						'<div class="mfp-bottom-bar">'+
253						  '<div class="mfp-title"></div>'+
254						'</div>'+
255					  '</div>',
256
257					tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
258					titleSrc: function(item) {
259						var btn = '';
260						if (typeof item.data.link !== 'undefined' && typeof item.data.link_text !== 'undefined') {
261							btn = '<a class="gallery-actions" href="' + item.data.link + '">' + item.data.link_text + '</a>';
262						};
263
264						var title = typeof(item.data.caption) !== 'undefined' ?  '<h3>' + item.data.caption + '</h3>' : '';
265						return  title + btn;
266					},
267				},
268				callbacks : {
269					buildControls: function() {
270				      
271					  if (this.arrowLeft && this.arrowRight) {
272						this.contentContainer.append(this.arrowLeft.add(this.arrowRight));
273					  }
274				    },
275
276					imageLoadComplete: function(){
277						// var $WrapperHeight = $('.mfp-content');
278
279						// $WrapperHeight.css({
280						// 	'max-height': windowHeight - 50,
281						// 	'max-width': WindowWidth,
282						// });
283
284						var mainWidth = $('.mfp-figure img').width();
285						$('.mfp-figure img').next().width(mainWidth);	
286
287						console.log(mainWidth);
288					},
289					
290					 resize: function() {
291						/*var $WrapperHeight = $('.mfp-content');
292
293					 	$WrapperHeight.css({
294							'max-height': windowHeight - 50,
295							'max-width': WindowWidth,
296						});*/
297
298						var mainWidth = $('.mfp-figure img').width();
299						$('.mfp-figure img').next().width(mainWidth);	
300
301						console.log(mainWidth);
302					}
303				}
304			})
305		});			
306	}
307
308	function setOwlStageHeight(event) {
309		var maxHeight = 0;
310
311		$('.slider-articles .owl-item.active').each(function () {
312			var thisHeight = parseInt( $(this).height() );
313			maxHeight=(maxHeight>=thisHeight?maxHeight:thisHeight);
314		});
315
316		$('.slider-articles .owl-carousel').css('height', maxHeight );
317		$('.slider-articles .owl-stage-outer').css('height', maxHeight );
318	};
319})(jQuery, window, document);
320
321jQuery(document).ready(function(){
322	jQuery('#project-gallery-tab-images').on('click', function(){
323		jQuery('#project-gallery-tab-videos').removeClass('project-gallery-tabs-active');
324		jQuery(this).addClass('project-gallery-tabs-active');
325		jQuery('.project-gallery-single-gallery-video-container').hide();
326		jQuery('.project-gallery-single-gallery-container').css('display', 'flex');
327
328	});
329
330	jQuery('#project-gallery-tab-videos').on('click', function(){
331		jQuery('#project-gallery-tab-images').removeClass('project-gallery-tabs-active');
332		jQuery(this).addClass('project-gallery-tabs-active');
333		jQuery('.project-gallery-single-gallery-container').hide();
334		jQuery('.project-gallery-single-gallery-video-container').css('display','flex');
335	});
336
337	var gallery_image = jQuery('.project-gallery-single-gallery-container img');
338
339	jQuery(gallery_image).hover(function(){
340		jQuery(gallery_image).not(this).addClass('blur');
341	},
342	function(){
343		jQuery(gallery_image).removeClass('blur');
344	}
345	
346	);
347
348	// handle the project gallery menu navigation functionality
349	jQuery('.category_name').on('click', function(){
350		var category_name = $(this);
351		$(this).css('font-weight','bold');
352		// this section gets all of the menu items and then matches the one that was clicked and reacts accordingly
353		$('#taxonomy-menu-ul li').each(function(){
354			if($(category_name).text() == $(this).text()){
355				var get_category = '.' + $(this).text();
356				var get_image_url = $('#' + $(this).text()).val();
357				$(get_category).css('display','flex');
358				$('.taxonomy-hero-image').removeAttr('style');
359				/*$('.taxonomy-hero-image').css('background-image', 'url('+ get_image_url +')');
360					// this handles the hero image title
361					if($(this).text() != 'View All'){
362						$('#pjg-hero-title').html($(this).text());
363					}else{
364						$('#pjg-hero-title').html('Project Gallery');
365					}*/
366			// had to write specific functionality to handle view all
367			}else if($(category_name).text() == 'View All'){
368				var get_all_categories = document.getElementsByClassName('category_name');
369				var get_image_url = $('#view_all').val();
370				$('.taxonomy-hero-image').removeAttr('style');
371				/*$('.taxonomy-hero-image').css('background-image', 'url('+ get_image_url +')');*/
372				$(get_all_categories).each(function(){
373					var get_category = '.' + $(this).text();
374					$(get_category).css('display', 'flex');
375					$(this).css('font-weight', '500');
376					$('#cat_menu_view_all').css('font-weight', 'bold');
377				});
378			// how everything that wasn't chosen is hidden
379			}else{
380				$(this).css('font-weight', '500');
381				var get_category = '.' + $(this).text();
382				$(get_category).css('display','none');
383			}
384		});
385	});
386
387});
388jQuery(document).ready(function(){
389	jQuery('img').on('click', function(){
390		var normal_size = jQuery(this).attr('data-normal-size');
391		if(normal_size){
392				jQuery('#large-project-image').removeClass('slideLeft');
393				jQuery('#large-project-image').removeClass('slideRight');
394				jQuery('#large-project-image').addClass('slideLeft');
395				jQuery('#large-project-image').attr('src', normal_size);
396				setTimeout(function(){
397					jQuery('#large-project-image').addClass('slideRight');
398				},300);
399		}
400	});
401});
402
403jQuery(document).ready(function(){
404	jQuery('.job__position').each(function() {
405    	jQuery(this).click(function() {
406			//         alert('es clicked ye');
407			//console.log('es clicked ye');
408       	 	jQuery(this).toggleClass('active');
409        	jQuery(this).next('.job__description').toggleClass('active').slideToggle(200);
410    	});
411	});
412});

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.