PageSourceSearch

https://outdoorprolink.com/assets/js/script.js

js outdoorprolink.com collected 2026-10-03 21:45:09 UTC 15,032 bytes, 307 lines download raw bytes

1//Global variable
2var configURL = window.location.origin + "/config.json";
3var hostName, ca_hostName, pursuit_hostName,us_publicsite_hostname,ca_publicsite_hostname, jobCategoryListFile, staticIconDocType1, staticIconDocType2, staticIconDocType3, staticIconDocType4
4    , googleAnalyticsid, googleAnalytics4id, slideshowSpeedForSlider, ZenDeskSupportUserName, ZenDeskSupportAPIToken, ZendeskSupportLink, CompanyNameMinLength = '', ElmahApiKey, ElmahLogId
5    , TurnstileSiteKey, RequiredTurnstileCaptchaOnContactForm, RequiredTurnstileCaptchaOnSigupForm
6    ,IDmeScope, IDmeClientID;
7var storedFiles = [];
8    $.ajaxSetup({
9       async: false
10    })
11$.getJSON(configURL, function (config) {
12      hostName = config.hostName;
13      ca_hostName = config.ca_hostName;
14      pursuit_hostName=config.pursuit_hostName;
15      us_publicsite_hostname = config.us_publicsite_hostname;
16      ca_publicsite_hostname = config.ca_publicsite_hostname;
17      jobCategoryListFile = config.jobCategoryListFile;
18      staticIconDocType1 = config.staticIconDocType1;
19      staticIconDocType2 = config.staticIconDocType2;
20      staticIconDocType3 = config.staticIconDocType3;
21      staticIconDocType4 =config.staticIconDocType4;
22      googleAnalyticsid = config.gaid;
23      googleAnalytics4id = config.ga4id;
24      slideshowSpeedForSlider = config.slideshowSpeedForSlider;
25      ZenDeskSupportUserName=config.ZenDeskSupportUserName;
26      ZenDeskSupportAPIToken=config.ZenDeskSupportAPIToken;
27      ZendeskSupportLink = config.ZendeskSupportLink;
28      CompanyNameMinLength = config.CompanyNameMinLength;
29      ElmahApiKey = config.ElmahApiKey;
30      ElmahLogId = config.ElmahLogId;
31      TurnstileSiteKey = config.TurnstileSiteKey;
32      RequiredTurnstileCaptchaOnSigupForm = config.RequiredTurnstileCaptchaOnSigupForm;
33      RequiredTurnstileCaptchaOnContactForm = config.RequiredTurnstileCaptchaOnContactForm;
34      IDmeClientID = config.IDmeClientID;
35      IDmeScope = config.IDmeScope;
36});
37$.ajaxSetup({
38   async: true
39})
40// // custom dropdown
41// function DropDown(el) {
42//    this.dd = el;
43//    this.placeholder = this.dd.children('span');
44//    this.opts = this.dd.find('ul > li');
45//    this.val = '';
46//    this.index = -1;
47//    this.initEvents();
48// }
49// DropDown.prototype = {
50//    initEvents: function () {
51//       var obj = this;
52
53//       obj.dd.on('click', function (event) {
54//          $(this).toggleClass('active');
55//          return false;
56//       });
57//       obj.opts.on('click', function () {
58//          var opt = $(this);
59//          $('.dpdn ul > li a').removeClass('selected');
60//          $(this).find('a').addClass('selected');
61//          obj.val = opt.text();
62//          obj.index = opt.index();
63//          obj.placeholder.text(obj.val);
64//       });
65//    }
66// }
67
68$(function () {
69   // $(document).click(function () {
70   //    $('.dpdn').removeClass('active');
71   // });
72
73   /*Tooltip script */
74   setTimeout(function () {
75      $('[data-toggle="tooltip"]').tooltip()
76   }, 200);
77
78   //Adding dynamic hostname based in the config value
79   $('.add-hostname').each(function( index ) {
80      var href = $(this).attr('href');
81     $(this).attr('href',hostName+href)
82   });
83
84   /*SignUp Complate Application button enable and disable */
85   $('#SignUpForm input,#SignUpForm textarea').bind('keyup change focusout', function () { // fires on every keyup & focusout
86      var approvalcode = '';
87      approvalcode = $("#PromotionCode").val().trim();
88      if ($('#SignUpForm').validate().checkForm() && ((storedFiles.length > 0 && $('input[name="fileUpload"]').is(':visible')) 
89         || ((approvalcode != '' && $("#PromotionCode").is(':visible') && $("#PromotionCode").hasClass('is-valid')) || !$("#PromotionCode").is(':visible')))) {                   // checks form for validity
90          $('#complete-signup').removeClass('disabled').attr('disabled', false); // enables button
91      } else {
92          $('#complete-signup').addClass('disabled').attr('disabled', true);   // disables button
93      }
94      setTimeout(function(){
95      var $inputs = $('#SignUpForm :input[required="required"]');
96        var empty = $inputs
97				.filter(function () { return $(this).is(':visible') && ($(this).hasClass('is-invalid') || this.value.trim() === "") })
98				.length > 0; 
99        if(empty){
100            $('#complete-signup').addClass('disabled').attr("disabled",true);
101        }else{
102            if($('#SignUpForm input:visible').hasClass('is-invalid')){
103               $('#complete-signup').addClass('disabled').attr("disabled",true);
104         }else{
105               if((storedFiles.length == 0 && $('input[name="fileUpload"]').is(':visible')) || (($("#PromotionCode").is(':visible')  && storedFiles.length == 0 && (approvalcode == '' || $("#PromotionCode").hasClass('is-invalid'))))){
106                  $('#complete-signup').addClass('disabled').attr("disabled",true);
107               }else{
108                  $('#complete-signup').removeClass('disabled').attr("disabled",false);
109               }
110         }
111        }
112      },200);
113   });
114
115   $('select.form-control').on('change',function () {
116      if($(this).val() == ''){
117         $(this).removeClass('is-valid').addClass('is-invalid'); // enables Application section when select the Job category
118        $(this).parent().find('.form-validation-message').removeClass('field-validation-valid').addClass('field-validation-error').empty().html('<span id="'+$(this).attr('id')+'-error" class="is-invalid">'+$(this).attr('data-val-required')+'</span>')
119      }else{
120         $(this).removeClass('is-invalid').addClass('is-valid');
121         $(this).parent().find('.form-validation-message').empty();
122      }
123      if($(this).hasClass('opl-adm-company-name-list')){
124         if($('.opl-adm-company-name-list').val()  != ''){
125            $('#CompanyName').val($('.opl-adm-company-name-list').val());
126         }else{
127            $('#CompanyName').val("");
128         }
129         if($('#CompanyName').val()  != ''){
130            $('.opl-adm-company-name-list').val($('#CompanyName').val());
131         }else{
132            $('.opl-adm-company-name-list').val("");
133         }
134      }
135      var approvalcode = '';
136      approvalcode = $("#PromotionCode").val().trim();
137      if ($('#SignUpForm').validate().checkForm() && ((storedFiles.length > 0 && $('input[name="fileUpload"]').is(':visible')) 
138         || ((approvalcode != '' && $("#PromotionCode").is(':visible') && $("#PromotionCode").hasClass('is-valid')) || !$("#PromotionCode").is(':visible')))) {                   // checks form for validity
139         $('#complete-signup').removeClass('disabled').attr('disabled', false); // enables button
140     } else {
141         $('#complete-signup').addClass('disabled').attr('disabled', true);   // disables button
142     }
143   });
144
145   /*Display the signup form based on jobcategory selection */
146   $('.opl-job-category-list').on('change',function () {
147    var searchParams = new URLSearchParams(window.location.search);
148      if($(this).val() != ''){
149         if($(".opl-public-apply-for-section").is(':visible'))
150            $('.opl-public-application-form-section').removeClass('signup-form-disabled'); // enables Application section when select the Job category
151         var Selectedcatvalue = $(this).val();
152         $('.opl-public-selected-categoty-name').empty().html(Selectedcatvalue);
153         var SelectedJobCatId = $('.opl-job-category-list > option:selected').attr('data-value');
154         UpdateRequiredDocSteps(SelectedJobCatId);
155         searchParams.set('JobCategory',Selectedcatvalue.trim());
156      }else{
157         $('.opl-public-application-form-section').addClass('signup-form-disabled'); // disable Application section when Job category not selected
158         searchParams.delete('JobCategory');
159      }
160      if($(this).val() == 'Active Duty Military'){ 
161         $('#CompanyName').hide();
162         $('#CompanyName').val(""); 
163         $('.opl-adm-company-name-list').val("");
164         $('.opl-adm-company-name-list').removeClass('d-none is-valid is-invalid');
165         $('.company-name .form-validation-message').html('');
166      }else{
167         $('#CompanyName').show().removeClass('is-valid is-invalid');
168         $('#CompanyName').val(""); 
169         $('.opl-adm-company-name-list').val("");         
170         $('.opl-adm-company-name-list').addClass('d-none');
171         $('.company-name .form-validation-message').html('');
172      }
173
174      var approvalcode = '';
175      approvalcode = $("#PromotionCode").val().trim();
176      if ($('#SignUpForm').validate().checkForm() && ((storedFiles.length > 0 && $('input[name="fileUpload"]').is(':visible')) 
177         || ((approvalcode != '' && $("#PromotionCode").is(':visible') && $("#PromotionCode").hasClass('is-valid')) || !$("#PromotionCode").is(':visible')))
177) {                   // checks form for validity
178         $('#complete-signup').removeClass('disabled').attr('disabled', false); // enables button
179     } else {
180         $('#complete-signup').addClass('disabled').attr('disabled', true);   // disables button
181     }
182      //if (history.pushState) {
183           var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + (searchParams.toString() !='' ? "?"+ searchParams.toString() : "");
184           window.history.pushState({path:newurl},'',newurl);
185       //}
186
187       /*IDme Data set from config*/
188       if($(this).find(':selected').attr("data-IDmeScope").length > 0){
189           $(".opl-idme-container,.opl-seprater-or").removeClass("d-none"); 
190           var SelectedJobCatId = $('.opl-job-category-list > option:selected').attr('data-value');
191           DiplaydynamicIDmeText(SelectedJobCatId);
192           UpdateIDmeLink($(this).find(':selected').attr("data-IDmeScope"),$(this).find(':selected').attr("data-store"),false);
193       }else{
194          $(".opl-idme-container,.opl-seprater-or").addClass("d-none");
195       }
196   });
197
198   /*let's partner form validation button enable and disable */
199   $('#BrandSignUpForm input,#BrandSignUpForm textarea').bind('keyup change focusout', function () { // fires on every keyup & focusout
200      if ($('#BrandSignUpForm').validate().checkForm()) {                   // checks form for validity
201          $('#complete-brandsignup').removeClass('disabled').attr('disabled', false); // enables button
202      } else {
203          $('#complete-brandsignup').addClass('disabled').attr('disabled', true);   // disables button
204      }
205   });
206
207   /*Help form validation  button enable and disable */
208   $('#HelpForm input,#HelpForm textarea').bind('keyup change focusout', function () { // fires on every keyup & focusout
209       if ($('#HelpForm').validate().checkForm() && $("#txtuploadedMsgAdd").text() == "") {                   // checks form for validity
210          $('#complete-help').removeClass('disabled').attr('disabled', false); // enables button
211      } else {
212          $('#complete-help').addClass('disabled').attr('disabled', true);   // disables button
213      }
214   });
215
216   /*IDme Button is loading for first time*/
217    /*IDme Data set from config*/
218   var verifywithidme = '<span id="idme-wallet-button" data-scope="'+IDmeScope+'" data-client-id="'+IDmeClientID+'" data-redirect="'+hostName+"/Account/IDmeVerify"+'" data-response="code"></span>';
219   $('.opl-idme-button').html(verifywithidme);
220   // Trigger the ID.me script to load the button 
221   $.getScript('https://s3.amazonaws.com/idme/developer/idme-buttons/assets/js/idme-wallet-button.js')
222   .done(function () {
223      if (window.BindIDme != 'undefined') {
224         // Reinitialize the widget (if applicable)
225         window.BindIDme() // This may vary based on the script's documentation
226         UpdateIDmeLink($('.opl-job-category-list').find(':selected').attr("data-IDmeScope"),$('.opl-job-category-list').find(':selected').attr("data-store"),true);
227      } else {
228            console.error('ID.me script is not loaded or initialized');
229      } 
230   }).fail(function (jqxhr, settings, exception) {
231      console.error('Failed to load the IDme script:', exception);
232   });
233});
234function UpdateIDmeLink(SelectedIDmeScope,StoreID,onload){
235   var IDmeURL = $('.opl-idme-button a').attr('href');
236   var currenturl = window.location.href;
237   var queryString = currenturl ? currenturl.split('?')[1] : window.location.search.slice(1);
238
239   //update Scope on the URL
240   var newIDmeURL = updateQueryParam(IDmeURL, (IDmeScope.split(",").length > 1 ? "scopes" : "scope"), (SelectedIDmeScope != undefined ? SelectedIDmeScope : IDmeScope));
241   var IDmeredirectURL = (StoreID == 4 ? pursuit_hostName : hostName) +'/Account/IDmeVerify';//+ (queryString !== undefined ? "?" + queryString : "");
242   newIDmeURL = updateQueryParam(newIDmeURL, "redirect_uri", IDmeredirectURL);
243   $('.opl-idme-button a').attr('href',decodeURIComponent(newIDmeURL));
244   //banner IDme URL rendering
245   if(onload){
246         var BannerIDmeURL = updateQueryParam(IDmeURL, (IDmeScope.split(",").length > 1 ? "scopes" : "scope"),  IDmeScope);
247         BannerIDmeURL = updateQueryParam(BannerIDmeURL, "redirect_uri",  hostName +'/Account/IDmeVerify');//+ (queryString !== undefined ? "?" + queryString : ""));
248         $('.idme-banner-btn').attr('href',decodeURIComponent(BannerIDmeURL));
249   }
250}
251
252function DiplaydynamicIDmeText(JobCatId) {
253    var SelectCatValues = $.map(JsonData[JobCatId], function (value, index) {
254        return [value];
255    });
256    $('.idme-dynamic-subtitle').empty().html(SelectCatValues[8])
257    $('.idme-dynamic-description').empty().html(SelectCatValues[9]);
258
259}
260
261function updateQueryParam(url, param, value) {
262   if (!url || typeof url !== "string") {
263      return "";
264  }
265  try {
266      let newUrl = new URL(url);
267      newUrl.searchParams.set(param, value);
268      return newUrl.toString();
269   } catch (error) {
270      console.error("Error creating URL object:", error.message);
271      return "";
272   }
273}
274
275/*Get only the UTM params from query string */
276function getUTMParams() {
277	//const queryParams = new URLSearchParams(window.location.search);
278	const utmParams = window.location.search;//{};
279
280	// for (const [key, value] of queryParams.entries()) {
281	// 	if (key.toLowerCase().startsWith("utm_")) {
282	// 		utmParams[key] = value;
283	// 	}
284	// }
285	return utmParams;
286}
287
288/*Convert UTM to QueryString */
289function getUTMQueryString() {
290	return getUTMParams();
291   // const utms = getUTMParams();
292	// return Object.entries(utms)
293	// 	.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
294	// 	.join("&");
295}
296
297/* Get Cookies */
298function getCookiesWithdecodeURIComponent(name) {
299	const cookies = document.cookie.split(';');
300	for (let cookie of cookies) {
301		const [key, value] = cookie.trim().split('=');
302		if (key === name) {
303			return decodeURIComponent(value);
304		}
305	}
306	return null;
307}

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.