diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 82ead9651..e654ff910 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -64,6 +64,11 @@ Config = true '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': [ true 'Add buttons to expand threads.' diff --git a/src/Miscellaneous/FileInfo.coffee b/src/Miscellaneous/FileInfo.coffee index f31f06043..29a738fc5 100755 --- a/src/Miscellaneous/FileInfo.coffee +++ b/src/Miscellaneous/FileInfo.coffee @@ -8,15 +8,22 @@ FileInfo = node: -> 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' 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) -> output = []