Show audio captcha on report form.

This commit is contained in:
ccd0 2015-11-14 13:54:44 -08:00
parent 30d39e5fdd
commit f8bfb87e46
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,6 @@
:root:not(.js-enabled) #captchaContainerAlt {
height: auto;
}
#captchaContainerAlt td:nth-child(2) {
display: table-cell !important;
}

View File

@ -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