1console.log('version 3'); 2 3document.addEventListener("DOMContentLoaded", () => { 4 new Feedback(); 5}); 6 7 8class Feedback { 9 constructor() { 10 if (typeof Feedback.class === 'object') { 11 return Feedback.class; 12 } 13 this.initForms(); 14 Feedback.class = this; 15 return Feedback.class; 16 } 17 18 initForms() { 19 document.querySelectorAll('form.js-feedback').forEach((form) => { 20 this.initForm(form); 21 }) 22 } 23 24 initForm(form) { 25 form.addEventListener('submit', (e) => { 26 e.preventDefault(); 27 this.sendForm(form); 28 }) 29 } 30 31 sendForm(form) { 32 let formData = new FormData(form); 33 formData.append('noSpam', 'Y'); 34 fetch(form.action, { 35 method: 'POST', 36 body: formData 37 }).then(response => response.json()) 38 .then(res => { 39 form.innerHTML = `<h2>${res.message}</h2>`; 40 }); 41 42 } 43}
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.