1var captchaObject = null; 2function handleCaptcha() { 3 4 // console.log([$('input[name="captcha_disabilitato"]').length <= 0, $('#captcha_key').length <= 0, $('#recaptcha-container').length <= 0]); 5 var numTentativiCorrenti = parseInt($('#captcha_num_tentativi_correnti').val()) + 1, 6 numTentativiMassimo = parseInt($('#captcha_num_tentativi_massimo').val()); 7 8 /** aggiorna l'input hidden in modo da mantenere aggiornato il numero di tentativi effettuati */ 9 $('#captcha_num_tentativi_correnti').val(numTentativiCorrenti); 10 11 if ($('#captcha_key').length <= 0 || $('#recaptcha-container').length <= 0 || numTentativiCorrenti < numTentativiMassimo) return; 12 var captchaKey = $('#captcha_key').val(); 13 14 var captchaHandler = { 15 render: function() { 16 $('#recaptcha-container').html(''); 17 captchaObject = grecaptcha.render('recaptcha-container', { 18 'sitekey': captchaKey 19 }); 20 }, 21 reset: function() { 22 grecaptcha.reset(captchaObject); 23 } 24 }; 25 26 // console.log(captchaObject); 27 // console.log('input: ' + $('input[name="captcha_disabilitato"]').length); 28 29 if (captchaObject == null) { 30 captchaHandler.render(); 31 } else { 32 // console.log('RESET'); 33 captchaHandler.reset(); 34 } 35 36 return; 37} 38$('#modalDonation').on('myd.modalDonation.submit.esito.ko',function(){ 39 handleCaptcha(); 40}); 41$('#modalDonation').on('myd.modalDonation.submit.error',function(){ 42 handleCaptcha(); 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.