1window.addEventListener("load", function () { 2 var submitbtn = document.querySelector(`form[name=contactform] button#submit`) || document.querySelector(`form[name=contactform] button[name=submit]`); 3 submitbtn.style.display = "none"; 4 var lib = document.createElement("script"); 5 lib.async = true; 6 lib.defer = true; 7 lib.src = "https://www.google.com/recaptcha/api.js?render=6Lf7mtUZAAAAALRdG-q8KnHw9dh3ZZSxGMNz8zg1"; 8 document.body.appendChild(lib); 9 lib.onload = function () { 10 console.log("recaptcha loaded"); 11 submitbtn.style.display = "block"; 12 var cform = document.querySelector("[name=contactform]"); 13 submitbtn.onclick = function onSubmit(e) { 14 e.preventDefault(); 15 16 /// if there's optin language, enforce it: 17 var optin = document.getElementById("optin"); 18 if (optin) { 19 if (!optin.checked) { 20 alert("You must opt in to submit the form."); 21 return false; 22 } 23 } else { 24 optin = document.getElementsByName("optin"); 25 if (optin.length === 2) { 26 const optins = [...optin]; 27 const yesradio = optins.find(o => o.value.trim().toLowerCase() === "yes"); 28 if (!yesradio.checked) { 29 alert("You must opt in to submit the form."); 30 return false; 31 } 32 } 33 } 34 35 grecaptcha.ready(function () { 36 grecaptcha.execute("6Lf7mtUZAAAAALRdG-q8KnHw9dh3ZZSxGMNz8zg1", { 37 action: "submit", 38 }).then(function(token) { 39 var cform = document.querySelector("[name=contactform]"); 40 var recap = document.createElement("input"); 41 recap.type = "hidden"; 42 recap.name = "g-recaptcha-response"; 43 recap.value = token; 44 cform.appendChild(recap); 45 setTimeout(function () { 46 document.createElement("form").submit.call(cform); 47 }); 48 }); 49 }); 50 } 51 }; 52});
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.