1$(document).ready(function ($) { 2 var currentPageName = window.location.href.slice(window.location.href.indexOf('?') + 1).split("/").pop(); 3 4 if (currentPageName === undefined || currentPageName === "") { 5 currentPageName = "home.aspx"; 6 } 7 8 9 //Tracks the event for when the click call button in the header is clicked. 10 $("a[href^='tel']").each(function () { 11 $(this).click(function () { 12 if (this.id != 'clickToTextHeaderEvent' && this.id != 'clickToCallHeaderEvent') { 13 trackerHook(277); 14 } 15 }); 16 }); 17 18 19 20 //Tracks the event when the get directions button is clicked. 21 $('#mobileDirectionsButtonEvent').click(function () { 22 if (currentPageName == '') { 23 currentPageName = 'Home'; 24 } 25 trackerHook(276); 26 }); 27 if (jQuery.browser.mobile) { 28 if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 29 var msViewportStyle = document.createElement("style") 30 msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")); 31 document.getElementsByTagName("head")[0].appendChild(msViewportStyle); 32 } 33 $('.carousel-inner').find('.hideOnMobile').each(function () { 34 $(this).remove(); 35 }); 36 $(".carousel-inner").find(".item:first").addClass("active"); 37 38 removeHiddenAndReindexIndicators('hideOnMobile'); 39 addSlideNumber(); 40 41 $(".carousel-indicators li:first").addClass("active"); 42 $('.tab-content').find("[id^='serviceSpecials']").each(function () { 43 $(this).removeAttr('onclick'); 44 }); 45 $('#serviceSpecialsHome').find('.serviceSpecials').each(function () { 46 $(this).removeAttr('onclick'); 47 }); 48 $('#searchRefineModal').find("[id^='collapse']").each(function () { 49 $(this).on('shown.bs.collapse', function (e) { 50 var selector = "#searchRefineModal a[href='#" + e.target.id + "']"; 51 window.location.hash = $(selector).attr('id'); 52 }); 53 }); 54 $('.srpVehicleIncentives a').each(function () { 55 $(this).unbind('click').attr("target", "_blank"); 56 }); 57 $('.srpMobileIncentives a').each(function () { 58 $(this).unbind('click').attr("target", "_blank"); 59 }); 60 $("#chatIn").find(".hideOnMobile").remove(); 61 try { 62 getMobileChatScriptsDlrOn(); 63 } catch (Exception) { 64 console.log("Error Loading Mobile Chat Scripts, Platform Mobile Function Missing"); 65 } 66 } else { 67 $('.carousel-inner').find('.hideOnDesktop').each(function () { 68 $(this).remove(); 69 }); 70 $(".carousel-inner").find(".item:first").addClass("active"); 71 72 removeHiddenAndReindexIndicators('hideOnDesktop'); 73 addSlideNumber(); 74 75 $(".carousel-indicators li:first").addClass("active"); 76 $("a[href^='tel'].phone-alert").each(function () { 77 $(this).click(function (e) { 78 e.preventDefault(); 79 var phoneNum = $(this).attr('href'); 80 alert(phoneNum.substring(4, phoneNum.length)); 81 }); 82 }); 83 $("#chatIn").find(".hideOnDesktop").remove(); 84 try { 85 getDesktopChatScriptsDlrOn(); 86 } catch (Exception) { 87 console.log("Error Loading Chat Scripts, Platform Desktop Function Missing"); 88 } 89 } 90}); 91 92function sendSms(phoneNum, link, specialName) { 93 jQuery.get('/api/lead/new', {}, function (t) { 94 sendSmsWithToken(phoneNum, link, specialName, t); 95 }, 'json'); 96} 97 98function sendSmsWithToken(phoneNum, link, specialName, t) { 99 jQuery.post('/api/lead/sms/' + t.token, { 100 "Phone": phoneNum, 101 "LeadSource": 198, 102 "LeadType": 5, 103 "MessageLink": link, 104 "Comments": "; ; Coupon: " + specialName + ";" 105 }); 106} 107 108$('#modal_submit').click(function () { 109 var phoneNum = $('#modal_phone').val(); 110 phoneNum = phoneNum.replace(/\D/gi, ''); 111 if (phoneNum.length != 10) { 112 window.alert("Invalid Phone Number"); 113 $('#modal_phone').val(''); 114 return false;
115 } else { 116 var specialName = $('#specialSendToMobileName').val(); 117 var pathname = window.location.href; 118 var homePageCheck = pathname.split('\/').pop(); 119 if (homePageCheck == "") { 120 pathname = pathname + "service-parts-specials.aspx"; 121 } 122 pathname = pathname.replace(/\#/gi, ''); 123 sendSms(phoneNum, pathname, specialName); 124 } 125}); 126 127function removeHiddenAndReindexIndicators(hiddenClass) { 128 var homepageCarousels = document.querySelectorAll(`[id^="carousel-"]`); 129 homepageCarousels.forEach((homepageCarousel => { 130 var hiddenIndicators = homepageCarousel.querySelectorAll(`.carousel-indicators .${hiddenClass}`); 131 if (hiddenIndicators.length > 0) { 132 hiddenIndicators.forEach((hiddenIndicator) => { 133 hiddenIndicator.remove(); 134 }); 135 136 //Reindex indicators 137 var slideToCounter = 0; 138 var carouselIndicators = homepageCarousel.querySelector('.carousel-indicators'); 139 var counterIndicators = carouselIndicators.querySelectorAll('li:not(.slide-indicator--basic)'); 140 counterIndicators.forEach((indicator) => { 141 var control = indicator.querySelector(':scope > button') || indicator; 142 $(control).attr("data-slide-to", slideToCounter); 143 $(control).text(slideToCounter + 1); 144 slideToCounter++; 145 }); 146 147 slideToCounter = 0; 148 var bubbleIndicators = carouselIndicators.querySelectorAll('li.slide-indicator--basic'); 149 bubbleIndicators.forEach(function (indicator) { 150 var control = indicator.querySelector(':scope > button') || indicator; 151 $(control).attr("data-slide-to", slideToCounter); 152 slideToCounter++ 153 }); 154 } 155 156 hideShowCarouselNavigation(homepageCarousel); 157 })); 158} 159 160function addSlideNumber() { 161 var carouselsElements = document.querySelectorAll('[id^="carousel"]'); 162 carouselsElements.forEach((carouselsElement) => { 163 var slides = carouselsElement.querySelectorAll('.carousel-inner .banner-slide'); 164 for (var i = 0; i < slides.length; i++) { 165 slides[i].setAttribute('aria-label', `carousel slide number ${i + 1} of ${slides.length}`); 166 } 167 }); 168} 169 170function hideShowCarouselNavigation(carouselElement) { 171 var carouselNavigationArrows = carouselElement.querySelector('.carousel-navigation-controls'); 172 var carouselIndicators = carouselElement.querySelector('.carousel-indicators'); 173 var carouselPlayPauseControls = carouselElement.querySelector('.carousel-controls'); 174 var carouselBanners = carouselElement.querySelectorAll('.carousel-inner .item'); 175 var slideChangeReader = carouselElement.querySelector('slideChangeReader-CorporateCell'); 176 177 var carouselHasMoreThanOneBanner = carouselBanners.length > 1; 178 if (carouselHasMoreThanOneBanner) { 179 carouselNavigationArrows?.removeAttribute('hidden'); 180 carouselIndicators?.removeAttribute('hidden'); 181 carouselPlayPauseControls?.removeAttribute('hidden'); 182 slideChangeReader?.removeAttribute('hidden'); 183 } else { 184 carouselNavigationArrows?.setAttribute('hidden', true); 185 carouselIndicators?.setAttribute('hidden', true); 186 carouselPlayPauseControls?.setAttribute('hidden', true); 187 slideChangeReader?.setAttribute('hidden', true); 188 } 189}
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.