PageSourceSearch

https://stansburysbarbershop.com/wp-content/themes/salient/js/priority.js?ver=13.0.6

js stansburysbarbershop.com collected 2026-09-30 11:04:44 UTC 7,601 bytes, 197 lines download raw bytes

1/**
2 * Salient priority script.
3 *
4 * @package Salient
5 * @author ThemeNectar
6 */
7 /* global jQuery */
8
9
10// Mobile Secondary Header Nav Always Visible.
11var headerEl      = document.getElementById('header-outer');
12var headerSpaceEl = document.getElementById('header-space');
13
14if( typeof(headerEl) != 'undefined' && headerEl != null &&
15    typeof(headerSpaceEl) != 'undefined' && headerSpaceEl != null &&
16		headerSpaceEl.hasAttribute('data-secondary-header-display')) {
17
18	headerSpaceEl.style.height = headerEl.clientHeight + 'px';
19
20}
21
22
23// DOM Ready.
24jQuery(function($) {
25
26	"use strict";
27
28	var using_mobile_browser = false;
29	if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) {
30		using_mobile_browser = true;
31	}
32
33	var nectarPageHeader;
34
35  /**
36  * Set the height of fullscreen page headers
37  *
38  * @since 9.0
39  */
40	function fullscreenHeightCalc() {
41		var pageHeaderOffset = nectarPageHeader.offset().top;
42    $('#page-header-wrap.fullscreen-header').css('height','auto');
43		nectarPageHeader.css('height', ( parseInt(window.innerHeight) - parseInt(pageHeaderOffset)) +'px');
44	}
45
46	if( using_mobile_browser && $('#page-header-bg.fullscreen-header').length > 0 ) {
47
48		nectarPageHeader = $('#page-header-bg');
49
50		fullscreenHeightCalc();
51
52		var $windowDOMWidth = window.innerWidth, $windowDOMHeight = window.innerHeight;
53
54		$(window).resize(function(){
55			if( ($(window).width() != $windowDOMWidth && $(window).height != $windowDOMHeight)){
56				fullscreenHeightCalc();
57				// Store the current window dimensions.
58				$windowDOMWidth = window.innerWidth;
59				$windowDOMHeight = window.innerHeight;
60			}
61		});
62
63	}
64
65  /**
66  * Set the height of the fullscreen recent project slider
67  *
68  * @since 9.0
69  */
70	function portfolioFullScreenSliderCalcs() {
71
72		var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
73
74		$('.nectar_fullscreen_zoom_recent_projects').each(function(){
75			if($(this).parents('.first-section').length > 0) {
76				$(this).css('height',$(window).height() - $(this).offset().top - $bodyBorderSize);
77			} else {
78				$(this).css('height',$(window).height());
79			}
80		});
81
82	}
83
84	if(using_mobile_browser && $('.nectar_fullscreen_zoom_recent_projects').length > 0) {
85    portfolioFullScreenSliderCalcs();
86  }
87
88
89  /**
90  * Move the needed HTML for the centered header bottom bar format.
91  *
92  * @since 9.0
93  */
94	function centeredNavBottomBarReposition() {
95
96		var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
97		var $headerSpan3 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_3');
98		var $secondaryHeader = $('#header-secondary-outer');
99
100		var $logoLinkClone = $headerSpan3.find('#logo').clone();
101		if($logoLinkClone.is('[data-supplied-ml="true"]')) {
102			$logoLinkClone.find('img:not(.mobile-only-logo)').remove();
103		}
104		//trans
105		$logoLinkClone.find('img.starting-logo').remove();
106
107
108		if($secondaryHeader.length > 0) {
109			$secondaryHeader.addClass('centered-menu-bottom-bar');
110		}
111
112
113		if($('#header-outer[data-condense="true"]').length > 0 && $('#header-outer[data-menu-bottom-bar-align="left"]').length == 0 ) {
114			$headerSpan9.prepend($logoLinkClone);
115		}
116	}
117
118
119	if($('#header-outer[data-format="centered-menu-bottom-bar"]').length > 0) {
120		centeredNavBottomBarReposition();
121	}
122
123
124	// Add loaded class for "zoom out" page header effect.
125	$('#page-header-bg[data-animate-in-effect="zoom-out"]').addClass('loaded');
126
127
128  /**
129  * Nectar Slider mobile font sizing override options.
130  *
131  * @since 9.0
132  */
133	function sliderFontOverrides() {
134
135		var $overrideCSS = '';
136
137		$('.nectar-slider-wrap').each(function(){
138
139			if($(this).find('.swiper-container[data-tho]').length > 0) {
140
141				var $tho = $(this).find('.swiper-container').attr('data-tho');
142				var $tco = $(this).find('.swiper-container').attr('data-tco');
143				var $pho = $(this).find('.swiper-container').attr('data-pho');
144				var $pco = $(this).find('.swiper-container').attr('data-pco');
145
146				// Tablets Viewport.
147				if( $tho != 'auto' || $tco != 'auto' ) {
148
149					$overrideCSS += '@media only screen and (max-width: 1000px) and (min-width: 690px) {';
150					if($tho != 'auto')
151					$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;  }';
152					if($pho != 'auto')
153					$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;  }';
154					$overrideCSS += '}';
155
156				}
157
158
159				// Phone Viewport.
160				if( $pho != 'auto' || $pco != 'auto' ) {
161
162					$overrideCSS += '@media only screen and (max-width: 690px) {';
163					if($pho != 'auto')
164					$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;  }';
165					if($pho != 'auto')
166					$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;  }';
167					$overrideCSS += '}';
168				}
169
170			}
171
172		});
173
174
175		if( $overrideCSS.length > 1 ) {
176
177			var head = document.head || document.getElementsByTagName('head')[0];
178			var style = document.createElement('style');
179
180			style.type = 'text/css';
181			if (style.styleSheet){
182				style.styleSheet.cssText = $overrideCSS;
183			} else {
184				style.appendChild(document.createTextNode($overrideCSS));
185			}
186
187			head.appendChild(style);
188
189			$('.nectar-slider-wrap .content').css('visibility','visible');
190		}
191
192	}
193
194	sliderFontOverrides();
195
196
197});

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.