From bda70f05338305e9fefabc439078ad21bf19c99e Mon Sep 17 00:00:00 2001 From: James Campos Date: Fri, 8 Apr 2011 01:53:55 -0700 Subject: [PATCH] pull refresh out of qr.cb --- 4chan_x.js | 30 +++++++++++++++--------------- script.coffee | 28 ++++++++++++++-------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index cdab6de51..a29e3a5ba 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1049,21 +1049,21 @@ ta = $('textarea', dialog); ta.focus(); return ta.value += text; - }, - refresh: function(dialog) { - var auto, f, submit, _ref; - $('textarea', dialog).value = ''; - $('input[name=recaptcha_response_field]', dialog).value = ''; - f = $('input[type=file]', dialog).parentNode; - f.innerHTML = f.innerHTML; - submit = $('input[type=submit]', qr); - submit.value = g.sage ? 60 : 30; - submit.disabled = true; - window.setTimeout(qr.cooldown, 1000); - auto = submit.previousSibling.lastChild; - if (auto.checked) { - return (_ref = $('input[title=autohide]:checked', qr)) != null ? _ref.click() : void 0; - } + } + }, + refresh: function(dialog) { + var auto, f, submit, _ref; + $('textarea', dialog).value = ''; + $('input[name=recaptcha_response_field]', dialog).value = ''; + f = $('input[type=file]', dialog).parentNode; + f.innerHTML = f.innerHTML; + submit = $('input[type=submit]', qr); + submit.value = g.sage ? 60 : 30; + submit.disabled = true; + window.setTimeout(qr.cooldown, 1000); + auto = submit.previousSibling.lastChild; + if (auto.checked) { + return (_ref = $('input[title=autohide]:checked', qr)) != null ? _ref.click() : void 0; } }, cooldown: function() { diff --git a/script.coffee b/script.coffee index f3f6547bc..ef7ec33a0 100644 --- a/script.coffee +++ b/script.coffee @@ -779,20 +779,20 @@ qr = ta.focus() ta.value += text - refresh: (dialog) -> - $('textarea', dialog).value = '' - $('input[name=recaptcha_response_field]', dialog).value = '' - # XXX file.value = '' doesn't work in opera - f = $('input[type=file]', dialog).parentNode - f.innerHTML = f.innerHTML - submit = $ 'input[type=submit]', qr - submit.value = if g.sage then 60 else 30 - submit.disabled = true - window.setTimeout qr.cooldown, 1000 - auto = submit.previousSibling.lastChild - if auto.checked - #unhide the qr so you know it's ready for the next item - $('input[title=autohide]:checked', qr)?.click() + refresh: (dialog) -> + $('textarea', dialog).value = '' + $('input[name=recaptcha_response_field]', dialog).value = '' + # XXX file.value = '' doesn't work in opera + f = $('input[type=file]', dialog).parentNode + f.innerHTML = f.innerHTML + submit = $ 'input[type=submit]', qr + submit.value = if g.sage then 60 else 30 + submit.disabled = true + window.setTimeout qr.cooldown, 1000 + auto = submit.previousSibling.lastChild + if auto.checked + #unhide the qr so you know it's ready for the next item + $('input[title=autohide]:checked', qr)?.click() cooldown: -> submit = $ '#qr input[type=submit]'