Fix captcha support in the report window.
Also shave a line.
This commit is contained in:
parent
0f742f0d0b
commit
dc2ed6f6f3
@ -1,14 +1,13 @@
|
|||||||
Report =
|
Report =
|
||||||
init: ->
|
init: ->
|
||||||
return unless /report/.test location.search
|
return unless /report/.test(location.search) and d.cookie.indexOf('pass_enabled=1') is -1
|
||||||
$.ready @ready
|
$.asap (-> $.id 'recaptcha_response_field'), Report.ready
|
||||||
ready: ->
|
ready: ->
|
||||||
form = $ 'form'
|
|
||||||
field = $.id 'recaptcha_response_field'
|
field = $.id 'recaptcha_response_field'
|
||||||
$.on field, 'keydown', (e) ->
|
$.on field, 'keydown', (e) ->
|
||||||
$.globalEval 'Recaptcha.reload("t")' if e.keyCode is 8 and not field.value
|
$.globalEval 'Recaptcha.reload("t")' if e.keyCode is 8 and not field.value
|
||||||
$.on form, 'submit', (e) ->
|
$.on $('form'), 'submit', (e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
response = field.value.trim()
|
response = field.value.trim()
|
||||||
field.value = "#{response} #{response}" unless /\s/.test response
|
field.value = "#{response} #{response}" unless /\s/.test response
|
||||||
form.submit()
|
@submit()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user