Implement 'Remove Original Link' option. #364
This commit is contained in:
parent
f0be015897
commit
7c5a4708dc
@ -64,6 +64,11 @@ Config =
|
|||||||
true
|
true
|
||||||
'Reformat the file information.'
|
'Reformat the file information.'
|
||||||
]
|
]
|
||||||
|
'Remove Original Link': [
|
||||||
|
false
|
||||||
|
'Remove the original file link rather than hiding it. May cause incompatibilities with other scripts.'
|
||||||
|
1
|
||||||
|
]
|
||||||
'Thread Expansion': [
|
'Thread Expansion': [
|
||||||
true
|
true
|
||||||
'Add buttons to expand threads.'
|
'Add buttons to expand threads.'
|
||||||
|
|||||||
@ -8,15 +8,22 @@ FileInfo =
|
|||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
return if !@file or @isClone
|
return if !@file or @isClone
|
||||||
@file.link.previousSibling.nodeValue = ''
|
|
||||||
@file.link.hidden = true
|
|
||||||
{nextSibling} = @file.link
|
|
||||||
wrapper = $.el 'span', {hidden: true}
|
|
||||||
$.replace nextSibling, wrapper
|
|
||||||
$.add wrapper, nextSibling
|
|
||||||
info = $.el 'span', className: 'file-info'
|
info = $.el 'span', className: 'file-info'
|
||||||
FileInfo.format Conf['fileInfo'], @, info
|
FileInfo.format Conf['fileInfo'], @, info
|
||||||
$.after wrapper, info
|
|
||||||
|
if Conf['Remove Original Link'] and not (@board.ID is 'f' and Conf['Enable Native Flash Embedding'])
|
||||||
|
{parentNode} = @file.link
|
||||||
|
$.rmAll parentNode
|
||||||
|
$.add parentNode, info
|
||||||
|
else
|
||||||
|
@file.link.previousSibling.nodeValue = ''
|
||||||
|
@file.link.hidden = true
|
||||||
|
{nextSibling} = @file.link
|
||||||
|
wrapper = $.el 'span', {hidden: true}
|
||||||
|
$.replace nextSibling, wrapper
|
||||||
|
$.add wrapper, nextSibling
|
||||||
|
$.after wrapper, info
|
||||||
|
|
||||||
format: (formatString, post, outputNode) ->
|
format: (formatString, post, outputNode) ->
|
||||||
output = []
|
output = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user