From 1cff4f3cf1011e25a59d984d79fa29dc863d655a Mon Sep 17 00:00:00 2001 From: swag Date: Sat, 17 Jun 2023 18:19:01 -0400 Subject: [PATCH] Revert "Automate the captcha" This reverts commit 0a2c198d1bd7dc1f083b7f27ab23446ca4dc6a7c. --- assets/assetpack.def | 3 --- assets/js/captcha.js | 23 ++++++++--------------- templates/remark/flag.html.ep | 1 - templates/thread/bump.html.ep | 1 - templates/thread/flag.html.ep | 1 - 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/assets/assetpack.def b/assets/assetpack.def index 95a23dc..e2a5c19 100644 --- a/assets/assetpack.def +++ b/assets/assetpack.def @@ -3,6 +3,3 @@ < css/elements.css < css/simple.css < css/nested.css - -! app.js -< js/captcha.js diff --git a/assets/js/captcha.js b/assets/js/captcha.js index 8fd0ace..eb3fddf 100644 --- a/assets/js/captcha.js +++ b/assets/js/captcha.js @@ -1,20 +1,13 @@ +/* 'use strict'; -(() => { - let captchaValue = document +document.getElementById('captcha').value = +*/ + +'use strict'; + +let captchaValue = + document .querySelector('label[for="captcha"]') .textContent .match(/'(flag|bump)'/)[1]; - let captchaForm = document - .querySelector('form[class="form-body"]'); - - captchaForm.captcha.value = captchaValue; - // Make 'em work for it - window.crypto.subtle.generateKey({ - name: 'RSA-OAEP', - modulusLength: 4096, - publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-512' - }, false, ['encrypt', 'decrypt']) - .finally(() => captchaForm.submit()); -})(); diff --git a/templates/remark/flag.html.ep b/templates/remark/flag.html.ep index be69738..0e468a0 100644 --- a/templates/remark/flag.html.ep +++ b/templates/remark/flag.html.ep @@ -10,7 +10,6 @@ <% } =%> <%= label_for captcha => "Enter the word 'flag' to confirm:" %> <%= text_field captcha => id => 'captcha' %> - <%= asset 'app.js' %> diff --git a/templates/thread/bump.html.ep b/templates/thread/bump.html.ep index 7ec8625..2280204 100644 --- a/templates/thread/bump.html.ep +++ b/templates/thread/bump.html.ep @@ -10,7 +10,6 @@ <% } =%> <%= label_for captcha => "Enter the word 'bump' to confirm:" %> <%= text_field captcha => id => 'captcha' %> - <%= asset 'app.js' %> diff --git a/templates/thread/flag.html.ep b/templates/thread/flag.html.ep index 1aba7cd..30ba7bf 100644 --- a/templates/thread/flag.html.ep +++ b/templates/thread/flag.html.ep @@ -10,7 +10,6 @@ <% } =%> <%= label_for captcha => "Enter the word 'flag' to confirm:" %> <%= text_field captcha => id => 'captcha' %> - <%= asset 'app.js' %>