Fix support for the report window.
This commit is contained in:
parent
86b44f1c60
commit
cf8b73eaf5
@ -5484,7 +5484,7 @@
|
|||||||
|
|
||||||
Main = {
|
Main = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var key, path, pathname, settings, temp, val;
|
var asap, key, path, pathname, settings, temp, val;
|
||||||
Main.flatten(null, Config);
|
Main.flatten(null, Config);
|
||||||
path = location.pathname;
|
path = location.pathname;
|
||||||
pathname = path.slice(1).split('/');
|
pathname = path.slice(1).split('/');
|
||||||
@ -5504,10 +5504,13 @@
|
|||||||
switch (location.hostname) {
|
switch (location.hostname) {
|
||||||
case 'sys.4chan.org':
|
case 'sys.4chan.org':
|
||||||
if (/report/.test(location.search)) {
|
if (/report/.test(location.search)) {
|
||||||
$.ready(function() {
|
asap = function() {
|
||||||
var field, form;
|
var field, form;
|
||||||
|
if (!(field = $.id('recaptcha_response_field'))) {
|
||||||
|
setTimeout(asap, 200);
|
||||||
|
return;
|
||||||
|
}
|
||||||
form = $('form');
|
form = $('form');
|
||||||
field = $.id('recaptcha_response_field');
|
|
||||||
$.on(field, 'keydown', function(e) {
|
$.on(field, 'keydown', function(e) {
|
||||||
if (e.keyCode === 8 && !e.target.value) {
|
if (e.keyCode === 8 && !e.target.value) {
|
||||||
return window.location = 'javascript:Recaptcha.reload()';
|
return window.location = 'javascript:Recaptcha.reload()';
|
||||||
@ -5522,7 +5525,8 @@
|
|||||||
}
|
}
|
||||||
return form.submit();
|
return form.submit();
|
||||||
});
|
});
|
||||||
});
|
};
|
||||||
|
asap();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case 'images.4chan.org':
|
case 'images.4chan.org':
|
||||||
|
|||||||
@ -4434,9 +4434,11 @@ Main =
|
|||||||
switch location.hostname
|
switch location.hostname
|
||||||
when 'sys.4chan.org'
|
when 'sys.4chan.org'
|
||||||
if /report/.test location.search
|
if /report/.test location.search
|
||||||
$.ready ->
|
asap = ->
|
||||||
|
unless field = $.id 'recaptcha_response_field'
|
||||||
|
setTimeout asap, 200
|
||||||
|
return
|
||||||
form = $ 'form'
|
form = $ 'form'
|
||||||
field = $.id 'recaptcha_response_field'
|
|
||||||
$.on field, 'keydown', (e) ->
|
$.on field, 'keydown', (e) ->
|
||||||
window.location = 'javascript:Recaptcha.reload()' if e.keyCode is 8 and not e.target.value
|
window.location = 'javascript:Recaptcha.reload()' if e.keyCode is 8 and not e.target.value
|
||||||
$.on form, 'submit', (e) ->
|
$.on form, 'submit', (e) ->
|
||||||
@ -4444,6 +4446,7 @@ Main =
|
|||||||
response = field.value.trim()
|
response = field.value.trim()
|
||||||
field.value = "#{response} #{response}" unless /\s/.test response
|
field.value = "#{response} #{response}" unless /\s/.test response
|
||||||
form.submit()
|
form.submit()
|
||||||
|
asap()
|
||||||
return
|
return
|
||||||
when 'images.4chan.org'
|
when 'images.4chan.org'
|
||||||
$.ready ->
|
$.ready ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user