enable autopost if submit attempt during cooldown; fix #265

This commit is contained in:
James Campos 2011-09-28 14:14:21 -07:00
parent c3ba138dfd
commit 122c2d2001
2 changed files with 11 additions and 6 deletions

View File

@ -1708,10 +1708,12 @@
submit: function(e) {
var captcha, challenge, el, id, input, op, qr, response;
qr = QR.qr;
if ($('form button', qr).disabled) {
return;
}
if (!($('textarea', qr).value || $('#files', qr).childNodes.length)) {
if ($('textarea', qr).value || $('#files', qr).childNodes.length) {
if ($('form button', qr).disabled) {
$('#autopost', qr).checked = true;
return;
}
} else {
if (e) {
alert('Error: No text entered.');
e.preventDefault();

View File

@ -1265,9 +1265,12 @@ QR =
$('textarea', QR.qr).value = ''
submit: (e) ->
{qr} = QR
return if $('form button', qr).disabled
#XXX e is undefined if method is called explicitly, eg, from auto posting
unless $('textarea', qr).value or $('#files', qr).childNodes.length
if $('textarea', qr).value or $('#files', qr).childNodes.length
if $('form button', qr).disabled
$('#autopost', qr).checked = true
return
else
if e
alert 'Error: No text entered.'
e.preventDefault()