diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f238129f..45a7a1437 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor ### v1.11.17 +**v1.11.17.10** *(2015-11-25)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.17.10/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.17.10/builds/4chan-X-noupdate.crx "Chromium version")] +- Fix captcha focusing bug. + **v1.11.17.9** *(2015-11-24)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.17.9/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.17.9/builds/4chan-X-noupdate.crx "Chromium version")] - Support solving 4x4 image captchas with keys in 7-0-/-M square. diff --git a/src/Posting/Captcha.v1.coffee b/src/Posting/Captcha.v1.coffee index aa50aa354..5834893fb 100644 --- a/src/Posting/Captcha.v1.coffee +++ b/src/Posting/Captcha.v1.coffee @@ -95,7 +95,9 @@ Captcha.v1 = setup: (focus, force) -> return unless @isEnabled and (force or @needed()) @create() - @nodes.input.focus() if focus + if focus + $.addClass QR.nodes.el, 'focus' + @nodes.input.focus() afterSetup: -> return unless challenge = $.id 'recaptcha_challenge_field_holder' diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index 14a45faf8..3d993f805 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -66,7 +66,11 @@ Captcha.v2 = setup: (focus, force) -> return unless @isEnabled and (@needed() or force) - @nodes.counter.focus() if focus + + if focus + $.addClass QR.nodes.el, 'focus' + @nodes.counter.focus() + if @timeouts.destroy clearTimeout @timeouts.destroy delete @timeouts.destroy diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index a7502aa53..414bd3a08 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -765,7 +765,7 @@ QR = QR.cooldown.addDelay post, seconds else # stop auto-posting QR.cooldown.auto = false - QR.captcha.setup(QR.cooldown.auto and d.activeElement is QR.nodes.status) + QR.captcha.setup(QR.cooldown.auto and d.activeElement in [QR.nodes.status, d.body]) QR.cooldown.auto = false if QR.captcha.isEnabled and !QR.captcha.captchas.length QR.status() QR.error err