From ec2cf130d10bffcad05b014ef2904b9b118f8d90 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 13 Mar 2012 23:51:55 +0100 Subject: [PATCH] Add target _blank to linkified dead quotes leading to archives. --- 4chan_x.user.js | 7 +++++-- script.coffee | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 296b72c54..fb18bdda8 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3342,7 +3342,7 @@ return g.callbacks.push(this.node); }, node: function(post) { - var board, className, data, href, i, id, index, m, node, nodes, quote, quotes, snapshot, text, _i, _len, _ref; + var board, className, data, href, i, id, index, m, node, nodes, quote, quotes, snapshot, target, text, _i, _len, _ref; if (post["class"] === 'inline') return; snapshot = d.evaluate('.//text()[not(parent::a)]', post.el.lastChild, null, 6, null); for (i = 0, _ref = snapshot.snapshotLength; 0 <= _ref ? i < _ref : i > _ref; 0 <= _ref ? i++ : i--) { @@ -3359,14 +3359,17 @@ if (board === g.BOARD && $.id(id)) { href = "#" + id; className = 'quotelink'; + target = null; } else { href = Redirect.thread(board, id, 'post'); className = 'deadlink'; + target = '_blank'; } nodes.push($.el('a', { textContent: "" + quote + "\u00A0(Dead)", href: href, - className: className + className: className, + target: target })); data = data.slice(index + quote.length); } diff --git a/script.coffee b/script.coffee index 70411ff72..b1c29b339 100644 --- a/script.coffee +++ b/script.coffee @@ -2808,15 +2808,18 @@ Quotify = if board is g.BOARD and $.id id href = "##{id}" className = 'quotelink' + target = null else href = Redirect.thread board, id, 'post' className = 'deadlink' + target = '_blank' nodes.push $.el 'a', # \u00A0 is nbsp textContent: "#{quote}\u00A0(Dead)" href: href className: className + target: target data = data[index + quote.length..]