PageSourceSearch

https://www.camptakajo.com/wp-content/themes/salient/js/priority.js?ver=10.0.1

js camptakajo.com collected 2026-10-04 13:33:30 UTC 19,523 bytes, 419 lines download raw bytes

1jQuery(function($) {
2
3	 //add specific class if on device for better tablet tracking
4	 var using_mobile_browser = false;
5	 if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { using_mobile_browser = true; }
6	 
7	 var nectarPageHeader;
8	 
9	 function fullscreenHeightCalc() {
10		  var pageHeaderOffset = nectarPageHeader.offset().top;
11	 		nectarPageHeader.css('height', ( parseInt(window.innerHeight) - parseInt(pageHeaderOffset)) +'px');
12	 }
13	 
14	 if(using_mobile_browser && $('#page-header-bg.fullscreen-header').length > 0) {
15		 
16		 nectarPageHeader = $('#page-header-bg');
17		 
18		 fullscreenHeightCalc();
19		 
20		 var $windowDOMWidth = window.innerWidth, $windowDOMHeight = window.innerHeight;
21		 
22		 $(window).resize(function(){
23			 	if( ($(window).width() != $windowDOMWidth && $(window).height != $windowDOMHeight)){
24				 fullscreenHeightCalc();
25				 //store the current window dimensions
26				 $windowDOMWidth = window.innerWidth;
27				 $windowDOMHeight = window.innerHeight;
28			 }
29		 });
30		 
31	 }
32	 
33	 function portfolioFullScreenSliderCalcs() {
34 
35 		var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
36 
37 		$('.nectar_fullscreen_zoom_recent_projects').each(function(){
38 			if($(this).parents('.first-section').length > 0) {
39 				$(this).css('height',$(window).height() - $(this).offset().top - $bodyBorderSize);
40 			} else {
41 				$(this).css('height',$(window).height());
42 			}
43 		});
44 
45 	}
46	
47	if(using_mobile_browser && $('.nectar_fullscreen_zoom_recent_projects').length > 0) { portfolioFullScreenSliderCalcs(); }
48	
49	
50		function centeredNavBottomBarReposition() {
51			
52			var $headerOuter = $('#header-outer');
53			var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
54			var $headerSpan3 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_3');
55			var $secondaryHeader = $('#header-secondary-outer');
56			
57
58			var $logoLinkClone = $headerSpan3.find('#logo').clone();
59			if($logoLinkClone.is('[data-supplied-ml="true"]')) {
60				$logoLinkClone.find('img:not(.mobile-only-logo)').remove();
61			}
62			//trans
63			$logoLinkClone.find('img.starting-logo').remove();
64			
65
66			function centeredNavBottomBarSecondary() {
67				if($('body.mobile').length > 0) {
68					$('#header-outer').css('margin-top','');
69				} else {
70	
71					// custom mobile breakpoint
72					if($('#header-outer .span_9').css('display') == 'none') {
73						 $('#header-outer').css('margin-top','');
74					} else if($('#header-outer .span_9').css('display') != 'none' && parseInt($('#header-outer').css('top')) > 0) {
75						 $('#header-outer').css('top','');
76					}
77					
78					
79				}
80				
81			}
82			
83			if($secondaryHeader.length > 0) {
84				
85				if($('#header-outer[data-remove-fixed="1"]').length == 0 && $('#header-outer[data-condense="true"]').length > 0) {
86					setTimeout(function(){
87						centeredNavBottomBarSecondary();
88					},50);
89				}
90			
91				$secondaryHeader.addClass('centered-menu-bottom-bar');
92
93
94			} 
95			
96			if($('#header-outer[data-condense="true"]').length > 0) {
97				$headerSpan9.prepend($logoLinkClone);
98			} 
99			
100
101			
102		}
103	
104		if($('#header-outer[data-format="centered-menu-bottom-bar"]').length > 0) {
105			centeredNavBottomBarReposition();
106		}
107	
108	
109		//add loaded class for zoom out page header
110		$('#page-header-bg[data-animate-in-effect="zoom-out"]').addClass('loaded');
111	
112		function sliderFontOverrides() { 
113				
114				var $overrideCSS = '';
115	
116				$('.nectar-slider-wrap').each(function(i){
117	
118						if($(this).find('.swiper-container[data-tho]').length > 0) {
119					 
120								$tho = $(this).find('.swiper-container').attr('data-tho');
121								$tco = $(this).find('.swiper-container').attr('data-tco');
122								$pho = $(this).find('.swiper-container').attr('data-pho');
123								$pco = $(this).find('.swiper-container').attr('data-pco');
124	
125								//tablet
126								if($tho != 'auto' || $tco != 'auto') {
127										$overrideCSS += '@media only screen and (max-width: 1000px) and (min-width: 690px) {';
128										if($tho != 'auto')
129												$overrideCSS += '#'+$(this).attr('id')+ '.nectar-slider-wrap[data-full-width="false"] .swiper-slide .content h2, #boxed .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content h2, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="true"] .swiper-slide .content h2, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="boxed-full-width"] .swiper-slide .content h2, body .full-width-content .vc_span12 .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content h2 { font-size:' + $tho + 'px!important; line-height:' + (parseInt($tho) + 10) + 'px!important;  }';
130										if($pho != 'auto')
131												$overrideCSS += '#'+$(this).attr('id')+ '.nectar-slider-wrap[data-full-width="false"] .swiper-slide .content p, #boxed .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content p, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="true"] .swiper-slide .content p, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="boxed-full-width"] .swiper-slide .content p, body .full-width-content .vc_span12 .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content p { font-size:' + $tco + 'px!important; line-height:' + (parseInt($tco) + 10) + 'px!important;  }';
132										$overrideCSS += '}';
133							 }
134			 
135	
136								//phone
137								 if($pho != 'auto' || $pco != 'auto') {
138	
139									 $overrideCSS += '@media only screen and (max-width: 690px) {';
140										if($pho != 'auto')
141												$overrideCSS += '#'+$(this).attr('id')+ '.nectar-slider-wrap[data-full-width="false"] .swiper-slide .content h2, #boxed .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content h2, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="true"] .swiper-slide .content h2, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="boxed-full-width"] .swiper-slide .content h2, body .full-width-content .vc_span12 .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content h2 { font-size:' + $pho + 'px!important; line-height:' + (parseInt($pho) + 10) + 'px!important;  }';
142										if($pho != 'auto')
143												$overrideCSS += '#'+$(this).attr('id')+ '.nectar-slider-wrap[data-full-width="false"] .swiper-slide .content p, #boxed .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content p,  body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="true"] .swiper-slide .content p, body .nectar-slider-wrap#'+$(this).attr('id')+ '[data-full-width="boxed-full-width"] .swiper-slide .content p, body .full-width-content .vc_span12 .nectar-slider-wrap#'+$(this).attr('id')+ ' .swiper-slide .content p { font-size:' + $pco + 'px!important; line-height:' + (parseInt($pco) + 10) + 'px!important;  }';
144										$overrideCSS += '}';
145								}
146	
147						}
148				});
149	
150				if($overrideCSS.length > 1) {
151						var head = document.head || document.getElementsByTagName('head')[0];
152						var style = document.createElement('style');
153	
154						style.type = 'text/css';
155						if (style.styleSheet){
156							style.styleSheet.cssText = $overrideCSS;
157						} else {
158							style.appendChild(document.createTextNode($overrideCSS));
159						}
160	
161						head.appendChild(style);
162						
163						$('.nectar-slider-wrap .content').css('visibility','visible');
164				}
165		
166	
167		}
168		sliderFontOverrides();
169	
170	
171	
172		function centeredLogoMargins() {
173			if($('#header-outer[data-format="centered-logo-between-menu"]').length > 0 && $(window).width() > 1000) {
174				$midnightSelector = ($('#header-outer .midnightHeader').length > 0) ? '> .midnightHeader:first-child' : '';
175				var $navItemLength = $('#header-outer[data-format="centered-logo-between-menu"] '+$midnightSelector+' nav > .sf-menu > li').length;
176				if($('#header-outer #social-in-menu').length > 0) { $navItemLength--; }
177	
178				$centerLogoWidth = ($('#header-outer .row .col.span_3 #logo img:visible').length == 0) ? parseInt($('#header-outer .row .col.span_3').width()) : parseInt($('#header-outer .row .col.span_3 img:visible').width());
179	
180				$extraMenuSpace = ($('#header-outer[data-lhe="animated_underline"]').length > 0) ? parseInt($('#header-outer header#top nav > ul > li:first-child > a').css('margin-right')) : parseInt($('#header-outer header#top nav > ul > li:first-child > a').css('padding-right'));
181				
182				if($extraMenuSpace > 30) {
183					$extraMenuSpace += 45;
184				} else if($extraMenuSpace > 20) {
185					$extraMenuSpace += 40;
186				} else {
187					$extraMenuSpace += 30;
188				}
189	
190				$('#header-outer[data-format="centered-logo-between-menu"] nav > .sf-menu > li:nth-child('+Math.floor($navItemLength/2)+')').css({'margin-right': ($centerLogoWidth+$extraMenuSpace) + 'px'}).addClass('menu-item-with-margin');
191				$leftMenuWidth = 0;
192				$rightMenuWidth = 0;
193				$('#header-outer[data-format="centered-logo-between-menu"] '+$midnightSelector+' nav > .sf-menu > li:not(#social-in-menu)').each(function(i){
194					if(i+1 <= Math.floor($navItemLength/2)) {
195						$leftMenuWidth += $(this).width();
196					} else {
197						$rightMenuWidth += $(this).width();
198					}
199	
200				});
201	
202				var $menuDiff = Math.abs($rightMenuWidth - $leftMenuWidth);
203	
204				if($leftMenuWidth > $rightMenuWidth) 
205					$('#header-outer .row > .col.span_9').css('padding-right',$menuDiff);
206				else 
207					$('#header-outer .row > .col.span_9').css('padding-left',$menuDiff);
208	
209				$('#header-outer[data-format="centered-logo-between-menu"] nav').css('visibility','visible');
210			}
211		}
212	
213		var usingLogoImage = ($('#header-outer[data-using-logo="1"]').length > 0) ? true : false;
214	
215	
216		//logo centered between menu
217		if(!usingLogoImage) {
218			centeredLogoMargins();
219		}
220		else if(usingLogoImage && $('#header-outer[data-format="centered-logo-between-menu"]').length > 0 && $('header#top #logo img:first[src]').length > 0) {
221			
222			//fadein img on load
223			var tempLogoImg = new Image();
224			tempLogoImg.src = $('header#top #logo img:first').attr('src');
225	
226				tempLogoImg.onload = function() {
227					 centeredLogoMargins();
228				};
229			
230		}
231		
232		
233		
234		
235	function nectarFullWidthSections() {
236
237
238	var $windowInnerWidth = window.innerWidth;
239	var $scrollBar = ($('#ascrail2000').length > 0 && $windowInnerWidth > 1000) ? -13 : 0;
240	var $bodyBorderWidth = ($('.body-border-right').length > 0 && $windowInnerWidth > 1000) ? parseInt($('.body-border-right').width())*2 : 0;
241  var $justOutOfSight;
242	
243	if($('#boxed').length == 1){
244		$justOutOfSight = ((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4;
245	} else {
246		
247		//if the ext responsive mode is on - add the extra padding into the calcs
248		var $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && $windowInnerWidth >= 1000) ? 180 : 0;
249		var $leftHeaderSize = ($('#header-outer[data-format="left-header"]').length > 0 && $windowInnerWidth >= 1000) ? parseInt($('#header-outer[data-format="left-header"]').width()) : 0;
250		if($(window).width() - $leftHeaderSize - $bodyBorderWidth  <= parseInt($('.main-content').css('max-width'))) { 
251			var $windowWidth = parseInt($('.main-content').css('max-width'));
252
253			//no need for the scrollbar calcs with ext responsive on desktop views
254			if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar;
255
256		} else { 
257			var $windowWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth;
258		}
259
260		
261		var $contentWidth = parseInt($('.main-content').css('max-width'));
262
263		//single post fullwidth
264		if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 ) {
265			$contentWidth = $('.post-area').width();
266			$extResponsivePadding = 0;
267		}
268		
269		$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
270	}
271
272
273	$('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"]:not(.fullwidth-constrained), .full-width-content').each(function(){
274
275	var $leftHeaderSize = ($('#header-outer[data-format="left-header"]').length > 0 && $windowInnerWidth >= 1000) ? parseInt($('#header-outer[data-format="left-header"]').width()) : 0;
276	var $bodyBorderWidth = ($('.body-border-right').length > 0 && $windowInnerWidth > 1000) ? parseInt($('.body-border-right').width())*2 : 0;
277
278	//single post fullwidth
279	if($('#boxed').length == 1){
280
281		var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
282
283		if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('.post-area').length > 0) {
284			$contentWidth = $('.post-area').width();
285			$extResponsivePadding = 0;
286			$windowWidth = $(window).width() - $bodyBorderWidth;
287			$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
288		} else {
289			if($(this).parents('.page-submenu').length > 0)
290				$justOutOfSight = ((parseInt($('.container-wrap').width()) - $mainContentWidth) / 2);
291			else 
292				$justOutOfSight = ((parseInt($('.container-wrap').width()) - $mainContentWidth) / 2) + 4;
293		}
294	} else {
295		if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('.post-area').length > 0) {
296			$contentWidth = $('.post-area').width();
297			$extResponsivePadding = 0;
298			$windowWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth;
299		} else {
300
301			var $mainContentMaxWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').css('max-width')) : parseInt($(this).parents('.container').css('max-width'));
302
303			//when using gutter on portfolio don't add extra space for scroll bar
304				if($('#boxed').length == 0 && $(this).hasClass('portfolio-items') && $(this).is('[data-gutter*="px"]') && $(this).attr('data-gutter').length > 0 && $(this).attr('data-gutter') != 'none') {
305					$scrollBar = ($('#ascrail2000').length > 0 && $windowInnerWidth > 1000) ? -13 : 0;
306				}
307
308			if($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentMaxWidth) { 
309				$windowWidth = $mainContentMaxWidth;
310				//no need for the scrollbar calcs with ext responsive on desktop views
311				if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar;
312			}
313			$contentWidth = $mainContentMaxWidth;
314			$extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 180 : 0;
315			if($leftHeaderSize > 0) $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 120 : 0;
316		}
317
318		$justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) )
319	}
320
321	var $extraSpace = 0;
322	if( $(this).hasClass('carousel-wrap')) $extraSpace = 1;
323	if( $(this).hasClass('portfolio-items')) $extraSpace = 5;
324
325		var $carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : $(window).width() - $leftHeaderSize - $bodyBorderWidth +$extraSpace  + $scrollBar ;
326
327		//when using gutter on portfolio don't add extra space
328		if($('#boxed').length == 0 && $(this).hasClass('portfolio-items') && $(this).is('[data-gutter*="px"]') && $(this).attr('data-gutter').length > 0 && $(this).attr('data-gutter') != 'none') {
329			if($(window).width() > 1000)
330				$carouselWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth + $scrollBar + 3
331			else 
332				$carouselWidth = $(window).width() - $leftHeaderSize - $bodyBorderWidth + $scrollBar 
333		}
334
335		if($(this).parent().hasClass('default-style')) { 
336
337			var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
338			
339			if($('#boxed').length != 0) {
340				$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : $(window).width() - $leftHeaderSize + $extraSpace + $scrollBar ;
341		}
342		else {
343			$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.025) + $extraSpace + $scrollBar ;
344			$windowWidth = ($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentWidth) ? $mainContentWidth : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.025);
345			$justOutOfSight = Math.ceil( (($windowWidth + $scrollBar - $mainContentWidth) / 2) )
346		}
347	}
348
349	else if($(this).parent().hasClass('spaced')) { 
350
351		var $mainContentWidth = ($('#nectar_fullscreen_rows').length == 0) ? parseInt($('.main-content').width()) : parseInt($(this).parents('.container').width());
352
353		if($('#boxed').length != 0) {
354				$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) - ($(window).width()*.02) : $(window).width() + $extraSpace + $scrollBar ;
355		} else {
356			$carouselWidth = ($('#boxed').length == 1) ? $mainContentWidth + parseInt($justOutOfSight*2) : ($(window).width()- $leftHeaderSize - $bodyBorderWidth)  - Math.ceil(($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.02) + $extraSpace + $scrollBar ;
357			var $windowWidth2 = ($(window).width() - $leftHeaderSize - $bodyBorderWidth <= $mainContentWidth) ? $mainContentWidth : ($(window).width() - $leftHeaderSize - $bodyBorderWidth) - (($(window).width()- $leftHeaderSize - $bodyBorderWidth)*.02);
358			$justOutOfSight = Math.ceil( (($windowWidth2 + $scrollBar - $mainContentWidth) / 2) +2)
359		}
360	}
361		
362		if(!$(this).parents('.span_9').length > 0 && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner' && $(this).parent().attr('id') != 'portfolio-extra' 
363		&& !$(this).find('.carousel-wrap[data-full-width="true"]').length > 0
364		&& !$(this).find('.nectar-carousel-flickity-fixed-content').length > 0
365		&& !$(this).find('.portfolio-items:not(".carousel")[data-col-num="elastic"]').length > 0){
366
367			//escape if inside woocoommerce page and not using applicable layout
368			if($('.single-product').length > 0 && $(this).parents('#tab-description').length > 0 && $(this).parents('.full-width-tabs').length == 0) {
369				$(this).css({
370				'visibility': 'visible'
371			});	
372			} else {
373				if($(this).hasClass('portfolio-items')) {
374					$(this).css({
375						'transform': 'translateX(-'+ $justOutOfSight + 'px)',
376						'margin-left': 0,
377						'left': 0,
378						'width': $carouselWidth,
379						'visibility': 'visible'
380					});	
381				} else {
382					$(this).css({
383						'left': 0,
384						'margin-left': - $justOutOfSight,
385						'width': $carouselWidth,
386						'visibility': 'visible'
387					});	
388				}
389			
390		}
391	}  else if($(this).parent().attr('id') == 'portfolio-extra' && $('#full_width_portfolio').length != 0) {
392		$(this).css({
393			'left': 0,
394			'margin-left': - $justOutOfSight,
395			'width': $carouselWidth,
396			'visibility': 'visible'
397		});	
398	}
399
400	else {
401		$(this).css({
402			'margin-left': 0,
403			'width': 'auto',
404			'left': '0',
405			'visibility': 'visible'
406		});	
407	}
408		
409	});
410
411
412}
413
414	if($('#nectar_fullscreen_rows').length == 0) {
415		nectarFullWidthSections();
416	}
417
418
419});

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.