From f8bfb87e46287d4d622b245dacea4111ed61ee28 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 14 Nov 2015 13:54:44 -0800 Subject: [PATCH] Show audio captcha on report form. --- src/General/css/report.css | 3 +++ src/Miscellaneous/Report.coffee | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/General/css/report.css b/src/General/css/report.css index 8e2ed1079..de1c72b63 100644 --- a/src/General/css/report.css +++ b/src/General/css/report.css @@ -1,3 +1,6 @@ :root:not(.js-enabled) #captchaContainerAlt { height: auto; } +#captchaContainerAlt td:nth-child(2) { + display: table-cell !important; +} diff --git a/src/Miscellaneous/Report.coffee b/src/Miscellaneous/Report.coffee index fe49989ea..4ee240305 100755 --- a/src/Miscellaneous/Report.coffee +++ b/src/Miscellaneous/Report.coffee @@ -38,6 +38,12 @@ Report = Report.fit 'body' if !Conf['Use Recaptcha v2 in Reports'] and $.hasClass(doc, 'js-enabled') and d.cookie.indexOf('pass_enabled=1') < 0 + $.onExists d.body, '#recaptcha_image', true, (image) -> + # XXX Native reload-on-click breaks audio captcha. + $.global -> document.getElementById('recaptcha_image').removeEventListener 'click', window.onAltCaptchaClick, false + $.on image, 'click', -> + if $.id 'recaptcha_challenge_image' + $.global -> window.Recaptcha.reload() $.onExists d.body, '#recaptcha_response_field', true, (field) -> $.on field, 'keydown', (e) -> if e.keyCode is 8 and not field.value