From a8bb0049d32ed2fa5e9eaf5c5156d7b9bd694598 Mon Sep 17 00:00:00 2001 From: swag Date: Wed, 14 Jun 2023 01:25:55 -0400 Subject: [PATCH] I have to go to bed now --- assets/js/captcha.js | 13 +++++++++++++ cpanfile | 2 +- lib/PostText.pm | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 assets/js/captcha.js diff --git a/assets/js/captcha.js b/assets/js/captcha.js new file mode 100644 index 0000000..eb3fddf --- /dev/null +++ b/assets/js/captcha.js @@ -0,0 +1,13 @@ +/* +'use strict'; + +document.getElementById('captcha').value = +*/ + +'use strict'; + +let captchaValue = + document + .querySelector('label[for="captcha"]') + .textContent + .match(/'(flag|bump)'/)[1]; diff --git a/cpanfile b/cpanfile index 39b7824..513a479 100644 --- a/cpanfile +++ b/cpanfile @@ -4,10 +4,10 @@ requires 'Mojolicious::Plugin::TagHelpers::Pagination'; requires 'Mojolicious::Plugin::AssetPack'; requires 'Crypt::Passphrase::Argon2'; requires 'Crypt::Passphrase::Bcrypt'; # Needed for old passphrases -#requires 'Perl::Critic::Community'; requires 'Date::Format'; requires 'XML::RSS'; requires 'CSS::Minifier::XS'; requires 'Text::Markdown'; requires 'HTML::Restrict'; requires 'IO::Socket::SSL'; +requires 'JavaScript::Minifier::XS'; diff --git a/lib/PostText.pm b/lib/PostText.pm index fbb8c7f..61a7c08 100644 --- a/lib/PostText.pm +++ b/lib/PostText.pm @@ -16,7 +16,7 @@ use PostText::Model::Moderator; sub startup($self) { $self->plugin('Config'); $self->plugin('TagHelpers::Pagination'); - $self->plugin(AssetPack => {pipes => [qw{Css Combine}]}); + $self->plugin(AssetPack => {pipes => [qw{Css JavaScript Combine}]}); # Helpers $self->helper(pg => sub ($c) {