From bd250ba990e11016c4b112cb48dc637ecd5bec2f Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 7 Mar 2012 22:27:15 +0100 Subject: [PATCH] Ressurect quotes before QuoteInline/QuotePreview. Quote links of deleted posts will thus work as usual if the post has been fetched before its deletion. --- 4chan_x.user.js | 5 +++-- script.coffee | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index d6e631ca4..874f48609 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3439,7 +3439,8 @@ if (text = data.slice(0, index)) nodes.push($.tn(text)); nodes.push($.el('a', { textContent: "" + quote[0] + "\u00A0(Dead)", - href: "#" + quote[1] + href: "#" + quote[1], + className: $.id(quote[1]) ? 'quotelink' : null })); if (text = data.slice(index + quote[0].length)) nodes.push($.tn(text)); $.replace(node, nodes); @@ -3949,12 +3950,12 @@ if (conf['Image Auto-Gif']) AutoGif.init(); if (conf['Image Hover']) ImageHover.init(); if (conf['Report Button']) ReportButton.init(); + if (conf['Resurrect Quotes']) DeadQuotes.init(); if (conf['Quote Inline']) QuoteInline.init(); if (conf['Quote Preview']) QuotePreview.init(); if (conf['Quote Backlinks']) QuoteBacklink.init(); if (conf['Indicate OP quote']) QuoteOP.init(); if (conf['Indicate Cross-thread Quotes']) QuoteCT.init(); - if (conf['Resurrect Quotes']) DeadQuotes.init(); return $.ready(Main.ready); }, ready: function() { diff --git a/script.coffee b/script.coffee index 5878fae00..a7e884947 100644 --- a/script.coffee +++ b/script.coffee @@ -2835,6 +2835,7 @@ DeadQuotes = # \u00A0 is nbsp textContent: "#{quote[0]}\u00A0(Dead)" href: "##{quote[1]}" # Here be archive link + className: if $.id quote[1] then 'quotelink' else null if text = data[index + quote[0].length...] nodes.push $.tn text $.replace node, nodes @@ -3259,6 +3260,9 @@ Main = if conf['Report Button'] ReportButton.init() + if conf['Resurrect Quotes'] + DeadQuotes.init() + if conf['Quote Inline'] QuoteInline.init() @@ -3274,9 +3278,6 @@ Main = if conf['Indicate Cross-thread Quotes'] QuoteCT.init() - if conf['Resurrect Quotes'] - DeadQuotes.init() - $.ready Main.ready ready: ->