Remove unused queryChallenge code.

This commit is contained in:
ccd0 2014-12-23 00:52:23 -08:00
parent 289b4f8885
commit 69cf03df4d

View File

@ -39,27 +39,24 @@ Captcha.noscript =
@setup()
initFrame: ->
img = $ '.fbc-payload > img'
cb = ->
canvas = $.el 'canvas'
canvas.width = img.width
canvas.height = img.height
canvas.getContext('2d').drawImage(img, 0, 0)
conn.send {challenge: canvas.toDataURL()}
sendChallenge = ->
if img.complete
cb()
else
$.on img, 'load', cb
conn = new Connection window.top, "#{location.protocol}//boards.4chan.org",
queryChallenge: sendChallenge
response: (response) ->
$.id('response').value = response
$('.fbc-challenge > form').submit()
conn.send
token: $('.fbc-verification-token > textarea')?.value
error: $('.fbc-error')?.textContent
sendChallenge() if img
return unless img = $ '.fbc-payload > img'
cb = ->
canvas = $.el 'canvas'
canvas.width = img.width
canvas.height = img.height
canvas.getContext('2d').drawImage(img, 0, 0)
conn.send {challenge: canvas.toDataURL()}
if img.complete
cb()
else
$.on img, 'load', cb
timers: {}