diff --git a/src/General/css/style.css b/src/General/css/style.css index 04e68d916..e772b20be 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -108,6 +108,9 @@ hr + div.center:not(.ad-cnt):not(.topad):not(.middlead):not(.bottomad) { :root:not(.js-enabled) #postForm { display: table; } +#captchaContainerAlt td:nth-child(2) { + display: table-cell !important; +} /* Anti-autoplay */ audio.controls-added { diff --git a/src/Posting/Captcha.v1.coffee b/src/Posting/Captcha.v1.coffee index 7d456a510..535b7988f 100644 --- a/src/Posting/Captcha.v1.coffee +++ b/src/Posting/Captcha.v1.coffee @@ -167,6 +167,9 @@ Captcha.v1 = $.set 'captchas', @captchas load: -> + if $('#captchaContainerAlt[class~="recaptcha_is_showing_audio"]') + @nodes.img.hidden = true + return return unless @nodes.challenge.firstChild return unless challenge_image = $.id 'recaptcha_challenge_image' # -1 minute to give upload some time. @@ -174,7 +177,8 @@ Captcha.v1 = challenge = @nodes.challenge.firstChild.value @nodes.img.alt = challenge @nodes.img.src = challenge_image.src - @nodes.input.value = null + @nodes.img.hidden = false + @nodes.input.value = '' @clear() count: -> @@ -191,9 +195,15 @@ Captcha.v1 = @nodes.input.alt = count # For XTRM RICE. reload: (focus) -> - # Hack to prevent the input from being focused - $.globalEval 'Recaptcha.reload(); Recaptcha.should_focus = false;' - # Focus if we meant to. + # Recaptcha.should_focus = false: Hack to prevent the input from being focused + $.globalEval ''' + if (window.Recaptcha.type === "image") { + window.Recaptcha.reload(); + } else { + window.Recaptcha.switch_type("image"); + } + window.Recaptcha.should_focus = false; + ''' @nodes.input.focus() if focus keydown: (e) ->