merge QR.autoPost into QR.submit
This commit is contained in:
parent
9f21c5df35
commit
6d80885a5d
@ -1291,12 +1291,6 @@
|
||||
}
|
||||
return $.replace(oldFile, file);
|
||||
},
|
||||
autoPost: function() {
|
||||
if (!QR.hasContent()) {
|
||||
return;
|
||||
}
|
||||
return QR.submit();
|
||||
},
|
||||
captchaNode: function(e) {
|
||||
var c;
|
||||
c = e.target.value;
|
||||
@ -1359,7 +1353,7 @@
|
||||
disabled: false
|
||||
});
|
||||
if ($('#auto', QR.qr).checked) {
|
||||
return QR.autoPost();
|
||||
return QR.submit();
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1455,6 +1449,12 @@
|
||||
},
|
||||
submit: function(e) {
|
||||
var captcha, challenge, el, qr, response;
|
||||
if (!QR.hasContent()) {
|
||||
if (e) {
|
||||
alert('Error: No text entered.');
|
||||
}
|
||||
return;
|
||||
}
|
||||
qr = QR.qr;
|
||||
$('.error', qr).textContent = '';
|
||||
if ((el = $('#recaptcha_response_field', qr)).value) {
|
||||
|
||||
@ -1008,9 +1008,6 @@ QR =
|
||||
name: 'upfile'
|
||||
accept: QR.accept
|
||||
$.replace oldFile, file
|
||||
autoPost: ->
|
||||
return unless QR.hasContent()
|
||||
QR.submit()
|
||||
captchaNode: (e) ->
|
||||
c = e.target.value
|
||||
$('img', QR.qr).src = "http://www.google.com/recaptcha/api/image?c=#{c}"
|
||||
@ -1056,7 +1053,7 @@ QR =
|
||||
$.extend b,
|
||||
textContent: 'Submit'
|
||||
disabled: false
|
||||
QR.autoPost() if $('#auto', QR.qr).checked
|
||||
QR.submit() if $('#auto', QR.qr).checked
|
||||
dialog: (text='') ->
|
||||
QR.qr = qr = ui.dialog 'qr', top: '0', left: '0', "
|
||||
<a class=close title=close>X</a><input type=checkbox id=autohide title=autohide>
|
||||
@ -1136,7 +1133,10 @@ QR =
|
||||
$('textarea', QR.qr).value = ''
|
||||
QR.attachNext()
|
||||
submit: (e) ->
|
||||
#XXX e is undefined if we're called from QR.autoPost
|
||||
#XXX e is undefined if method is called explicitly, eg, from auto posting
|
||||
unless QR.hasContent()
|
||||
alert 'Error: No text entered.' if e
|
||||
return
|
||||
{qr} = QR
|
||||
$('.error', qr).textContent = ''
|
||||
if (el = $('#recaptcha_response_field', qr)).value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user