From 3ea6292204300919c3fb368f43ea55ca0bb0015c Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Fri, 5 Aug 2011 17:52:07 +0200 Subject: [PATCH] Fix 4chan X in closed threads. Close #221 --- 4chan_x.user.js | 8 ++++---- changelog | 1 + script.coffee | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 85f15f962..5e8437bf1 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2761,10 +2761,10 @@ if (g.REPLY && (id = location.hash.slice(1)) && /\d/.test(id[0]) && !$.id(id)) { scrollTo(0, d.body.scrollHeight); } - if (conf['Auto Noko']) { - $('.postarea form').action += '?noko'; + if (conf['Auto Noko'] && form) { + form.action += '?noko'; } - if (conf['Cooldown']) { + if (conf['Cooldown'] && form) { cooldown.init(); } if (conf['Image Expansion']) { @@ -2822,7 +2822,7 @@ if (conf['Image Preloading']) { imgPreloading.init(); } - if (conf['Quick Reply'] && conf['Persistent QR']) { + if (conf['Quick Reply'] && conf['Persistent QR'] && form) { qr.persist(); } if (conf['Post in Title']) { diff --git a/changelog b/changelog index e31f36c83..0d84eb562 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ github - mayhem: - fix post links in expanded threads + - fix 4chan X in closed threads - aeosynth: - only auto scroll focused tabs - quote inlining: only work on unmodified left-click diff --git a/script.coffee b/script.coffee index 865b67a0d..ebae9d5b2 100644 --- a/script.coffee +++ b/script.coffee @@ -2156,10 +2156,10 @@ main = if g.REPLY and (id = location.hash[1..]) and /\d/.test(id[0]) and !$.id(id) scrollTo 0, d.body.scrollHeight - if conf['Auto Noko'] - $('.postarea form').action += '?noko' + if conf['Auto Noko'] and form + form.action += '?noko' - if conf['Cooldown'] + if conf['Cooldown'] and form cooldown.init() if conf['Image Expansion'] @@ -2217,7 +2217,7 @@ main = if conf['Image Preloading'] imgPreloading.init() - if conf['Quick Reply'] and conf['Persistent QR'] + if conf['Quick Reply'] and conf['Persistent QR'] and form qr.persist() if conf['Post in Title']