QR error checking fix.

This commit is contained in:
Nicolas Stepien 2011-10-28 17:32:38 +02:00
parent 0400ecb42f
commit 71cac4e7f6
2 changed files with 13 additions and 4 deletions

View File

@ -1718,6 +1718,7 @@
},
sys: function() {
var recaptcha;
$.unbind(d, 'DOMContentLoaded', QR.sys);
if (recaptcha = $('#recaptcha_response_field')) {
$.bind(recaptcha, 'keydown', QR.keydown);
return;
@ -2955,7 +2956,11 @@
init: function() {
var cutoff, hiddenThreads, id, lastChecked, now, pathname, temp, timestamp, _ref;
if (location.hostname === 'sys.4chan.org') {
QR.sys();
if (d.body) {
QR.sys();
} else {
$.bind(d, 'DOMContentLoaded', QR.sys);
}
return;
}
$.bind(window, 'message', Main.message);
@ -3040,7 +3045,7 @@
},
onLoad: function() {
var nodes;
$.unbind(document, 'DOMContentLoaded', Main.onLoad);
$.unbind(d, 'DOMContentLoaded', Main.onLoad);
if (conf['404 Redirect'] && d.title === '4chan - 404' && /^\d+$/.test(g.THREAD_ID)) {
redirect();
return;

View File

@ -1288,6 +1288,7 @@ QR =
if $('img.favicon', op).src is Favicon.empty
watcher.watch op, id
sys: ->
$.unbind d, 'DOMContentLoaded', QR.sys
if recaptcha = $ '#recaptcha_response_field' #post reporting
$.bind recaptcha, 'keydown', QR.keydown
return
@ -2237,7 +2238,10 @@ firstRun =
Main =
init: ->
if location.hostname is 'sys.4chan.org'
QR.sys()
if d.body
QR.sys()
else
$.bind d, 'DOMContentLoaded', QR.sys
return
$.bind window, 'message', Main.message
@ -2322,7 +2326,7 @@ Main =
$.bind d, 'DOMContentLoaded', Main.onLoad
onLoad: ->
$.unbind document, 'DOMContentLoaded', Main.onLoad
$.unbind d, 'DOMContentLoaded', Main.onLoad
if conf['404 Redirect'] and d.title is '4chan - 404' and /^\d+$/.test g.THREAD_ID
redirect()
return