1jQuery(document).ready(function() { 2 // Offset top of page-banner to height of header 3 setTimeout(function() { 4 var headerHeight = jQuery('header.site-header').height(); 5 var popupHeight = jQuery('#popmake-3899').height(); 6 if(typeof popupHeight == 'undefined') { 7 popupHeight = 0; 8 } 9 var mainOffset = Math.floor(headerHeight + popupHeight); 10 jQuery('main').css('margin-top', mainOffset); 11 }, 1); 12 13 // Offset top of header by height of admin bar 14 setTimeout(function() { 15 if(jQuery('body').hasClass('admin-bar')) { 16 var adminBarHeight = jQuery('#wpadminbar').height(); 17 jQuery('header.site-header').css('top', adminBarHeight); 18 } 19 }, 1); 20 21 // Offset top of header by height of popup 22 setTimeout(function() { 23 var popupHeight = jQuery('#popmake-3899').outerHeight(); 24 if(typeof popupHeight == 'undefined') { 25 popupHeight = 0; 26 } 27 jQuery('header.site-header').css('padding-top', popupHeight); 28 }, 1); 29 30 // Offset footer padding bottom by height of Cookies banner 31 var cookieBannerHeight = jQuery('#popmake-123').outerHeight(); 32 if(cookieBannerHeight > 0) { 33 jQuery('footer').css('padding-bottom', cookieBannerHeight); 34 } 35 36 // Open Accordions on the Locations page by default on page load 37 jQuery('.post-type-archive-locations .accordion-block .accordion .accordion-content').css('height', 'auto'); 38 39 jQuery(document).on( 'click', '.accordion', function() { 40 jQuery(this).children('a').on('click', function(e) { 41 e.stopImmediatePropagation; 42 }); 43 if(jQuery(this).children('.accordion-content').hasClass('clicked')) { 44 jQuery(this).children('.accordion-content').removeClass('clicked'); 45 curHeight = jQuery(this).children('.accordion-content').height(); 46 jQuery(this).children('.accordion-content').height(curHeight).animate({height: 0}, 250); 47 } else { 48 jQuery(this).children('.accordion-content').addClass('clicked'); 49 curHeight = jQuery(this).children('.accordion-content').height(); 50 autoHeight = jQuery(this).children('.accordion-content').css('height', 'auto').height(); 51 jQuery(this).children('.accordion-content').height(curHeight).animate({height: autoHeight}, 250); 52 } 53 if(jQuery(this).children('.accordion-head').hasClass('clicked')) { 54 jQuery(this).children('.accordion-head').removeClass('clicked'); 55 } else { 56 jQuery(this).children('.accordion-head').addClass('clicked'); 57 } 58 }); 59 60 jQuery(document).on('click', '.accordion-content a', function(e) { 61 e.stopPropagation(); 62 }); 63 64 var windowWidth = jQuery(window).width(); 65 if(windowWidth <= 1522) { 66 jQuery('.site-header').addClass('mobile'); 67 } else { 68 jQuery('.site-header').removeClass('mobile'); 69 } 70 71 // Open Primary Nav on click of the Hamburger on mobile 72 jQuery(document).on('click', '#hamburger', function() { 73 if(jQuery('#hamburger').hasClass('open')) { 74 jQuery('#hamburger').removeClass('open'); 75 jQuery('.menu-primary-nav-container').removeClass('clicked'); 76 } else { 77 jQuery('#hamburger').addClass('open'); 78 jQuery('.menu-primary-nav-container').addClass('clicked'); 79 } 80 }); 81 82 // don't navigate to the parent page unless its menu is already opened 83 jQuery('.menu-item-has-children').on('click', function() { 84 if(jQuery(this).hasClass('clicked')) { 85 jQuery(this).removeClass('clicked'); 86 } else { 87 jQuery(this).addClass('clicked'); 88 } 89 }); 90 91 jQuery('.menu-item-has-children').each( function() { 92 jQuery(this).find('a').first().on('click', function(e) { 93 if(jQuery(this).parent('li').hasClass('clicked')) { 94 // do nothing 95 } else { 96 e.preventDefault(); 97 } 98 }); 99 }); 100 101 jQuery('.sub-menu li').on('click', function(e) { 102 e.stopPropagation(); 103 }); 104 105 jQuery('header.site-header #site-branding .menu-primary-nav-container ul#menu-primary-nav li.login').on('click', function() { 106 tracking_click('Login Header Clicked', { 107 category: 'Header', 108 label: 'Login', 109 source_brand: 'ProLogistix', 110 }); 111 /* 112 let analytic_4 = { 'Actions Google Analytic 4': { 'client_id': gaGlobal.vid } }; 113 window.analytics.track('Login Header Clicked', { 114 category: 'Header', 115 label: 'Login', 116 source_brand: 'ProLogistix', 117 }, 118 { integrations: analytic_4 }, 119 ); 120 */ 121 }); 122 123 jQuery('header.site-header #site-branding .menu-primary-nav-container ul#menu-primary-nav li.apply-now').on('click', function() { 124 tracking_click('Apply Now Header Clicked', { 125 category: 'Header', 126 label: 'Login', 127 source_brand: 'ProLogistix', 128 }); 129 /* 130 let analytic_4 = { 'Actions Google Analytic 4': { 'client_id': gaGlobal.vid } }; 131 window.analytics.track('Apply Now Header Clicked', { 132 category: 'Header', 133 label: 'Login', 134 source_brand: 'ProLogistix', 135 }, 136 { integrations: analytic_4 }, 137 ); 138 */ 139 }); 140 141 jQuery('#popmake-3899 button.pum-close').on('click', function() { 142 jQuery('header.site-header').animate({'padding-top':0}, 200); 143 jQuery('#popmake-3899').addClass('shrink'); 144 }); 145 146 jQuery('#popmake-123 button.pum-close').on('click', function() { 147 jQuery('footer.site-footer').animate({'padding-bottom':0}, 200); 148 }); 149 150}); 151 152jQuery(window).on('scroll', function() { 153 var scroll = jQuery(window).scrollTop(); 154 // Scroll > 30 is for when there is no notification banner 155 if(scroll > 84) { 156 jQuery('header.site-header').addClass('shrink'); 157 jQuery('#popmake-3899').addClass('shrink'); 158 } else { 159 if(jQuery('header.site-header').hasClass('shrink')) { 160 jQuery('header.site-header').removeClass('shrink'); 161 jQuery('#popmake-3899').removeClass('shrink'); 162 } 163 } 164}); 165 166jQuery(window).on('resize', function() { 167 // Offset top of page-banner to height of header 168 var headerHeight = jQuery('header.site-header').height(); 169 var popupHeight = jQuery('#popmake-3899').height(); 170 var mainOffset = Math.floor(headerHeight + popupHeight); 171 jQuery('main').css('margin-top', mainOffset); 172 173 //Offset top of header by height of admin bar 174 if(jQuery('body').hasClass('admin-bar')) { 175 var adminBarHeight = jQuery('#wpadminbar').height(); 176 jQuery('header.site-header').css('top', adminBarHeight); 177 } 178 179 // Offset top of header by height of popup 180 var popupHeight = jQuery('#popmake-3899').outerHeight(); 181 jQuery('header.site-header').css('padding-top', popupHeight); 182 183 // Offset footer padding bottom by height of Cookies banner 184 var cookieBannerHeight = jQuery('#popmake-123').outerHeight(); 185 if(cookieBannerHeight > 0) { 186 jQuery('footer').css('padding-bottom', cookieBannerHeight); 187 } 188 189 var windowWidth = jQuery(window).width(); 190 if(windowWidth <= 1522) { 191 jQuery('.site-header').addClass('mobile'); 192 } else { 193 jQuery('.site-header').removeClass('mobile'); 194 } 195}); 196 197function setSegmentData() { 198 let url = window.location.href; 199 if(url.includes('?')) { 200 // let analytic_4 = { 'Actions Google Analytic 4': { 'client_id': gaGlobal.vid } }; 201 const queryString = window.location.search;
202 const urlParams = new URLSearchParams(queryString); 203 var searchCity = urlParams.get('_city'); 204 var searchState = urlParams.get('_state'); 205 var searchTitle = urlParams.get('_title'); 206 207 let searchParams = { 208 category: 'Job Posting', 209 label: 'Job Searched', 210 source_brand: 'ProLogistix', 211 }; 212 if ( searchCity ) searchParams.city = searchCity; 213 if ( searchState ) searchParams.state = searchState; 214 if ( searchTitle ) searchParams.job_title = searchTitle; 215 tracking_click( 'Search Jobs Clicked', searchParams ); 216 // window.analytics.track( 'Search Jobs Clicked', searchParams, { integrations: analytic_4 }); 217 } 218} 219 220function getCookie(name) { 221 // Split cookie string and get all individual name=value pairs in an array 222 var cookieArr = document.cookie.split(";"); 223 224 // Loop through the array elements 225 for(var i = 0; i < cookieArr.length; i++) { 226 var cookiePair = cookieArr[i].split("="); 227 228 /* Removing whitespace at the beginning of the cookie name 229 and compare it with the given string */ 230 if(name == cookiePair[0].trim()) { 231 // Decode the cookie value and return 232 return decodeURIComponent(cookiePair[1]); 233 } 234 } 235 236 // Return null if not found 237 return null; 238} 239 240 241/** 242 * apply.prologistix link behavior: 243 * 244 * - On session creation, check href for any of the target parameters and add 245 * them to the session. 246 * - On clicking an applicable link, set any explicit target parameters in the 247 * link as the user's session parameters, then build the link href's parameters 248 * out of the session parameters and redirect the user. 249 */ 250 251jQuery(document).ready( function() { 252 initApplySession(); // initialize apply parameters in session 253}); 254document.addEventListener('facetwp-loaded', function() { initApplySession(); }); 255 256function initApplySession() 257{ 258 let utm_source = 'www.prologistix.com'; 259 if ( ! sessionStorage.getItem( 'utm_source' ) ) 260 { 261 sessionStorage.setItem( 'utm_source', 'prologistix.com' ); 262 //sessionStorage.setItem( 'utm_referrer', Document.referrer ); 263 sessionStorage.setItem( 'utm_medium', null ); 264 sessionStorage.setItem( 'utm_campaign', null ); 265 sessionStorage.setItem( 'agency', null ); 266 } 267 268 // Since this item sometimes takes longer to be added or only appears after 269 // an action, set it every time. 270 sessionStorage.setItem( 'anonymousID', getCookie( 'ajs_anonymous_id' ) ); 271 272 // If the current URL has parameters, override the session data. 273 let params = new URL( window.location ).searchParams; 274 275 if ( params.has( 'utm_source' ) ) 276 sessionStorage.setItem( 'utm_source', params.get( 'utm_source' ) ); 277 if ( params.has( 'utm_medium' ) ) 278 sessionStorage.setItem( 'utm_medium', params.get( 'utm_medium' ) ); 279 if ( params.has( 'utm_campaign' ) ) 280 sessionStorage.setItem( 'utm_campaign', params.get( 'utm_campaign' ) ); 281 if ( params.has( 'agency' ) ) 282 sessionStorage.setItem( 'agency', params.get( 'agency' ) ); 283// if ( Document.referrer === undefined ) 284// sessionStorage.setItem( 'utm_referrer', null ); 285} 286 287// TODO: For efficiency, make this apply to a classed link instead. 288jQuery(document).on( 'click', 'a', function(e) 289 { 290 let link = jQuery(this); 291 let regex_url = 'apply\.prologistix'; 292 let link_href = jQuery(this).attr('href'); 293 if ( link_href && link_href.match( regex_url ) ) 294 { 295 e.preventDefault(); 296 297 let url = new URL( link_href ); 298 299 let applyParams = [ 'utm_source', 'utm_medium', 300 'utm_campaign', 'agency', 'anonymousID' ]; 301 302 // Use the link's search parameters. Process the list of expected parameters, 303 // and where any are missing, use the session data. 304 let params = url.searchParams; 305 306 applyParams.forEach( (param) => { 307 // Where the link has its own parameters, if session param is null, set it to the link value. 308 if ( params.has( param )) 309 { 310 console.log( 'param ' + param + ' found - testing for existing session data' ); 311 const sessionParam = sessionStorage.getItem( param ); 312 if ( ! sessionParam || sessionParam == 'null' ) 313 { 314 console.log( 'session value for ' + param + ' null, setting with link parameter' ); 315 sessionStorage.setItem( param, params.get( param ) ); 316 } 317 else 318 { 319 console.log( 'session value for ' + param + ' found, ignoring' ); 320 params.set( param, sessionStorage.getItem( param ) ); 321 } 322 } 323 324 // Where it does not, append the current session value for the parameter. 325 else 326 params.append( param, sessionStorage.getItem( param ) ); 327 }); 328 329 let current = new URL( window.location ).searchParams; 330 current.forEach( (value, param) => { 331 if ( ! params.has( param ) ) 332 params.append( param, value ); 333 }); 334 335 url.search = params; 336 console.log( url.toString() ); 337 338 document.location.href = url.toString(); 339 } 340 } 341); 342 343function tracking_click( title, args ) 344{ 345 gtag('get', 'G-H2KHVX0B89', 'client_id', (client_id, args) => { 346 window.analytics.track( title, args, 347 { integrations: { 'Actions Google Analytic 4': { 'client_id': client_id }}} 348 ); 349 }) 350} 351 352function search_click() 353{ 354 let url = window.location.href; 355 if(url.includes('?')) { 356 // let analytic_4 = { 'Actions Google Analytic 4': { 'client_id': gaGlobal.vid } }; 357 const queryString = window.location.search;
358 const urlParams = new URLSearchParams(queryString); 359 var searchCity = urlParams.get('_city'); 360 var searchState = urlParams.get('_state'); 361 var searchTitle = urlParams.get('_title'); 362 363 let searchParams = { 364 category: 'Job Posting', 365 label: 'Job Searched', 366 source_brand: 'ProLogistix', 367 }; 368 if ( searchCity ) searchParams.city = searchCity; 369 if ( searchState ) searchParams.state = searchState; 370 if ( searchTitle ) searchParams.job_title = searchTitle; 371 // tracking_click( 'Search Jobs Clicked', searchParams ); 372 gtag('get', 'G-H2KHVX0B89', 'client_id', (client_id, searchParams ) => { 373 window.analytics.track( title, searchParams, 374 { integrations: { 'Actions Google Analytic 4': { 'client_id': client_id }}} 375 ); 376 }) 377 // window.analytics.track( 'Search Jobs Clicked', searchParams, { integrations: analytic_4 }); 378 } 379} 380 381 382/* 383const gtClientIDPromise = new Promise(resolve => { 384 gtag('get', 'G-H2KHVX0B89', 'client_id', resolve); 385}); 386 387function test_client_id() { 388 gtClientIDPromise.then( (client_id) => { 389 console.log( client_id ); 390 }) 391} 392*/ 393
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.