diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 94bfa6097..36d913beb 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -379,6 +379,10 @@ Config = false 'Automatically load the captcha in the QR even if your post is empty.' ] + 'Post on Captcha Completion': [ + false + 'Submit the post immediately when the captcha is completed.' + ] 'Bottom QR Link': [ true 'Places a link on the bottom of threads to open the QR.' diff --git a/src/Posting/QR.captcha.coffee b/src/Posting/QR.captcha.coffee index 8a62d8b09..4135efc26 100644 --- a/src/Posting/QR.captcha.coffee +++ b/src/Posting/QR.captcha.coffee @@ -122,22 +122,25 @@ QR.captcha = null save: (pasted) -> - response = $('textarea', @nodes.container).value - timeout = (if pasted then @setupTime else Date.now()) + 2 * $.MINUTE - if QR.cooldown.auto and @needed() - @shouldFocus = true - @reload() - else - QR.nodes.status.focus() - if pasted - @destroy() - else - @timeouts.destroy ?= setTimeout @destroy.bind(@), 3 * $.SECOND + reload = QR.cooldown.auto and @needed() $.forceSync 'captchas' - @captchas.push {response, timeout} + @captchas.push + response: $('textarea', @nodes.container).value + timeout: (if pasted then @setupTime else Date.now()) + 2 * $.MINUTE @count() $.set 'captchas', @captchas + if reload + @shouldFocus = true + return @reload() + + if pasted + @destroy() + else + @timeouts.destroy ?= setTimeout @destroy.bind(@), 3 * $.SECOND + QR.nodes.status.focus() + QR.submit() if Conf['Post on Captcha Completion'] + clear: -> return unless @captchas.length now = Date.now()