This commit is contained in:
Nicolas Stepien 2012-09-02 15:11:11 +02:00
parent 6b4e55d727
commit 91b5a0ae67
3 changed files with 22 additions and 2 deletions

View File

@ -4930,11 +4930,23 @@
case 'sys.4chan.org':
if (/report/.test(location.search)) {
$.ready(function() {
return $.on($.id('recaptcha_response_field'), 'keydown', function(e) {
var field, form;
form = $('form');
field = $.id('recaptcha_response_field');
$.on(field, 'keydown', function(e) {
if (e.keyCode === 8 && !e.target.value) {
return window.location = 'javascript:Recaptcha.reload()';
}
});
return $.on(form, 'submit', function(e) {
var response;
e.preventDefault();
response = field.value.trim();
if (!/\s/.test(response)) {
field.value = "" + response + " " + response;
}
return form.submit();
});
});
}
return;

View File

@ -1,5 +1,6 @@
master
- Mayhem
One-word-captcha now works in the report window.
Fix duplicate file upload error link.
2.34.8

View File

@ -3855,8 +3855,15 @@ Main =
when 'sys.4chan.org'
if /report/.test location.search
$.ready ->
$.on $.id('recaptcha_response_field'), 'keydown', (e) ->
form = $ 'form'
field = $.id 'recaptcha_response_field'
$.on field, 'keydown', (e) ->
window.location = 'javascript:Recaptcha.reload()' if e.keyCode is 8 and not e.target.value
$.on form, 'submit', (e) ->
e.preventDefault()
response = field.value.trim()
field.value = "#{response} #{response}" unless /\s/.test response
form.submit()
return
when 'images.4chan.org'
$.ready ->