Recaptcha reload on backspace in the report window.

This commit is contained in:
Nicolas Stepien 2012-01-21 03:41:49 +01:00
parent ae8a99c53f
commit 8e64f1e877
3 changed files with 19 additions and 2 deletions

View File

@ -7,6 +7,7 @@
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/*
// @include http://images.4chan.org/*
// @include http://sys.4chan.org/*
// @run-at document-start
// @updateURL https://raw.github.com/MayhemYDG/4chan-x/stable/4chan_x.user.js
// @icon http://mayhemydg.github.com/4chan-x/favicon.gif
@ -3051,7 +3052,17 @@
g.PAGENUM = parseInt(temp) || 0;
}
if (location.hostname === 'sys.4chan.org') {
$.ready(qr.sys);
$.ready(function() {
if (/report/.test(location.search)) {
return $.on($('#recaptcha_response_field'), 'keydown', function(e) {
if (e.keyCode === 8 && !e.target.value) {
return window.location = 'javascript:Recaptcha.reload()';
}
});
} else {
}
});
return;
}
if (location.hostname === 'images.4chan.org') {

View File

@ -14,6 +14,7 @@ HEADER = """
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/*
// @include http://images.4chan.org/*
// @include http://sys.4chan.org/*
// @run-at document-start
// @updateURL https://raw.github.com/MayhemYDG/4chan-x/stable/4chan_x.user.js
// @icon http://mayhemydg.github.com/4chan-x/favicon.gif

View File

@ -2334,7 +2334,12 @@ Main =
g.PAGENUM = parseInt(temp) or 0
if location.hostname is 'sys.4chan.org'
$.ready qr.sys
$.ready ->
if /report/.test location.search
$.on $('#recaptcha_response_field'), 'keydown', (e) ->
window.location = 'javascript:Recaptcha.reload()' if e.keyCode is 8 and not e.target.value
else
# posting
return
if location.hostname is 'images.4chan.org'
$.ready -> redirect.init() if d.title is '4chan - 404'