Implement 'Open Threads in New Tab'. #149
This commit is contained in:
parent
5eb577ac56
commit
7403698720
@ -15,6 +15,10 @@ Config =
|
||||
'Show a notice at the top of the page when the index is refreshed.'
|
||||
1
|
||||
]
|
||||
'Open Threads in New Tab': [
|
||||
false
|
||||
'Make links to threads in the index / <%= meta.name %> catalog open in a new tab.'
|
||||
]
|
||||
'External Catalog': [
|
||||
false
|
||||
'Link to external catalog instead of the internal one.'
|
||||
|
||||
@ -379,6 +379,7 @@ Main =
|
||||
['Color User IDs', IDColor]
|
||||
['Highlight by User ID', IDHighlight]
|
||||
['Custom CSS', CustomCSS]
|
||||
['Thread Links', ThreadLinks]
|
||||
['Linkify', Linkify]
|
||||
['Reveal Spoilers', RemoveSpoilers]
|
||||
['Resurrect Quotes', Quotify]
|
||||
|
||||
20
src/Miscellaneous/ThreadLinks.coffee
Normal file
20
src/Miscellaneous/ThreadLinks.coffee
Normal file
@ -0,0 +1,20 @@
|
||||
ThreadLinks =
|
||||
init: ->
|
||||
return unless g.VIEW is 'index' and Conf['Open Threads in New Tab']
|
||||
|
||||
Post.callbacks.push
|
||||
name: 'Thread Links'
|
||||
cb: @node
|
||||
CatalogThread.callbacks.push
|
||||
name: 'Thread Links'
|
||||
cb: @catalogNode
|
||||
|
||||
node: ->
|
||||
return if @isReply or @isClone
|
||||
ThreadLinks.process $('.replylink', @nodes.info)
|
||||
|
||||
catalogNode: ->
|
||||
ThreadLinks.process @nodes.thumb.parentNode
|
||||
|
||||
process: (link) ->
|
||||
link.target = '_blank'
|
||||
Loading…
x
Reference in New Issue
Block a user