work fully on main reply box

This commit is contained in:
James Campos 2011-03-30 16:18:04 -07:00
parent bd770b1246
commit 110fe98fd9
2 changed files with 50 additions and 29 deletions

View File

@ -1013,34 +1013,43 @@
return _results;
},
submit: function(e) {
var recaptcha, span;
if (span = this.nextSibling) {
$.remove(span);
var isQR, recaptcha, span;
isQR = e.target.parentNode.id === 'qr';
if (isQR) {
if (span = this.nextSibling) {
$.remove(span);
}
}
if (g.seconds = GM_getValue('seconds')) {
e.preventDefault();
span = $.el('span', {
className: 'error',
textContent: 'Stop posting so often!'
});
$.append(this.parentNode, span);
alert('Stop posting so often!');
qr.cooldownStart();
alert('Stop posting so often!');
if (isQR) {
span = $.el('span', {
className: 'error',
textContent: 'Stop posting so often!'
});
$.append(this.parentNode, span);
}
return;
}
recaptcha = $('input[name=recaptcha_response_field]', this);
if (recaptcha.value) {
qr.autohide.set();
return g.sage = $('#qr input[name=email]').value === 'sage';
g.sage = $('#qr input[name=email]').value === 'sage';
if (isQR) {
return qr.autohide.set();
}
} else {
e.preventDefault();
span = $.el('span', {
className: 'error',
textContent: 'You forgot to type in the verification.'
});
$.append(this.parentNode, span);
alert('You forgot to type in the verification.');
return recaptcha.focus();
recaptcha.focus();
if (isQR) {
span = $.el('span', {
className: 'error',
textContent: 'You forgot to type in the verification.'
});
return $.append(this.parentNode, span);
}
}
},
quote: function(e) {
@ -1705,6 +1714,7 @@
}
recaptcha = $('#recaptcha_response_field');
$.bind(recaptcha, 'keydown', recaptchaListener);
$.bind($('form[name=post]'), 'submit', qr.cb.submit);
scroll = function() {
var bottom, height, i, reply, _len, _ref;
height = d.body.clientHeight;

View File

@ -747,32 +747,41 @@ qr =
$.bind quote, 'click', qr.cb.quote
submit: (e) ->
if span = @nextSibling
$.remove span
isQR = e.target.parentNode.id == 'qr'
if isQR
if span = @nextSibling
$.remove span
if g.seconds = GM_getValue 'seconds'
e.preventDefault()
span = $.el 'span',
className: 'error'
textContent: 'Stop posting so often!'
$.append @parentNode, span
alert 'Stop posting so often!'
qr.cooldownStart()
alert 'Stop posting so often!'
if isQR
span = $.el 'span',
className: 'error'
textContent: 'Stop posting so often!'
$.append @parentNode, span
return
recaptcha = $('input[name=recaptcha_response_field]', this)
if recaptcha.value
qr.autohide.set()
g.sage = $('#qr input[name=email]').value == 'sage'
if isQR
qr.autohide.set()
else
e.preventDefault()
span = $.el 'span',
className: 'error'
textContent: 'You forgot to type in the verification.'
$.append @parentNode, span
alert 'You forgot to type in the verification.'
recaptcha.focus()
if isQR
span = $.el 'span',
className: 'error'
textContent: 'You forgot to type in the verification.'
$.append @parentNode, span
quote: (e) ->
e.preventDefault()
{target} = e
@ -1334,6 +1343,8 @@ for el in $$ '#recaptcha_table a'
recaptcha = $ '#recaptcha_response_field'
$.bind recaptcha, 'keydown', recaptchaListener
$.bind $('form[name=post]'), 'submit', qr.cb.submit
scroll = ->
height = d.body.clientHeight
for reply, i in g.replies