diff --git a/4chan_x.user.js b/4chan_x.user.js index 274e9b66a..f9141bc32 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -681,10 +681,10 @@ quote.pathname = "/" + g.BOARD + "/res/" + threadID; } } - quoteIndicators.node(bq); + $.replace(a.parentNode.parentNode, bq); if (conf['Quote Preview']) quotePreview.node(bq); if (conf['Quote Inline']) quoteInline.node(bq); - return $.replace(a.parentNode.parentNode, bq); + return quoteIndicators.node(bq); } }; @@ -3041,7 +3041,7 @@ } } else { qp.innerHTML = "Loading " + id + "..."; - threadID = this.pathname.split('/').pop() || $.x('ancestor::div', this).firstChild.id; + threadID = this.pathname.split('/').pop() || $.x('ancestor::div[@class="thread"]', this).firstChild.id; $.cache(this.pathname, (function() { return quotePreview.parse(this, id, threadID); })); @@ -3095,7 +3095,7 @@ node: function(root) { var path, quote, tid, _i, _len, _ref; if (root.className === 'inline') return; - tid = g.THREAD_ID || $.x('ancestor::div', root).firstChild.id; + tid = g.THREAD_ID || $.x('ancestor::div[@class="thread"]', root).firstChild.id; _ref = $$('.quotelink', root); for (_i = 0, _len = _ref.length; _i < _len; _i++) { quote = _ref[_i]; diff --git a/script.coffee b/script.coffee index 686fb6959..caba5ac8e 100644 --- a/script.coffee +++ b/script.coffee @@ -502,12 +502,12 @@ expandComment = for quote in $$ '.quotelink', bq if quote.getAttribute('href') is quote.hash quote.pathname = "/#{g.BOARD}/res/#{threadID}" - quoteIndicators.node bq + $.replace a.parentNode.parentNode, bq if conf['Quote Preview'] quotePreview.node bq if conf['Quote Inline'] quoteInline.node bq - $.replace a.parentNode.parentNode, bq + quoteIndicators.node bq expandThread = init: -> @@ -2398,7 +2398,7 @@ quotePreview = quote.className = 'forwardlink' else qp.innerHTML = "Loading #{id}..." - threadID = @pathname.split('/').pop() or $.x('ancestor::div', @).firstChild.id + threadID = @pathname.split('/').pop() or $.x('ancestor::div[@class="thread"]', @).firstChild.id $.cache @pathname, (-> quotePreview.parse @, id, threadID) ui.hover e $.on @, 'mousemove', ui.hover @@ -2439,7 +2439,7 @@ quoteIndicators = g.callbacks.push @node node: (root) -> return if root.className is 'inline' - tid = g.THREAD_ID or $.x('ancestor::div', root).firstChild.id + tid = g.THREAD_ID or $.x('ancestor::div[@class="thread"]', root).firstChild.id for quote in $$ '.quotelink', root if conf['Indicate OP quote'] and quote.hash[1..] is tid # \u00A0 is nbsp