PageSourceSearch

https://ncrconline.com/wp-content/themes/generatepress-child/js/custom.js?1790918377&ver=1.2

js ncrconline.com collected 2026-10-02 05:20:28 UTC 9,878 bytes, 399 lines download raw bytes

1jQuery(document).ready(function ($) {
2
3     
4  $(".jump a").on("click", function (e) {
5
6    e.preventDefault();
7
8    $("html, body").animate({ scrollTop: $("#jumphere").offset().top-100 }, "fast");
9
10});
11
12  // This activates the sticky nav on scroll
13  $(window).scroll(function () {
14    var scroll = $(window).scrollTop();
15
16    if (scroll >= 100) {
17      $("#masthead").addClass("pgp-sticky-nav");
18    } else {
19      $("#masthead").removeClass("pgp-sticky-nav");
20    }
21  });
22  // This is for adding an overlay to all page titles with bacground images
23  $("<div class='pgp-overlay'></div>").insertBefore(".pgp-page-title-row>div");
24  // anchor link offset and smooth scroll
25  $('a[href*="#"]:not(.vc_tta-panel-heading a').click(function () {
26    var offset = -200; // <-- change the value here
27    if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && location.hostname == this.hostname) {
28      var target = $(this.hash);
29      target = target.length ? target : $("[name=" + this.hash.slice(1) + "]");
30      if (target.length) {
31        $("html, body").animate(
32          {
33            scrollTop: target.offset().top + offset,
34          },
35          1000
36        );
37        return false;
38      }
39    }
40  });
41
42  if ($(".single-coach").length) { 
43
44    if ($(".biofull").find("img").length) {
45
46      $(".biotext .wpb_wrapper").prepend( '<img class="headbioimg hb" src="'+$(".biofull").find("img").attr("src")+'"/>');
47
48    }
49
50    else if ($(".featured-image").length) {
51
52      $(".biotext .wpb_wrapper").prepend( '<img class="headbioimg fi" src="'+$(".featured-image").find("img").attr("src")+'"/>');
53
54    }
55
56  }
57
58
59  
60  $(".tabs .wpb_column").eq(0).addClass("selected");
61
62  $(".tab-content .wpb_column").hide();
63  $(".tab-content .wpb_column.service-all").show();
64
65  serviceColors();
66
67  $(".tabs .wpb_column").on("click", function (e) {
68
69    e.preventDefault();
70
71    $(".tabs .wpb_column").removeClass("selected");
72    $(this).addClass("selected");
73
74    $(".tab-content .wpb_column").hide();
75
76    if ($(this).index() == 1) {
77
78      $(".tab-content .wpb_column").each(function () {
79
80        if ($(this).hasClass("service-flw")) {
81
82          $(this).show();
83
84        }
85
86      });
87
88    }
89
90    else if ($(this).index() == 2) {
91
92      $(".tab-content .wpb_column").each(function () {
93
94        if ($(this).hasClass("service-m")) {
95
96          $(this).show();
97
98        }
99
100      });
101      
102    }
103    
104    else if ($(this).index() == 0) {
105
106
107      $(".tab-content .wpb_column").each(function () {
108
109        if ($(this).hasClass("service-all")) {
110
111          $(this).show();
112
113        }
114
115      });
116      
117    }
118
119    serviceColors();
120
121  
122  });
123
124
125
126function serviceColors() {
127
128  var ti = 0;
129
130  $(".tab-content .wpb_column").each(function () {
131
132    if ($(this).css('display') === 'flex') {
133
134      $(this).attr("data-color",ti);
135    
136      if (ti == 3) {
137  
138        ti = 0;
139        
140      }
141  
142      else {
143  
144        ti++;
145  
146      }
147     
148
149    }
150  
151   
152  });
153
154}
155
156  $(".footer-name").html($("#page-name").val());
157
158
159
160  function getUrlVars()
161{
162    var vars = [], hash;
163    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
164    for(var i = 0; i < hashes.length; i++)
165    {
166        hash = hashes[i].split('=');
167        vars.push(hash[0]);
168        vars[hash[0]] = hash[1];
169    }
170    return vars;
171}
172
173if($(".icon-envelope").length > 0) {
174
175  var text = $(".icon-envelope").attr("href")
176  var result = text.slice(7); 
177
178  $(".icon-envelope").append("<span class='e-bubble'>"+result+"</span>");
179
180}
181
182$(".icon-envelope").hover(
183  function() {
184    $(this).find(".e-bubble").show();
185  }, function() {
186    $(this).find(".e-bubble").hide();
187  }
188);
189
190
191if($("#hero-img img").length > 0) {
192
193
194
195  //var bgIMG = $("#hero-img img").attr("src");
196
197  //$("#hero-img").css("background-image","url("+bgIMG+")");
198
199
200
201}
202
203if($(".ncrc-bar").length > 0) {
204
205  $(".ncrc-bar").append("<div class='rb-divider'><div class='rb-blue'></div><div class='rb-red'></div></div>");
206
207}
208
209if($(".single-case-study").length > 0) {
210
211  $( "h2" ).each(function( index ) {
212          
213    $( this ).prepend('<span class="h2-lines"></span>');
214    
215  });
216
217}
218
219
220$( ".cs-list" ).each(function( index ) {
221        
222  $( this ).find(".wpb_text_column").find(".wpb_wrapper").each(function( index ) {
223 
224     $( this ).prepend("<span class='cs-list-num'>"+(index+1)+"</span>");
225  
226  });
227
228});
229
230  if ($("body").hasClass("page-id-9327") || $("body").hasClass("page-id-8637") || $("body").hasClass("page-id-9378")) {
231
232    var ppid = getUrlVars()["ppid"];
233
234    $('[name="add-to-cart"]').val(ppid);
235
236    $("#add-another-registration").on("click", function (e) {
237   // $("#add-another-registration").on("click", function (e) {
238      e.preventDefault();
239      var lastRegistrationItem = $("#training-services-registration").children(".registration-item").last().clone();
240      var dataItemNumber = parseInt(lastRegistrationItem.attr("data-item"));
241      var newItemNumber = dataItemNumber + 1;
242      $('[name="numberOfAttendants"]').attr("value", dataItemNumber + 1);
243      $('[name="quantity"]').attr("value", dataItemNumber + 1);
244      lastRegistrationItem.attr("data-item", newItemNumber);
245      lastRegistrationItem.find(".attendee-title > span").text(newItemNumber);
246      lastRegistrationItem.find("[name]").each(function () {
247        $(this).val("");
248      });
249      $("#training-services-registration").append(lastRegistrationItem);
250    });
251
252    $("#register").on("click", function (e) {
253      e.preventDefault();
254
255      if (formValidation()) {
256        // Save form data locally
257        saveFormData();
258        // Submit form
259        $("#training-services-registration").submit();
260      }
261    });
262
263    // Remove last attendee if there are more than 1 only
264    $("#remove-registration").on("click", function (e) {
265      e.preventDefault();
266      if ($(".registration-item").length > 1) {
267        var lastRegistrationItem = $("#training-services-registration").children(".registration-item").last();
268        var dataItemNumber = parseInt(lastRegistrationItem.attr("data-item"));
269        var newItemNumber = dataItemNumber - 1;
270        $('[name="numberOfAttendants"]').attr("value", newItemNumber);
271        $('[name="quantity"]').attr("value", newItemNumber);
272        lastRegistrationItem.remove();
273      }
274    });
275
276    $("#training-services-registration").on( "click", ".rm-reg", function(e) {
277
278      e.preventDefault();
279
280      $(this).parent().remove();
281
282      if ($(".registration-item").length > 0) {
283
284        $(".registration-item").each(function (index) {
285
286          $(this).attr("data-item", index+1);
287          $(this).find(".attendee-title").text("Attendee #"+parseInt(index+1));
288
289        });
290
291        var lastRegistrationItem = $("#training-services-registration").children(".registration-item").last();
292        var dataItemNumber = parseInt(lastRegistrationItem.attr("data-item"));
293        var newItemNumber = dataItemNumber;
294        $('[name="numberOfAttendants"]').attr("value", newItemNumber);
295        $('[name="quantity"]').attr("value", newItemNumber);
296
297      }
298    
299    });
300
301    function formValidation() {
302      var inputs = [];
303      $("#training-services-registration input.required").each(function () {
304        if (!$(this).val().length > 0) {
305          $(this).next("p.required-error").addClass("show");
306          inputs.push(false);
307        } else {
308          $(this).next("p.required-error").removeClass("show");
309          inputs.push(true);
310        }
311      });
312      var checker = (arr) => arr.every((v) => v === true);
313      return checker(inputs);
314    }
315
316    // Load form data
317    function loadFormData() {
318      // For each localStorage item
319    }
320
321    function change_input_name(str) {
322      str = str.replace(/-/g, " ");
323      return str.charAt(0).toUpperCase() + str.slice(1);
324    }
325
326    // Save Form data
327    function saveFormData() {
328      var attendeesHtml = "<ul>";
329      var count = 1;
330      $("#training-services-registration > .registration-item").each(function () {
331        attendeesHtml += '<li data-attendee-count="' + count + '"><b>Attendee #<span>' + count + "</span></b>";
332        $(this)
333          .find("[name]")
334          .each(function () {
335            if ($(this).val().length > 0) {
336              var nameValue = $(this).attr("name");
337              var inputValue = $(this).val();
338              attendeesHtml += "<li data-" + nameValue + '="' + inputValue + '">';
339              attendeesHtml += change_input_name(nameValue);
340              attendeesHtml += ": " + inputValue + "</li>";
341            }
342          });
343        count += 1;
344        attendeesHtml += "</li>";
345      });
346      attendeesHtml += "</ul>";
347      console.log(attendeesHtml);
348      $.ajax({
349        type: "POST",
350        url: ajax_object.ajaxurl,
351        data: {
352          action: "custom_update_attendees",
353          data: JSON.stringify(attendeesHtml),
354        },
355        success: function (data) {
356          console.log("success");
357          console.log(data);
358        },
359        error: function (jqXHR, textStatus, errorThrown) {
360          console.log("fail");
361          console.log(jqXHR);
362          console.log(textStatus);
363          console.log(errorThrown);
364        },
365      });
366    }
367  }
368
369  //$(".testimonials").wrapInner('<div class="t-white"></div>');
370  //$(".t-white").wrapInner('<div class="t-white-inner"></div>');
371  //$(".t-white").append('<div class="t-yellow"></div>');
372  //$(".t-yellow").height($(".t-white-inner").height());
373
374
375
376  $('.t-slider .wpb_wrapper:first').addClass("t-slide");
377
378  //$(".t-slide").append('<div class="t-yellow"></div>');
379
380  $('.t-slide').slick({
381    dots: false,
382    infinite: true,
383    speed: 300,
384    slidesToShow: 1,
385    adaptiveHeight: true
386  });
387
388  $('.cs-slider').slick({
389    autoplay: true, 
390    autoplaySpeed: 4000, 
391    dots: false,
392    infinite: true,
393    speed: 300,
394    slidesToShow: 1,
395    adaptiveHeight: true
396  });
397      
398      
399});

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.