From 7ea4a5243342ed9cd3fbc6b53a82bc31aaeb3038 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 15 Sep 2012 04:39:24 +0200 Subject: [PATCH] some fixes --- 4chan_x.user.js | 9 +++++++-- script.coffee | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index b2911bd25..6d495470f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -793,6 +793,9 @@ } for (_l = 0, _len3 = quotelinks.length; _l < _len3; _l++) { quotelink = quotelinks[_l]; + if ($.hasClass(quotelink, 'deadlink')) { + continue; + } if (Get.postDataFromLink(quotelink).postID === this.ID) { $.add(quotelink, $.tn('\u00A0(Dead)')); } @@ -1681,7 +1684,7 @@ href: Redirect.thread(board, 0, ID), className: 'deadlink', target: '_blank', - textContent: this.isDead ? quote : "" + quote + "\u00A0(Dead)" + textContent: "" + quote + "\u00A0(Dead)" }); if (Redirect.post(board, ID)) { $.addClass(a, 'quotelink'); @@ -1692,7 +1695,9 @@ if (this.quotes.indexOf(quoteID) === -1) { this.quotes.push(quoteID); } - this.nodes.quotelinks.push(a); + if ($.hasClass(a, 'quotelink')) { + this.nodes.quotelinks.push(a); + } nodes.push(a); data = data.slice(index + quote.length); } diff --git a/script.coffee b/script.coffee index 0e50b2e4c..53942ea63 100644 --- a/script.coffee +++ b/script.coffee @@ -636,6 +636,7 @@ class Post for post in [post].concat post.clones quotelinks.push.apply quotelinks, Array::slice.call post.nodes.backlinks for quotelink in quotelinks + continue if $.hasClass quotelink, 'deadlink' if Get.postDataFromLink(quotelink).postID is @ID $.add quotelink, $.tn '\u00A0(Dead)' return @@ -1629,9 +1630,7 @@ Quotify = href: Redirect.thread board, 0, ID className: 'deadlink' target: '_blank' - # Don't (Dead) when quotifying in an archived post, - # and we don't know anything about the post. - textContent: if @isDead then quote else "#{quote}\u00A0(Dead)" + textContent: "#{quote}\u00A0(Dead)" if Redirect.post board, ID $.addClass a, 'quotelink' a.setAttribute 'data-board', board @@ -1639,7 +1638,8 @@ Quotify = if @quotes.indexOf(quoteID) is -1 @quotes.push quoteID - @nodes.quotelinks.push a + if $.hasClass a, 'quotelink' + @nodes.quotelinks.push a nodes.push a data = data[index + quote.length..]