|
10 | 10 | <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png"> |
11 | 11 | <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"> |
12 | 12 | <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"> |
| 13 | + <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script> |
13 | 14 |
|
14 | 15 | <style> |
15 | 16 | .uninstall-hero { |
@@ -357,7 +358,7 @@ <h1 class="uninstall-title">I'm sorry to see you go.</h1> |
357 | 358 | <textarea class="fluent-textarea" name="entry.472098049" |
358 | 359 | placeholder="Tell us more... (Optional)"></textarea> |
359 | 360 | </div> |
360 | | - |
| 361 | + <div class="cf-turnstile" data-sitekey="0x4AAAAAAC8NIkPtzPtQxqM5" data-theme="light"></div> |
361 | 362 | <div class="form-actions"> |
362 | 363 | <button type="submit" class="btn-primary">Submit Feedback</button> |
363 | 364 | </div> |
@@ -456,15 +457,22 @@ <h3>Back to Home</h3> |
456 | 457 | }); |
457 | 458 | }); |
458 | 459 |
|
459 | | - let submitted = false; |
460 | | - form.addEventListener('submit', () => { |
461 | | - submitted = true; |
462 | | - // Troca o visual do botão para indicar carregamento |
463 | | - const btn = form.querySelector('button[type="submit"]'); |
464 | | - btn.textContent = 'Sending...'; |
465 | | - btn.style.opacity = '0.7'; |
466 | | - btn.disabled = true; |
467 | | - }); |
| 460 | +form.addEventListener('submit', (e) => { |
| 461 | + // Busca a resposta do Cloudflare |
| 462 | + const turnstileResponse = document.querySelector('[name="cf-turnstile-response"]').value; |
| 463 | + |
| 464 | + if (!turnstileResponse) { |
| 465 | + e.preventDefault(); // Impede o envio para o Google Forms |
| 466 | + alert("Por favor, complete a verificação de segurança."); |
| 467 | + return; |
| 468 | + } |
| 469 | + |
| 470 | + submitted = true; |
| 471 | + const btn = form.querySelector('button[type="submit"]'); |
| 472 | + btn.textContent = 'Sending...'; |
| 473 | + btn.style.opacity = '0.7'; |
| 474 | + btn.disabled = true; |
| 475 | +}); |
468 | 476 |
|
469 | 477 | const iframe = document.getElementById('hidden_iframe'); |
470 | 478 | iframe.onload = function () { |
|
0 commit comments