diff --git a/4chan_x.user.js b/4chan_x.user.js index 6b20af99b..f4f3a10cf 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2203,6 +2203,13 @@ $.before(input, favicon); } watcher.refresh(); + if (conf['Auto Watch']) { + if (!g.REPLY) { + $('.postarea form').action += '?watch'; + } else if (/watch/.test(location.search) && $('img.favicon').src === Favicon.empty) { + watcher.watch(null, g.THREAD_ID); + } + } return $.bind(window, 'storage', function(e) { if (e.key === ("" + NAMESPACE + "watched")) { return watcher.refresh(); @@ -3152,7 +3159,7 @@ return; } Favicon.halo = /ws/.test(Favicon["default"]) ? Favicon.haloSFW : Favicon.haloNSFW; - $('link[rel="shortcut icon"]', d.head).setAttribute('type', 'image/x-icon'); + $('link[rel="shortcut icon"]', d.head).type = 'image/x-icon'; g.hiddenReplies = $.get("hiddenReplies/" + g.BOARD + "/", {}); tzOffset = (new Date()).getTimezoneOffset() / 60; g.chanOffset = 5 - tzOffset; @@ -3211,7 +3218,7 @@ if (conf['Sauce']) { sauce.init(); } - if (conf['Reveal Spoilers']) { + if (conf['Reveal Spoilers'] && $('.postarea label')) { revealSpoilers.init(); } if (conf['Anonymize']) { @@ -3266,9 +3273,6 @@ if (conf['Reply Navigation']) { nav.init(); } - if (conf['Auto Watch'] && conf['Thread Watcher'] && /watch/.test(location.search) && $('img.favicon').src === Favicon.empty) { - watcher.watch(null, g.THREAD_ID); - } } else { if (conf['Index Navigation']) { nav.init(); @@ -3282,9 +3286,6 @@ if (conf['Comment Expansion']) { expandComment.init(); } - if (conf['Auto Watch']) { - $('.postarea form').action += '?watch'; - } } _ref3 = $$('div.op'); for (_i = 0, _len = _ref3.length; _i < _len; _i++) { diff --git a/script.coffee b/script.coffee index 50644e924..839db2b32 100644 --- a/script.coffee +++ b/script.coffee @@ -1796,6 +1796,12 @@ watcher = #populate watcher, display watch buttons watcher.refresh() + if conf['Auto Watch'] + unless g.REPLY + $('.postarea form').action += '?watch' + else if /watch/.test(location.search) and $('img.favicon').src is Favicon.empty + watcher.watch null, g.THREAD_ID + $.bind window, 'storage', (e) -> watcher.refresh() if e.key is "#{NAMESPACE}watched" refresh: -> @@ -2471,7 +2477,7 @@ main = return Favicon.halo = if /ws/.test Favicon.default then Favicon.haloSFW else Favicon.haloNSFW - $('link[rel="shortcut icon"]', d.head).setAttribute 'type', 'image/x-icon' + $('link[rel="shortcut icon"]', d.head).type = 'image/x-icon' g.hiddenReplies = $.get "hiddenReplies/#{g.BOARD}/", {} tzOffset = (new Date()).getTimezoneOffset() / 60 # GMT -8 is given as +480; would GMT +8 be -480 ? @@ -2528,7 +2534,7 @@ main = if conf['Sauce'] sauce.init() - if conf['Reveal Spoilers'] + if conf['Reveal Spoilers'] and $('.postarea label') revealSpoilers.init() if conf['Anonymize'] @@ -2583,10 +2589,6 @@ main = if conf['Reply Navigation'] nav.init() - if conf['Auto Watch'] and conf['Thread Watcher'] and - /watch/.test(location.search) and $('img.favicon').src is Favicon.empty - watcher.watch null, g.THREAD_ID - else #not reply if conf['Index Navigation'] nav.init() @@ -2600,9 +2602,6 @@ main = if conf['Comment Expansion'] expandComment.init() - if conf['Auto Watch'] - $('.postarea form').action += '?watch' - for op in $$ 'div.op' for callback in g.callbacks callback op