pull refresh out of qr.cb

This commit is contained in:
James Campos 2011-04-08 01:53:55 -07:00
parent aa7adaf40a
commit bda70f0533
2 changed files with 29 additions and 29 deletions

View File

@ -1049,21 +1049,21 @@
ta = $('textarea', dialog); ta = $('textarea', dialog);
ta.focus(); ta.focus();
return ta.value += text; return ta.value += text;
}, }
refresh: function(dialog) { },
var auto, f, submit, _ref; refresh: function(dialog) {
$('textarea', dialog).value = ''; var auto, f, submit, _ref;
$('input[name=recaptcha_response_field]', dialog).value = ''; $('textarea', dialog).value = '';
f = $('input[type=file]', dialog).parentNode; $('input[name=recaptcha_response_field]', dialog).value = '';
f.innerHTML = f.innerHTML; f = $('input[type=file]', dialog).parentNode;
submit = $('input[type=submit]', qr); f.innerHTML = f.innerHTML;
submit.value = g.sage ? 60 : 30; submit = $('input[type=submit]', qr);
submit.disabled = true; submit.value = g.sage ? 60 : 30;
window.setTimeout(qr.cooldown, 1000); submit.disabled = true;
auto = submit.previousSibling.lastChild; window.setTimeout(qr.cooldown, 1000);
if (auto.checked) { auto = submit.previousSibling.lastChild;
return (_ref = $('input[title=autohide]:checked', qr)) != null ? _ref.click() : void 0; if (auto.checked) {
} return (_ref = $('input[title=autohide]:checked', qr)) != null ? _ref.click() : void 0;
} }
}, },
cooldown: function() { cooldown: function() {

View File

@ -779,20 +779,20 @@ qr =
ta.focus() ta.focus()
ta.value += text ta.value += text
refresh: (dialog) -> refresh: (dialog) ->
$('textarea', dialog).value = '' $('textarea', dialog).value = ''
$('input[name=recaptcha_response_field]', dialog).value = '' $('input[name=recaptcha_response_field]', dialog).value = ''
# XXX file.value = '' doesn't work in opera # XXX file.value = '' doesn't work in opera
f = $('input[type=file]', dialog).parentNode f = $('input[type=file]', dialog).parentNode
f.innerHTML = f.innerHTML f.innerHTML = f.innerHTML
submit = $ 'input[type=submit]', qr submit = $ 'input[type=submit]', qr
submit.value = if g.sage then 60 else 30 submit.value = if g.sage then 60 else 30
submit.disabled = true submit.disabled = true
window.setTimeout qr.cooldown, 1000 window.setTimeout qr.cooldown, 1000
auto = submit.previousSibling.lastChild auto = submit.previousSibling.lastChild
if auto.checked if auto.checked
#unhide the qr so you know it's ready for the next item #unhide the qr so you know it's ready for the next item
$('input[title=autohide]:checked', qr)?.click() $('input[title=autohide]:checked', qr)?.click()
cooldown: -> cooldown: ->
submit = $ '#qr input[type=submit]' submit = $ '#qr input[type=submit]'