Fix behavior of 'Inline Cross-thread Quotes Only' on backlinks to deleted posts, links to hidden posts. #825
This commit is contained in:
parent
e7fce8d0ac
commit
86cc721a56
@ -523,7 +523,7 @@ Config =
|
|||||||
]
|
]
|
||||||
'Inline Cross-thread Quotes Only': [
|
'Inline Cross-thread Quotes Only': [
|
||||||
false
|
false
|
||||||
'Only inline quote links when the posts are on another thread or board, or fetched from the archive.'
|
'Don\'t inline quote links when the posts are visible in the thread.'
|
||||||
1
|
1
|
||||||
]
|
]
|
||||||
'Quote Hash Navigation': [
|
'Quote Hash Navigation': [
|
||||||
|
|||||||
@ -39,7 +39,7 @@ QuoteBacklink =
|
|||||||
nodes = if container.firstChild then [$.tn(' '), link] else [link]
|
nodes = if container.firstChild then [$.tn(' '), link] else [link]
|
||||||
if Conf['Quote Previewing']
|
if Conf['Quote Previewing']
|
||||||
$.on link, 'mouseover', QuotePreview.mouseover
|
$.on link, 'mouseover', QuotePreview.mouseover
|
||||||
if Conf['Quote Inlining'] and not (Conf['Inline Cross-thread Quotes Only'] and not QuoteInline.isCrossThread(link))
|
if Conf['Quote Inlining']
|
||||||
$.on link, 'click', QuoteInline.toggle
|
$.on link, 'click', QuoteInline.toggle
|
||||||
if Conf['Quote Hash Navigation']
|
if Conf['Quote Hash Navigation']
|
||||||
hash = QuoteInline.qiQuote link, $.hasClass link, 'filtered'
|
hash = QuoteInline.qiQuote link, $.hasClass link, 'filtered'
|
||||||
|
|||||||
@ -17,16 +17,10 @@ QuoteInline =
|
|||||||
return
|
return
|
||||||
|
|
||||||
process: (link, clone) ->
|
process: (link, clone) ->
|
||||||
return if Conf['Inline Cross-thread Quotes Only'] and not QuoteInline.isCrossThread(link)
|
|
||||||
if Conf['Quote Hash Navigation']
|
if Conf['Quote Hash Navigation']
|
||||||
$.after link, QuoteInline.qiQuote link, $.hasClass link, 'filtered' unless clone
|
$.after link, QuoteInline.qiQuote link, $.hasClass link, 'filtered' unless clone
|
||||||
$.on link, 'click', QuoteInline.toggle
|
$.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) ->
|
qiQuote: (link, hidden) ->
|
||||||
name = "hashlink"
|
name = "hashlink"
|
||||||
name += " filtered" if hidden
|
name += " filtered" if hidden
|
||||||
@ -37,8 +31,11 @@ QuoteInline =
|
|||||||
|
|
||||||
toggle: (e) ->
|
toggle: (e) ->
|
||||||
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
||||||
e.preventDefault()
|
|
||||||
{boardID, threadID, postID} = Get.postDataFromLink @
|
{boardID, threadID, postID} = Get.postDataFromLink @
|
||||||
|
return if Conf['Inline Cross-thread Quotes Only'] and g.VIEW is 'thread' and g.posts["#{boardID}.#{postID}"]?.nodes.root.offsetParent # exists and not hidden
|
||||||
|
|
||||||
|
e.preventDefault()
|
||||||
quoter = Get.postFromNode @
|
quoter = Get.postFromNode @
|
||||||
{context} = quoter
|
{context} = quoter
|
||||||
if $.hasClass @, 'inlined'
|
if $.hasClass @, 'inlined'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user