Fix support for the report window.

This commit is contained in:
Mayhem 2013-06-18 22:18:32 +02:00
parent 86b44f1c60
commit cf8b73eaf5
2 changed files with 13 additions and 6 deletions

View File

@ -5484,7 +5484,7 @@
Main = {
init: function() {
var key, path, pathname, settings, temp, val;
var asap, key, path, pathname, settings, temp, val;
Main.flatten(null, Config);
path = location.pathname;
pathname = path.slice(1).split('/');
@ -5504,10 +5504,13 @@
switch (location.hostname) {
case 'sys.4chan.org':
if (/report/.test(location.search)) {
$.ready(function() {
asap = function() {
var field, form;
if (!(field = $.id('recaptcha_response_field'))) {
setTimeout(asap, 200);
return;
}
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()';
@ -5522,7 +5525,8 @@
}
return form.submit();
});
});
};
asap();
}
return;
case 'images.4chan.org':

View File

@ -4434,9 +4434,11 @@ Main =
switch location.hostname
when 'sys.4chan.org'
if /report/.test location.search
$.ready ->
asap = ->
unless field = $.id 'recaptcha_response_field'
setTimeout asap, 200
return
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) ->
@ -4444,6 +4446,7 @@ Main =
response = field.value.trim()
field.value = "#{response} #{response}" unless /\s/.test response
form.submit()
asap()
return
when 'images.4chan.org'
$.ready ->