From 61a87ca2f540f8ccd4fe9d09d152f3a65f352e84 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 29 Apr 2011 19:40:52 +0200 Subject: [PATCH 1/4] Fix thread related bugs when the OP is deleted. --- 4chan_x.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 9cebc826b..14eae83a1 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1177,7 +1177,7 @@ node = div.nextSibling; } node = node.nextElementSibling; - if (node.nodeName === 'SPAN') { + if (node.nodeName === 'SPAN' || 'IMG') { return threading.thread(node); } } diff --git a/script.coffee b/script.coffee index 6e0ea8b44..5559cca1d 100644 --- a/script.coffee +++ b/script.coffee @@ -914,7 +914,7 @@ threading = node = div.nextSibling node = node.nextElementSibling #skip text node - if node.nodeName is 'SPAN' + if node.nodeName is 'SPAN' or 'IMG' threading.thread node threadHiding = From e2fe3fe2943d8b5de8e585819069f3e11199919e Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 29 Apr 2011 20:49:43 +0200 Subject: [PATCH 2/4] That makes more sense. --- 4chan_x.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 14eae83a1..b8a083b40 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1177,7 +1177,7 @@ node = div.nextSibling; } node = node.nextElementSibling; - if (node.nodeName === 'SPAN' || 'IMG') { + if (node.nodeName === 'SPAN' || node.nodeName === 'IMG') { return threading.thread(node); } } diff --git a/script.coffee b/script.coffee index 5559cca1d..d7f5b96fe 100644 --- a/script.coffee +++ b/script.coffee @@ -914,7 +914,7 @@ threading = node = div.nextSibling node = node.nextElementSibling #skip text node - if node.nodeName is 'SPAN' or 'IMG' + if node.nodeName is 'SPAN' or node.nodeName is 'IMG' threading.thread node threadHiding = From 4538903ca7a54d3a042d92ca5f10bd6d220c0887 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 29 Apr 2011 21:35:51 +0200 Subject: [PATCH 3/4] Oh god what am I doing I'm not very good with computers. --- 4chan_x.js | 4 +++- script.coffee | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index b8a083b40..c2199f27e 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1178,7 +1178,9 @@ } node = node.nextElementSibling; if (node.nodeName === 'SPAN' || node.nodeName === 'IMG') { - return threading.thread(node); + if (!(node.align || node.nodeName === 'CENTER')) { + return threading.thread(node); + } } } }; diff --git a/script.coffee b/script.coffee index d7f5b96fe..77673b353 100644 --- a/script.coffee +++ b/script.coffee @@ -914,8 +914,11 @@ threading = node = div.nextSibling node = node.nextElementSibling #skip text node + #span.fileseze, img[alt="File deleted."] if node.nodeName is 'SPAN' or node.nodeName is 'IMG' - threading.thread node + #{N,}SFW + unless node.align or node.nodeName is 'CENTER' + threading.thread node threadHiding = init: -> From 5200cf620fa609e3813672c9ff842a8682872231 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 29 Apr 2011 21:58:26 +0200 Subject: [PATCH 4/4] Unlimited Selector Works. --- 4chan_x.js | 6 ++---- script.coffee | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index c2199f27e..4efb24132 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1177,10 +1177,8 @@ node = div.nextSibling; } node = node.nextElementSibling; - if (node.nodeName === 'SPAN' || node.nodeName === 'IMG') { - if (!(node.align || node.nodeName === 'CENTER')) { - return threading.thread(node); - } + if (!(node.align || node.nodeName === 'CENTER')) { + return threading.thread(node); } } }; diff --git a/script.coffee b/script.coffee index 77673b353..358f9d68f 100644 --- a/script.coffee +++ b/script.coffee @@ -914,11 +914,9 @@ threading = node = div.nextSibling node = node.nextElementSibling #skip text node - #span.fileseze, img[alt="File deleted."] - if node.nodeName is 'SPAN' or node.nodeName is 'IMG' - #{N,}SFW - unless node.align or node.nodeName is 'CENTER' - threading.thread node + #{N,}SFW + unless node.align or node.nodeName is 'CENTER' + threading.thread node threadHiding = init: ->