Some qr.captchaIsEnabled here and there.

This commit is contained in:
Nicolas Stepien 2012-09-18 18:39:48 +02:00
parent d063d89ed9
commit 9d6232ec53
2 changed files with 4 additions and 4 deletions

View File

@ -1803,7 +1803,7 @@
$.add(el, err);
}
QR.open();
if (/captcha|verification/i.test(el.textContent)) {
if (qr.captchaIsEnabled && /captcha|verification/i.test(el.textContent)) {
$('[autocomplete]', QR.el).focus();
}
if (d.hidden || d.oHidden || d.mozHidden || d.webkitHidden) {
@ -2511,7 +2511,7 @@
}
if (err) {
if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
QR.cooldown.auto = !!$.get('captchas', []).length;
QR.cooldown.auto = qr.captchaIsEnabled ? !!$.get('captchas', []).length : true;
QR.cooldown.set(2);
} else {
QR.cooldown.auto = false;

View File

@ -1392,7 +1392,7 @@ QR =
el.innerHTML = null
$.add el, err
QR.open()
if /captcha|verification/i.test el.textContent
if qr.captchaIsEnabled and /captcha|verification/i.test el.textContent
# Focus the captcha input on captcha error.
$('[autocomplete]', QR.el).focus()
alert el.textContent if d.hidden or d.oHidden or d.mozHidden or d.webkitHidden
@ -1956,7 +1956,7 @@ QR =
if err
if /captcha|verification/i.test(err.textContent) or err is 'Connection error with sys.4chan.org.'
# Enable auto-post if we have some cached captchas.
QR.cooldown.auto = !!$.get('captchas', []).length
QR.cooldown.auto = if qr.captchaIsEnabled then !!$.get('captchas', []).length else true
# Too many frequent mistyped captchas will auto-ban you!
# On connection error, the post most likely didn't go through.
QR.cooldown.set 2