diff options
| author | Jakob L. Kreuze | 2022-11-19 12:26:21 -0500 |
|---|---|---|
| committer | Jakob L. Kreuze | 2022-11-19 12:27:25 -0500 |
| commit | 52554a1dcd9101fff5bea67f883f2d1ebe57d8e4 (patch) | |
| tree | a61dc2b89ea16ae83bf50040c197a846adb198a3 /haunt/jakob/dynamic/capabilities/comment-form.scm | |
| parent | 10cce1e4d3f7849c5f65f99dc8940dd6e15afbc0 (diff) | |
[dynamic] Implement client-side of POW captcha
Diffstat (limited to 'haunt/jakob/dynamic/capabilities/comment-form.scm')
| -rw-r--r-- | haunt/jakob/dynamic/capabilities/comment-form.scm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/haunt/jakob/dynamic/capabilities/comment-form.scm b/haunt/jakob/dynamic/capabilities/comment-form.scm index 1754dfd..f1cbd9e 100644 --- a/haunt/jakob/dynamic/capabilities/comment-form.scm +++ b/haunt/jakob/dynamic/capabilities/comment-form.scm @@ -21,6 +21,7 @@ #:use-module (jakob dynamic captcha) #:use-module (jakob dynamic util) #:use-module (jakob theme) + #:use-module (jakob utils sxml) #:use-module (json) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) @@ -56,7 +57,12 @@ (img (@ (src ,(format #f "data:image/jpeg;charset=utf-8;base64,~a" (base64-encode captcha-image))))) (input (@ (type "text") (id "captcha") (name "captcha") (size 24))) - (input (@ (type "submit") (id "submit-form") (value "Submit"))))))))) + (button (@ (id "pow-trigger") (hidden #t)) + "Too hard? (Or unable to see the challenge?) Click here.") + (input (@ (type "text") (id "captcha-alt") (name "captcha-alt") (hidden #t))) + (input (@ (type "text") (id "captcha-alt-id") (name "captcha-alt-id") (hidden #t))) + (input (@ (type "submit") (id "submit-form") (value "Submit"))))) + ,(script "proof-of-work.js"))))) (define (get-comment-form request body) "API endpoint handler for querying for the comments on a particular post |