Need more captchas or captcha error -> focus on captcha iframe

This commit is contained in:
ccd0 2014-12-08 21:35:46 -08:00
parent 0e916592d8
commit 145dc078a5
2 changed files with 6 additions and 6 deletions

View File

@ -49,12 +49,12 @@ QR.captcha =
if @occupied() if @occupied()
@destroy() @destroy()
else else
@shouldFocus = true @setup true, true
@setup true
setup: (force) -> setup: (focus, force) ->
return unless @isEnabled and (@needed() or force) return unless @isEnabled and (@needed() or force)
$.addClass QR.nodes.el, 'captcha-open' $.addClass QR.nodes.el, 'captcha-open'
@shouldFocus = true if focus
if @timeouts.destroy if @timeouts.destroy
clearTimeout @timeouts.destroy clearTimeout @timeouts.destroy
delete @timeouts.destroy delete @timeouts.destroy
@ -129,7 +129,7 @@ QR.captcha =
@captchas = @captchas[i..] @captchas = @captchas[i..]
@count() @count()
$.set 'captchas', @captchas $.set 'captchas', @captchas
@setup() @setup true
count: -> count: ->
@nodes.counter.textContent = "Captchas: #{@captchas.length}" @nodes.counter.textContent = "Captchas: #{@captchas.length}"

View File

@ -145,7 +145,7 @@ QR =
el = err el = err
el.removeAttribute 'style' el.removeAttribute 'style'
if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
QR.captcha.setup() QR.captcha.setup true
QR.notify el QR.notify el
alert el.textContent if d.hidden alert el.textContent if d.hidden
@ -791,7 +791,7 @@ QR =
QR.close() QR.close()
else else
post.rm() post.rm()
QR.captcha.setup() QR.captcha.setup true
QR.cooldown.add req.uploadEndTime, threadID, postID QR.cooldown.add req.uploadEndTime, threadID, postID