diff --git a/4chan_x.js b/4chan_x.js index 34c96eb36..6b90a4b6a 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -2013,7 +2013,7 @@ }; main = { init: function() { - var DAY, callback, cutoff, hiddenThreads, id, lastChecked, navtopr, now, pathname, temp, timestamp, tzOffset, _i, _len, _ref2, _ref3; + var DAY, callback, cutoff, hiddenThreads, id, lastChecked, now, pathname, temp, timestamp, tzOffset, _i, _len, _ref2, _ref3; pathname = location.pathname.substring(1).split('/'); g.BOARD = pathname[0], temp = pathname[1]; if (temp === 'res') { @@ -2026,11 +2026,11 @@ qr.sys(); return; } - if (navtopr = $('#navtopr')) { - options.init(); - } else if ($.config('404 Redirect') && d.title === '4chan - 404' && /^\d+$/.test(g.THREAD_ID)) { + if ($.config('404 Redirect') && d.title === '4chan - 404' && /^\d+$/.test(g.THREAD_ID)) { redirect(); - } else { + return; + } + if (!$('#navtopr')) { return; } Favicon.halo = /ws/.test(Favicon["default"]) ? Favicon.haloSFW : Favicon.haloNSFW; @@ -2138,7 +2138,8 @@ callback = _ref3[_i]; callback(); } - return $.bind(d.body, 'DOMNodeInserted', nodeInserted); + $.bind(d.body, 'DOMNodeInserted', nodeInserted); + return options.init(); }, css: '\ /* dialog styling */\ diff --git a/script.coffee b/script.coffee index c35283639..f950145c9 100644 --- a/script.coffee +++ b/script.coffee @@ -1551,11 +1551,10 @@ main = if location.hostname is 'sys.4chan.org' qr.sys() return - if navtopr = $ '#navtopr' - options.init() - else if $.config('404 Redirect') and d.title is '4chan - 404' and /^\d+$/.test g.THREAD_ID + if $.config('404 Redirect') and d.title is '4chan - 404' and /^\d+$/.test g.THREAD_ID redirect() - else + return + if not $ '#navtopr' return Favicon.halo = if /ws/.test Favicon.default then Favicon.haloSFW else Favicon.haloNSFW @@ -1660,6 +1659,7 @@ main = callback() for callback in g.callbacks $.bind d.body, 'DOMNodeInserted', nodeInserted + options.init() css: ' /* dialog styling */