1document.addEventListener("DOMContentLoaded", function () { 2 const form = document.getElementById("document-delivery-form"); 3 4 if (form) { 5 form.addEventListener("submit", function (event) { 6 event.preventDefault(); 7 8 const formData = new FormData(this); 9 const messageDiv = document.getElementById("form-message"); 10 11 fetch("/wp-admin/admin-ajax.php", { 12 method: "POST", 13 body: formData, 14 }) 15 .then((response) => response.text()) 16 .then((text) => { 17 // Extrage partea JSON din rÄspuns 18 const jsonMatch = text.match(/\{.*\}/); 19 if (jsonMatch) { 20 return JSON.parse(jsonMatch[0]); 21 } 22 throw new Error("Nu s-a gÄsit un rÄspuns JSON"); 23 }) 24 .then((data) => { 25 if (data.success) { 26 // AfiÈeazÄ mesajul de succes 27 messageDiv.textContent = data.data; 28 messageDiv.style.display = "block"; 29 messageDiv.classList.remove("hidden"); 30 messageDiv.classList.add("text-green-600", "font-semibold"); 31 32 // ReseteazÄ formularul 33 form.reset(); 34 35 // RedirecÈioneazÄ dupÄ un delay 36 setTimeout(() => { 37 window.location.href = "/"; 38 }, 2000); 39 } else { 40 // AfiÈeazÄ mesajul de eroare 41 messageDiv.textContent = data.data; 42 messageDiv.style.display = "block"; 43 messageDiv.classList.remove("hidden"); 44 messageDiv.classList.add("text-red-600", "font-semibold"); 45 } 46 47 // Ascunde mesajul dupÄ 5 secunde 48 setTimeout(() => { 49 messageDiv.classList.add("hidden"); 50 }, 5000); 51 }) 52 .catch((error) => { 53 console.error("Error:", error); 54 messageDiv.textContent = 55 "A apÄrut o eroare. VÄ rugÄm sÄ Ã®ncercaÈi din nou."; 56 messageDiv.style.display = "block"; 57 messageDiv.classList.remove("hidden"); 58 messageDiv.classList.add("text-red-600", "font-semibold"); 59 }); 60 }); 61 } 62});
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.