PageSourceSearch

https://inothings.ru/js/form-dasha.js

js inothings.ru collected 2026-09-26 13:14:53 UTC 2,347 bytes, 1 lines download raw bytes

1const formWrap=document.querySelector(".subscribe__error-block"),form=document.querySelector(".landing-subscribe__form"),formCheckBox=document.querySelector(".subscribe__form-checkbox");if(form&&formWrap){const e="Спасибо за подписку! Ждите новостей",t="Проверьте ваш e-mail, кажется, в написании ошибка",n="Поле e-mail не должно быть пустым",o="Необходимо подтвердить согласие на обработку персональных данных",r="Произошла ошибка, попробуйте позже",c="subscribe__form-response_success",s="subscribe__form-response_error",u=form.querySelector("#mce-EMAIL"),i=form.querySelector(".subscribe__form-button"),m=(e,t)=>{const n=document.createElement("p");return n.classList.add(t),n.textContent=e,n},d=()=>{const e=document.querySelector(`.${s}`);e&&e.parentElement.removeChild(e)},l=()=>{const e=document.querySelector(`.${c}`);e&&e.remove()},a=e=>{return e.length?!/[-.\w]+@([\w-]+\.)+[\w-]+/g.test(e)&&t:n},f=function(e){return[].slice.call(e.elements,0).map(function(e){const t=e.name,n=e.type;return!t||e.disabled||"file"===n||/(checkbox|radio)/.test(n)&&!e.checked?"":"select-multiple"===n?e.options.map(function(e){return e.selected?`${encodeURIComponent(t)}=${encodeURIComponent(e.value)}`:""}).filter(function(e){return e}).join("&"):`${encodeURIComponent(t)}=${encodeURIComponent(e.value)}`}).filter(function(e){return e}).join("&")},p=t=>new Promise(function(n,o){const u=f(t),i=new XMLHttpRequest;i.open("POST",t.action,!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),i.onload=function(){if(i.status>=200&&i.status<400){const o=m(e,c);formWrap.appendChild(o),t.reset(),d(),n(i.responseText)}},i.onerror=function(){const e=m(r,s);formWrap.appendChild(e),o()},i.send(u)});i.addEventListener("click",e=>{let t;e.preventDefault(),document.documentMode?(t=document.createEvent("Event")).initEvent("submit",!0,!0):t=new Event("submit"),form.dispatchEvent(t)}),form.addEventListener("submit",e=>{e.preventDefault(),d(),l();const t=a(u.value);if(t){const e=m(t,s);formWrap.appendChild(e)}else if(!formCheckBox||formCheckBox.checked)p(form);else{const e=m(o,s);formWrap.appendChild(e)}}),form.addEventListener("input",()=>{d()})}

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.