1document.addEventListener('click', function (e) { 2 const target = e.target.closest('a.recupera, a.login'); 3 if (!target) return; 4 5 e.preventDefault(); 6 7 const url = target.classList.contains('recupera') 8 ? '/account/recupera.php' 9 : '/account/login.php'; 10 11 fetch(url) 12 .then(response => response.text()) 13 .then(msg => { 14 document.querySelector('#rescue-tab').innerHTML = msg; 15 }) 16 .catch(console.error); 17}); 18 19// Gestione form login 20document.addEventListener('submit', function (e) { 21 const form = e.target.closest('form'); 22 if (!form) return; 23 24 if (form.id !== 'form-login' && form.id !== 'form-login-inpage') return; 25 26 e.preventDefault(); 27 28 const data = new FormData(form); 29 const container = form.parentElement; 30 31 fetch('/account/login.php', { 32 method: 'POST', 33 body: data 34 }) 35 .then(response => response.text()) 36 .then(msg => { 37 if (msg.trim() === 'login-successful') { 38 window.location.replace(data.get('location')); 39 } else { 40 container.innerHTML = msg; 41 } 42 }) 43 .catch(console.error); 44}); 45 46// Gestione form registrazione 47document.addEventListener('submit', function (e) { 48 const form = e.target.closest('form#form-registrati'); 49 if (!form) return; 50 51 e.preventDefault(); 52 const data = new FormData(form); 53 54 fetch('/account/registrazione.php', { 55 method: 'POST', 56 body: data 57 }) 58 .then(response => response.text()) 59 .then(msg => { 60 document.querySelector('#signup-tab').innerHTML = msg; 61 }) 62 .catch(console.error); 63}); 64 65// Gestione form recupero password 66document.addEventListener('submit', function (e) { 67 const form = e.target.closest('form#form-recupera'); 68 if (!form) return; 69 70 e.preventDefault(); 71 const data = new FormData(form); 72 fetch('/account/recupera.php', { 73 method: 'POST', 74 body: data 75 }) 76 .then(response => response.text()) 77 .then(msg => { 78 document.querySelector('#rescue-tab').innerHTML = msg; 79 }) 80 .catch(console.error); 81});
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.