diff --git a/4chan_x.user.js b/4chan_x.user.js index 02353bd4b..3bc070944 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3058,7 +3058,7 @@ textContent: QuoteBacklink.funk(post.id) }); for (qid in quotes) { - if (!(el = $.id("pi" + qid)) || /\bop\b/.test(el.parentNode.className) && !Conf['OP Backlinks']) { + if (!(el = $.id("pi" + qid)) || !Conf['OP Backlinks'] && /\bop\b/.test(el.parentNode.className)) { continue; } link = a.cloneNode(true); @@ -3070,9 +3070,10 @@ } else { link.setAttribute('onclick', "replyhl('" + post.id + "');"); } - if (!((container = $('.container', el)) && container.parentNode === el)) { + if (!(container = $.id("blc" + qid))) { container = $.el('span', { - className: 'container' + className: 'container', + id: "blc" + qid }); $.add(el, container); } diff --git a/script.coffee b/script.coffee index 86709ada5..d17f69f19 100644 --- a/script.coffee +++ b/script.coffee @@ -2370,7 +2370,7 @@ QuoteBacklink = textContent: QuoteBacklink.funk post.id for qid of quotes # Don't backlink the OP. - continue if !(el = $.id "pi#{qid}") or /\bop\b/.test(el.parentNode.className) and !Conf['OP Backlinks'] + continue if !(el = $.id "pi#{qid}") or !Conf['OP Backlinks'] and /\bop\b/.test el.parentNode.className link = a.cloneNode true if Conf['Quote Preview'] $.on link, 'mouseover', QuotePreview.mouseover @@ -2378,8 +2378,10 @@ QuoteBacklink = $.on link, 'click', QuoteInline.toggle else link.setAttribute 'onclick', "replyhl('#{post.id}');" - unless (container = $ '.container', el) and container.parentNode is el - container = $.el 'span', className: 'container' + unless container = $.id "blc#{qid}" + container = $.el 'span', + className: 'container' + id: "blc#{qid}" $.add el, container $.add container, [$.tn(' '), link] return