diff --git a/4chan_x.user.js b/4chan_x.user.js index 6e1e06e32..e0c748e12 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1829,27 +1829,16 @@ }; quoteBacklink = { init: function() { - var span, _i, _len, _ref; - _ref = $$('span[id^=no]'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - span = _ref[_i]; - $.after(span, $.el('span', { - className: 'container' - })); - } return g.callbacks.push(quoteBacklink.node); }, node: function(root) { - var container, el, id, link, opbl, qid, quote, quotes, _i, _len, _ref, _results; + var el, id, link, opbl, qid, quote, quotes, _i, _len, _ref, _results; if (/inline/.test(root.className)) { return; } - if (!$('.container', root)) { - container = $.el('span', { - className: 'container' - }); - $.after($('span[id^=no]', root), container); - } + $.after($('span[id^=no]', root), $.el('span', { + className: 'container' + })); id = root.id || $('td[id]', root).id; quotes = {}; opbl = $.config('OP Backlinks'); diff --git a/script.coffee b/script.coffee index c685a810a..504d82593 100644 --- a/script.coffee +++ b/script.coffee @@ -1440,19 +1440,17 @@ titlePost = quoteBacklink = init: -> - for span in $$('span[id^=no]') - $.after span, $.el 'span', className: 'container' g.callbacks.push quoteBacklink.node + node: (root) -> return if /inline/.test root.className - unless $ '.container', root - container = $.el 'span', - className: 'container' - $.after $('span[id^=no]', root), container + $.after $('span[id^=no]', root), $.el 'span', className: 'container' + # op or reply id = root.id or $('td[id]', root).id quotes = {} opbl = $.config 'OP Backlinks' for quote in $$ 'a.quotelink', root + #don't process >>>/b/ continue unless qid = quote.hash[1..] #duplicate quotes get overwritten quotes[qid] = quote