1const btnscrollToSection = () => { 2 $(".scrollbtn").on("click", function (e) { 3 e.preventDefault(); 4 5 var paddingTop = 190; 6 7 $("html, body").animate({ 8 scrollTop: $($(this).attr("href")).offset().top - paddingTop, 9 }); 10 }); 11}; 12 13const setBoatBrandValue = (boatBrandValue) => { 14 let boatBrand = document.querySelector("#boat-enquiry-form .BoatBrand input"); 15 boatBrand.readOnly = true; 16 boatBrand.value = boatBrandValue; 17}; 18 19const setBoatRangeValue = (boatRangeValue) => { 20 let boatRange = document.querySelector("#boat-enquiry-form .BoatRange input"); 21 boatRange.readOnly = true; 22 boatRange.value = boatRangeValue; 23}; 24 25const setSubjectValue = (boatTypeValue) => { 26 let subject = document.querySelector("#boat-enquiry-form .Subject select"); 27 subject.querySelectorAll("option").forEach((option) => { 28 let isSelected = 29 (boatTypeValue === "New" && option.value === "New Boat") || 30 (boatTypeValue === "Used" && option.value === "Used Boat") || 31 (boatTypeValue === "Part & Accessories" && option.value === "Part & Accessories") || 32 (boatTypeValue === "Trailer" && option.value === "Trailer") || 33 (boatTypeValue !== "New" && boatTypeValue !== "Used" && option.value === "Other"); 34 isSelected 35 ? option.setAttribute("selected", "selected") 36 : option.removeAttribute("selected"); 37 }); 38}; 39 40const displayMessage = (boatRangeValue) => { 41 const message = `Hello, I am interested in the ${boatRangeValue}. Can I please have some more information?`; 42 $("#boat-enquiry-form .Enquiry textarea").val(message); 43}; 44 45const addPlaceHolderText = () => { 46 var input_fields = $(".formFields .formField input"); 47 input_fields.each(function () { 48 var title = $(this).attr("title"); 49 $(this).attr("placeholder", title); 50 }); 51 52 var textarea_fields = $(".formFields .formField textarea"); 53 textarea_fields.each(function () { 54 var title = $(this).attr("title"); 55 $(this).attr("placeholder", title); 56 }); 57}; 58 59(() => { 60 document.addEventListener("DOMContentLoaded", () => { 61 const ReferralURL = document.querySelector( 62 '#boat-enquiry-form .ReferralURL input[type="hidden"]' 63 ); 64 if (ReferralURL) { 65 ReferralURL.value = document.referrer; 66 } 67 68 const WebPageURL = document.querySelector( 69 '#boat-enquiry-form .WebPageURL input[type="hidden"]' 70 ); 71 if (WebPageURL) { 72 WebPageURL.value = location.href; 73 } 74 }); 75})(); 76 77$(document).ready(function () { 78 window.scrollTo = function (x, y) { 79 return true; 80 }; 81 82 btnscrollToSection(); 83 addPlaceHolderText(); 84});
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.