From 71f03b8abe7c6f71da39527afabf3f587cd1aacc Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 6 Dec 2015 18:57:59 -0800 Subject: [PATCH] Implement 'Inline Cross-thread Quotes Only'. #513 --- src/General/Config.coffee | 5 +++++ src/Quotelinks/QuoteBacklink.coffee | 2 +- src/Quotelinks/QuoteInline.coffee | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index f9597c95a..e4b96ad28 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -516,6 +516,11 @@ Config = true 'Inline quoted post on click.' ] + 'Inline Cross-thread Quotes Only': [ + false + 'Only inline quote links when the posts are on another thread or board, or fetched from the archive.' + 1 + ] 'Quote Hash Navigation': [ false 'Include an extra link after quotes for autoscrolling to quoted posts.' diff --git a/src/Quotelinks/QuoteBacklink.coffee b/src/Quotelinks/QuoteBacklink.coffee index d83eaa4c2..1ee2036a4 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'] + if Conf['Quote Inlining'] and not (Conf['Inline Cross-thread Quotes Only'] and link.getAttribute('href')[0] is '#') $.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 482087cf2..bcfa798f7 100644 --- a/src/Quotelinks/QuoteInline.coffee +++ b/src/Quotelinks/QuoteInline.coffee @@ -17,6 +17,7 @@ QuoteInline = return process: (link, clone) -> + return if Conf['Inline Cross-thread Quotes Only'] and link.getAttribute('href')[0] is '#' if Conf['Quote Hash Navigation'] $.after link, QuoteInline.qiQuote link, $.hasClass link, 'filtered' unless clone $.on link, 'click', QuoteInline.toggle