PageSourceSearch

https://www.cubadupa.co.nz/wp-content/themes/salient/js/priority.js?ver=11.0.1

js cubadupa.co.nz collected 2026-10-02 11:39:04 UTC 7,597 bytes, 196 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		nectarPageHeader.css('height', ( parseInt(window.innerHeight) - parseInt(pageHeaderOffset)) +'px');
43	}
44	
45	if( using_mobile_browser && $('#page-header-bg.fullscreen-header').length > 0 ) {
46		
47		nectarPageHeader = $('#page-header-bg');
48		
49		fullscreenHeightCalc();
50		
51		var $windowDOMWidth = window.innerWidth, $windowDOMHeight = window.innerHeight;
52		
53		$(window).resize(function(){
54			if( ($(window).width() != $windowDOMWidth && $(window).height != $windowDOMHeight)){
55				fullscreenHeightCalc();
56				// Store the current window dimensions.
57				$windowDOMWidth = window.innerWidth;
58				$windowDOMHeight = window.innerHeight;
59			}
60		});
61		
62	}
63	
64  /**
65  * Set the height of the fullscreen recent project slider
66  *
67  * @since 9.0
68  */
69	function portfolioFullScreenSliderCalcs() {
70		
71		var $bodyBorderSize = ($('.body-border-top').length > 0 && $(window).width() > 1000) ? $('.body-border-top').height(): 0;
72		
73		$('.nectar_fullscreen_zoom_recent_projects').each(function(){
74			if($(this).parents('.first-section').length > 0) {
75				$(this).css('height',$(window).height() - $(this).offset().top - $bodyBorderSize);
76			} else {
77				$(this).css('height',$(window).height());
78			}
79		});
80		
81	}
82	
83	if(using_mobile_browser && $('.nectar_fullscreen_zoom_recent_projects').length > 0) { 
84    portfolioFullScreenSliderCalcs(); 
85  }
86	
87	
88  /**
89  * Move the needed HTML for the centered header bottom bar format.
90  *
91  * @since 9.0
92  */
93	function centeredNavBottomBarReposition() {
94		
95		var $headerSpan9 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');
96		var $headerSpan3 = $('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_3');
97		var $secondaryHeader = $('#header-secondary-outer');
98		
99		var $logoLinkClone = $headerSpan3.find('#logo').clone();
100		if($logoLinkClone.is('[data-supplied-ml="true"]')) {
101			$logoLinkClone.find('img:not(.mobile-only-logo)').remove();
102		}
103		//trans
104		$logoLinkClone.find('img.starting-logo').remove();
105		
106
107		if($secondaryHeader.length > 0) {
108			$secondaryHeader.addClass('centered-menu-bottom-bar');
109		} 
110		
111		
112		if($('#header-outer[data-condense="true"]').length > 0) {
113			$headerSpan9.prepend($logoLinkClone);
114		} 
115	}
116  
117	
118	if($('#header-outer[data-format="centered-menu-bottom-bar"]').length > 0) {
119		centeredNavBottomBarReposition();
120	}
121	
122	
123	// Add loaded class for "zoom out" page header effect.
124	$('#page-header-bg[data-animate-in-effect="zoom-out"]').addClass('loaded');
125	
126  
127  /**
128  * Nectar Slider mobile font sizing override options.
129  *
130  * @since 9.0
131  */
132	function sliderFontOverrides() { 
133		
134		var $overrideCSS = '';
135		
136		$('.nectar-slider-wrap').each(function(){
137			
138			if($(this).find('.swiper-container[data-tho]').length > 0) {
139				
140				var $tho = $(this).find('.swiper-container').attr('data-tho');
141				var $tco = $(this).find('.swiper-container').attr('data-tco');
142				var $pho = $(this).find('.swiper-container').attr('data-pho');
143				var $pco = $(this).find('.swiper-container').attr('data-pco');
144				
145				// Tablets Viewport.
146				if( $tho != 'auto' || $tco != 'auto' ) {
147          
148					$overrideCSS += '@media only screen and (max-width: 1000px) and (min-width: 690px) {';
149					if($tho != 'auto')
150					$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;  }';
151					if($pho != 'auto')
152					$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;  }';
153					$overrideCSS += '}';
154          
155				}
156				
157				
158				// Phone Viewport.
159				if( $pho != 'auto' || $pco != 'auto' ) {
160					
161					$overrideCSS += '@media only screen and (max-width: 690px) {';
162					if($pho != 'auto')
163					$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;  }';
164					if($pho != 'auto')
165					$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;  }';
166					$overrideCSS += '}';
167				}
168				
169			}
170      
171		});
172		
173    
174		if( $overrideCSS.length > 1 ) {
175      
176			var head = document.head || document.getElementsByTagName('head')[0];
177			var style = document.createElement('style');
178			
179			style.type = 'text/css';
180			if (style.styleSheet){
181				style.styleSheet.cssText = $overrideCSS;
182			} else {
183				style.appendChild(document.createTextNode($overrideCSS));
184			}
185			
186			head.appendChild(style);
187			
188			$('.nectar-slider-wrap .content').css('visibility','visible');
189		}
190
191	}
192  
193	sliderFontOverrides();
194	
195
196});

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.