PageSourceSearch

https://springfordcc.org/Site_Data/Assets/scripts

js springfordcc.org collected 2026-10-08 07:45:37 UTC 13,115 bytes, 373 lines download raw bytes

1$(document).ready(function() {
2    //transparent header
3        const iframe = document.getElementById("module");
4      if (iframe) {
5        const body = document.getElementsByTagName("body")[0];
6        body.classList.add("module-page");
7      }
8        var $header = $('header');
9        var $pageContent = $('.page-content');
10        var $body = $('body');
11        var $videoWidget = $pageContent.find('section.video-widget');
12        var $heroTextWidget = $pageContent.find('section.cho-hero-textwidget');
13      
14        if ($videoWidget.length === 0 && $heroTextWidget.length === 0) {
15          $header.addClass('no-banner');
16        }
17        if ($header.hasClass('no-banner')) {
18          $body.addClass('module-page');
19        }else return 
20    
21  
22
23        
24});
25
26$(document).ready(function() {
27  setTimeout(function() {
28    $('div.videocontent').each(function() {
29      var videoId = $(this).find('iframe').attr('src').match(/embed\/([\w-]+)/)[1];
30      $(this).html('<div class="video-banner-new" style="position: relative; box-sizing: border-box; width: 100%; padding-left: 0; padding-right: 0;">\n' +
31        '  <div class="video-container" style="position: relative; padding-bottom: 60%; height: 0; overflow: hidden;">\n' +
32        '    <iframe class="inner" allowfullscreen="1"\n' +
33        '      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"\n' +
34        '      title="Website Banner Video"\n' +
35        '      src="https://www.youtube-nocookie.com/embed/' + videoId +
36               '?playlist=' + videoId +
37               '&amp;iv_load_policy=3' +
38               '&amp;enablejsapi=1' +
39               '&amp;disablekb=1' +
40               '&amp;autoplay=1' +
41               '&amp;controls=0' +
42               '&amp;showinfo=0' +
43               '&amp;rel=0' +
44               '&amp;loop=1' +
45               '&amp;mute=1' +
46               '&start=0' + // adjusts start time, change to 0 in future
47               '&amp;wmode=transparent&amp;widgetid=1"\n' +
48        '      allowfullscreen="" class="intrinsic-ignore"\n' +
49        '      style="opacity: 1; visibility: visible; width: 150%; height: 100%; max-height: none; max-width: none; position: absolute; top: 0px; left: 50%; transform: translateX(-50%);  display: block;"\n' +
50        '      id="iframeVideo" data-gtm-yt-inspected-4="true" title="Youtube Banner" width="100%" height="100%"></iframe>\n' +
51        '  </div>\n' +
52        '</div>');
53    });
54     }, 100);
55    //footer 
56  const $target = $('footer .basic-text-area div[id*="divCol4"]');
57
58  // remove any existing instances first (no matter how they got there)
59  $target.find('.header-social').remove();
60
61  // append a single fresh clone
62  const $clone = $('header .header-social').first().clone();
63  $target.append($clone);
64
65
66 
67});
68
69//fixes chevron
70$('.cho-hero-textwidget[id*="RotatingImageBanner"] .scroll-chevron[id*="scrolldown"]')
71  .insertAfter('.cho-hero-textwidget[id*="RotatingImageBanner"] button.slick-pause');
72  
73//adds alt text to each image for slider 
74$('.ts-img-slider.show-alt img').each(function() {
75  let $img = $(this);
76  let altText = $img.attr('alt');
77
78  if (altText) {
79    // Create the wrapper div and h4 element
80    let $wrapper = $('<div class="img-slide"></div>');
81    let $heading = $('<h4></h4>').text(altText);
82
83    // Insert wrapper before the image, then move image and heading inside it
84    $img.before($wrapper);
85    $wrapper.append($img).append($heading);
86  }
87});
88
89//adds slider to the testimonials
90$('body:not(.EditMode) .testimonial-slider').wrapAll('<div class="slider-container"/>'); 
91$('.slider-container').slick({
92    speed: 300,
93  slidesToShow: 1,
94  slidesToScroll: 1,
95  dots: true,
96    arrows:false,
97  infinite: true,
98    fade:true,
99  cssEase: 'linear',
100  adaptiveHeight: true
101});
102//ts-img-slider
103$('.ts-img-slider .col-sm:has(.img-slide:nth-of-type(2), img:nth-of-type(2))').slick({
104  slidesToShow: 1,
105   slidesToScroll: 1,
106   arrows: true,
107   dots:true,
108   adaptiveHeight:true,
109 
110 });
111//adds slider to .showcase-gallery 
112
113$('.showcase-gallery .my-gallery').slick({
114  centerMode: true,
115  centerPadding: '100px',
116  arrows: false,
117  dots: true,
118  slidesToShow: 3,
119  responsive: [
120    {
121      breakpoint: 768,
122      settings: {
123        arrows: false,
124        centerMode: true,
125        centerPadding: '40px',
126        slidesToShow: 3
127      }
128    },
129    {
130      breakpoint: 480,
131      settings: {
132        arrows: false,
133        centerMode: true,
134        centerPadding: '40px',
135        slidesToShow: 1
136      }
137    }
138  ]
139});
140
141//biz form remove colon if there is a question
142let labelCheck = document.querySelectorAll(".widget-bizform label");
143let labelTitle = document.querySelectorAll(".widget-bizform .remove-colon span");
144
145labelCheck.forEach(function(label) {
146  // Check if the label's inner text contains a colon followed by a question mark
147  if (label.innerText.includes('?:')) {
148    // Replace the colon before the question mark with just the question mark
149    label.innerText = label.innerText.replace('?:', '?');
150  }
151});
152
153/*takes text are content and places it before form*/
154$('.append-to-form .row').insertAfter('.widget-bizform h2[id*="headTitle"]');
155
156/*---------------------contact cards fix mobile------*/
157$(' .contact-card-widget.card-view .fa-mobile').addClass('visible-sm')
158
159$(' .contact-card-widget.card-view a:has(.fa-mobile) span[id*="cardSpanMobile"]').addClass('hidden-sm') 
160
161//custom class fade-light and fade-dark
162
163$('.fade-light .inner-wrap').append('<div class="faded-block" />');
164$('.fade-dark .inner-wrap').append('<div class="faded-block" />');
165
166//quick links menu adding icons- creates classes that associate with CSS
167$( "section.content-quicklink-menu ul.content-quicklink-menu-list li a"
168    ).each(function () {
169        var text = $(this).text().trim().toLowerCase();
170        var className = text.replace(/\s+/g, "-");
171        $(this).addClass(className);
172    });
173//quick links menu adding icons to icon-ql - creates classes that associate with CSS
174$( "section.icon-ql a h3").each(function () {
175        var text = $(this).text().trim().toLowerCase();
176        var className = text.replace(/\s+/g, "-");
177        $(this).addClass(className);
178    });
179    //events 
180//adding default image to upcoming events and remove inline sizes
181$('.upcoming-event-wrapper img').each( function(e){
182  const checkValue = $(this).attr('src');
183  $(this).attr('style','');
184if(checkValue === ''){
185  $(this).attr('src', '/getmedia/7e2ad5c7-abb1-48d1-aaad-4ef8433d6fc6/SpringFordLogo_FC_RBG.aspx')
186}else{return}
187});
188
189
190
191///--------------add custom pagination for gallery-------//
192if ($('.modal-gallery-widget.custom-gallery-pagination').length) {
193  const pageSize = 4; // How many items per page
194  
195  $(function () {
196      $('.custom-gallery-pagination').each(function (index) {
197          const $galleryContainer = $(this);
198          const $mainElement = $galleryContainer.find('.modal-gallery-widget-wrapper');
199          const $childElements = $galleryContainer.find('.my-gallery a');
200          const totalPages = Math.ceil($childElements.length / pageSize);
201  
202          // Unique IDs per gallery instance
203          const paginationId = 'navPagination-' + index;
204          const prevId = 'prev-' + index;
205          const nextId = 'next-' + index;
206  
207          // Add pagination nav after main element
208          $mainElement.after(`
209              <div class="row">
210                  <div class="col-sm-12">
211                      <nav class="pg-nav" aria-label="Page navigation">
212                          <span class="page-item">
213                              <a class="pre page-link" id="${prevId}" href="javascript:void(0)" aria-label="Previous" disabled>
214                                  <span aria-hidden="true">«</span><span class="sr-only">Previous</span>
215                              </a>
216                          </span>
217                          <ul id="${paginationId}" class="navPagination"></ul>
218                          <span class="page-item">
219                              <a class="nex page-link" id="${nextId}" href="javascript:void(0)" aria-label="Next">
220                                  <span aria-hidden="true">»</span><span class="sr-only">Next</span>
221                              </a>
222                          </span>
223                      </nav>
224                  </div>
225              </div>
226          `);
227  
228          const $pagination = $('#' + paginationId);
229          const $prev = $('#' + prevId);
230          const $next = $('#' + nextId);
231  
232          // Create pagination buttons
233          for (let i = 0; i < totalPages; i++) {
234              $pagination.append(`
235                  <li class="page-item ${i === 0 ? 'active' : ''}">
236                      <a class="page-link" href="javascript:void(0)">${i + 1}</a>
237                  </li>
238              `);
239          }
240  
241          // Show the first page
242          const showPage = (page) => {
243              $childElements.addClass('pag-dis');
244              $childElements.each(function (n) {
245                  if (n >= pageSize * (page - 1) && n < pageSize * page) {
246                      $(this).removeClass('pag-dis');
247                  }
248              });
249  
250              // Update nav state
251              $pagination.find('li').removeClass('active');
252              $pagination.find('li').eq(page - 1).addClass('active');
253  
254              if (page === 1) {
255                  $prev.addClass('pag-disable');
256                  $next.removeClass('pag-disable');
257              } else if (page === totalPages) {
258                  $next.addClass('pag-disable');
259                  $prev.removeClass('pag-disable');
260              } else {
261                  $prev.removeClass('pag-disable');
262                  $next.removeClass('pag-disable');
263              }
264          };
265  
266          // Initial page load
267          showPage(1);
268  
269          // Pagination click
270          $pagination.on('click', 'li', function () {
271              const page = parseInt($(this).text());
272              showPage(page);
273          });
274  
275          // Next
276          $next.on('click', function () {
277              const current = $pagination.find('li.active').index();
278              if (current + 1 < totalPages) {
279                  showPage(current + 2);
280              }
281          });
282  
283          // Previous
284          $prev.on('click', function () {
285              const current = $pagination.find('li.active').index();
286              if (current > 0) {
287                  showPage(current);
288              }
289          });
290      });
291  });
292  }
293 $('.widget-scorecard-details-description').each(function() {
294        const $desc = $(this);
295
296        // Loop through all child nodes
297        $desc.contents().each(function() {
298            // Only wrap text nodes
299            if (this.nodeType === Node.TEXT_NODE && this.textContent.trim() !== '') {
300                $(this).wrap('<span class="description-inner"></span>');
301            }
302        });
303    });
304  function unhideMatchingScorecard() {
305    $('.course-tour .hole.active-tab').each(function() {
306        const tabNumber = $(this).data('tab'); // get the number from the active hole
307        $('.course-tour .widget-scorecard-details-wrapper.active-tab.hidden')
308            .filter(`[data-tab="${tabNumber}"]`) // match the same data-tab
309            .first() // only affect the first if multiple
310            .removeClass('hidden'); 
311    });
312}
313
314// Run on page load
315$(document).ready(function() {
316    unhideMatchingScorecard();
317
318    $('.course-tour .widget-scorecard-tab .tab').on('click', function() {
319        setTimeout(unhideMatchingScorecard, 10); // short delay to let tab switching finish
320    });
321});
322
323$(document).ready(function () {
324  //adjusted background color depending if there is more then 1
325    const sections = $('.bg-grey');
326
327    sections.each(function () {
328        const current = $(this);
329        const next = current.next('.bg-grey');
330
331        // If another bg-grey follows, remove gradient from this one
332        if (next.length) {
333            current.addClass('bg-grey--solid');
334        }
335    });
336
337    //open-new-tab custom class 
338    const links = $('.gallerylist-widget.open-new-tab a');
339
340    links.each(function () {
341        const link = $(this);
342        link.attr('target', '_blank');
343        link.attr('rel', 'noopener noreferrer');
344    });
345});
346//Custom class gallery-slider 
347setTimeout(() => {
348$('.gallery-slider .my-gallery').slick({ 
349  autoplay: true,
350  autoplaySpeed: 5000,
351  slidesToShow: 4,
352  slidesToScroll: 4,
353  arrows: false,
354  dots:true,
355  responsive: [
356  {
357    breakpoint: 768,
358    settings: {
359      slidesToShow: 2,
360      slidesToScroll: 2,
361    }
362  },
363  {
364    breakpoint: 480,
365    settings: {
366     
367      slidesToShow: 1,
368      slidesToScroll: 1,
369    }
370  }
371]
372})
373}, 500);

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.