make cooldown optional, disabled by default

This commit is contained in:
James Campos 2011-05-02 23:05:53 -07:00
parent a88553e4a2
commit 5ce349fee1
2 changed files with 36 additions and 25 deletions

View File

@ -72,6 +72,7 @@
'Anonymize': [false, 'Make everybody anonymous'],
'Auto Watch': [true, 'Automatically watch threads that you start'],
'Comment Expansion': [true, 'Expand too long comments'],
'Cooldown': [false, 'Prevent \'flood detected\' errors (buggy)'],
'Image Auto-Gif': [false, 'Animate gif thumbnails'],
'Image Expansion': [true, 'Expand images'],
'Image Hover': [false, 'Show full image on mouseover'],
@ -1000,8 +1001,10 @@
$.remove(dialog);
}
}
if ($.config('Cooldown')) {
qr.cooldown(true);
}
}
Recaptcha.reload();
return $('iframe[name=iframe]').src = 'about:blank';
},
@ -1024,6 +1027,7 @@
$.remove(span);
}
}
if ($.config('Cooldown')) {
if (qr.cooldown()) {
e.preventDefault();
alert('Stop posting so often!');
@ -1036,6 +1040,7 @@
}
return;
}
}
recaptcha = $('input[name=recaptcha_response_field]', this);
if (recaptcha.value) {
qr.sage = $('input[name=email]', form).value === 'sage';
@ -2125,7 +2130,9 @@
$.addStyle(main.css);
Recaptcha.init();
$.bind($('form[name=post]'), 'submit', qr.cb.submit);
if ($.config('Cooldown')) {
qr.cooldown();
}
if ($.config('Image Expansion')) {
imgExpand.init();
}

View File

@ -16,6 +16,7 @@ config =
'Anonymize': [false, 'Make everybody anonymous']
'Auto Watch': [true, 'Automatically watch threads that you start']
'Comment Expansion': [true, 'Expand too long comments']
'Cooldown': [false, 'Prevent \'flood detected\' errors (buggy)']
'Image Auto-Gif': [false, 'Animate gif thumbnails']
'Image Expansion': [true, 'Expand images']
'Image Hover': [false, 'Show full image on mouseover']
@ -754,6 +755,7 @@ qr =
qr.refresh dialog
else
$.remove dialog
if $.config 'Cooldown'
qr.cooldown true
Recaptcha.reload()
@ -772,6 +774,7 @@ qr =
if span = @nextSibling
$.remove span
if $.config 'Cooldown'
# check if we've posted on this board in another tab
if qr.cooldown()
e.preventDefault()
@ -1639,9 +1642,10 @@ main =
$.bind $('form[name=post]'), 'submit', qr.cb.submit
#major features
if $.config 'Cooldown'
qr.cooldown()
#major features
if $.config 'Image Expansion'
imgExpand.init()