From 4a5d77b5caf13460190713b071d95e1b7cdd6766 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 9 Feb 2016 01:06:26 -0800 Subject: [PATCH] Use the same test for checking whether links are cross-thread. --- src/Quotelinks/QuoteBacklink.coffee | 2 +- src/Quotelinks/QuoteInline.coffee | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Quotelinks/QuoteBacklink.coffee b/src/Quotelinks/QuoteBacklink.coffee index b3a1e4cbe..47401851a 100644 --- a/src/Quotelinks/QuoteBacklink.coffee +++ b/src/Quotelinks/QuoteBacklink.coffee @@ -39,7 +39,7 @@ QuoteBacklink = nodes = if container.firstChild then [$.tn(' '), link] else [link] if Conf['Quote Previewing'] $.on link, 'mouseover', QuotePreview.mouseover - if Conf['Quote Inlining'] and not (Conf['Inline Cross-thread Quotes Only'] and link.getAttribute('href')[0] is '#') + if Conf['Quote Inlining'] and not (Conf['Inline Cross-thread Quotes Only'] and not QuoteInline.isCrossThread(link)) $.on link, 'click', QuoteInline.toggle if Conf['Quote Hash Navigation'] hash = QuoteInline.qiQuote link, $.hasClass link, 'filtered' diff --git a/src/Quotelinks/QuoteInline.coffee b/src/Quotelinks/QuoteInline.coffee index c946ee8f3..c6b8b5a70 100644 --- a/src/Quotelinks/QuoteInline.coffee +++ b/src/Quotelinks/QuoteInline.coffee @@ -17,16 +17,16 @@ QuoteInline = return process: (link, clone) -> - return if ( - Conf['Inline Cross-thread Quotes Only'] and - link.pathname is location.pathname and - link.host is location.host and - link.protocol is location.protocol - ) + return if Conf['Inline Cross-thread Quotes Only'] and not QuoteInline.isCrossThread(link) if Conf['Quote Hash Navigation'] $.after link, QuoteInline.qiQuote link, $.hasClass link, 'filtered' unless clone $.on link, 'click', QuoteInline.toggle + isCrossThread: (link) -> + link.pathname isnt location.pathname or + link.host isnt location.host or + link.protocol isnt location.protocol + qiQuote: (link, hidden) -> name = "hashlink" name += " filtered" if hidden