1document.addEventListener("DOMContentLoaded",()=>{const forms=document.querySelectorAll(".form");if(!forms)return;forms.forEach((form)=>{const hiddenInput=document.createElement("input");hiddenInput.setAttribute("type","hidden");hiddenInput.setAttribute("name","check-spam");hiddenInput.setAttribute("unmandatory",true);form.appendChild(hiddenInput);const checkbox=form.querySelector('input[type="checkbox"]');const submitButton=form.querySelector(".button");submitButton.setAttribute("disabled","disabled");checkbox.addEventListener("change",()=>{checkbox.checked?submitButton.removeAttribute("disabled"):submitButton.setAttribute("disabled","disabled");});const phone=form.querySelector('input[name="phone"]');if(phone)validatePhone(phone);form.addEventListener("submit",formSubmitHandler);});function formSubmitHandler(event){event.preventDefault();const form=event.currentTarget;const popupSuccess=document.getElementById("popup-success");const popupError=document.getElementById("popup-error");const modal=form.closest(".modal")??null;const ordinary=form.dataset.ordinary;if(!validateform(form))return;const formData=new FormData(form);formData.append("link",window.location.href);if(modal){const formName=modal.querySelector(".title-box .title");const formClarification=modal.querySelector(".title-box>span");formData.append("form",formName.textContent);formData.append("clarification",formClarification.classList.contains("clarification-none")?"":formClarification.textContent);} 2const xhr=new XMLHttpRequest();xhr.open("POST","/wp-content/themes/atrium/mail/send.php",true);xhr.onreadystatechange=function(){if(xhr.readyState===4&&xhr.status===200){const response=JSON.parse(xhr.responseText);if(response.success){form.reset();if(modal){modal.classList.remove("open");document.body.classList.remove("lock");} 3popupSuccess.classList.add("show");setTimeout(()=>{popupSuccess.classList.remove("show");},5000);}else{popupError.classList.add("show");setTimeout(()=>{popupError.classList.remove("show");},5000);}}};xhr.send(formData);} 4function validateform(form){const inputs=form.querySelectorAll("input[mandatory]");let filled=true;console.log(inputs);inputs.forEach((input)=>{if(!input.value){input.classList.add("error");filled=false;setTimeout(()=>{input.classList.remove("error");},4000);return;} 5input.classList.remove("error");});return filled;} 6function validatePhone(phone){phone.addEventListener("input",(event)=>{const input=event.target;let value=input.value.replace(/\D/g,"");let formattedValue="";if(/^[0-9]/.test(value)){value=value.substring(1);formattedValue="+7";} 7if(value.length>0){formattedValue+=" ("+value.substring(0,3);} 8if(value.length>3){formattedValue+=") "+value.substring(3,6);} 9if(value.length>6){formattedValue+="-"+value.substring(6,8);} 10if(value.length>8){formattedValue+="-"+value.substring(8,10);} 11input.value=formattedValue;});}});
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.