Simplify File Info Formatting.

- Original file info always goes after reformatted file info so DownThemAll works.
- Drop "Remove Original Link" option; no longer needed.
- Reformatted file info goes outside span.fileText on /f/, leaving original as first, so embedding works.
This commit is contained in:
ccd0 2015-03-23 05:58:56 -07:00
parent 6dcfd8709a
commit b1feb2c0c2
3 changed files with 7 additions and 19 deletions

View File

@ -64,11 +64,6 @@ 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.'

View File

@ -946,6 +946,7 @@ span.hide-announcement {
}
/* File */
.original-file-info,
.fnswitch:hover > .fntrunc,
.fnswitch:not(:hover) > .fnfull,
.expanded-image > .post > .file > .fileThumb > video[data-md5],

View File

@ -9,21 +9,13 @@ FileInfo =
node: ->
return if !@file or @isClone
info = $.el 'span', className: 'file-info'
FileInfo.format Conf['fileInfo'], @, info
oldInfo = $.el 'span', {className: 'original-file-info'}
$.prepend @file.link.parentNode, oldInfo
$.add oldInfo, [@file.link.previousSibling, @file.link, @file.link.nextSibling]
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
info = $.el 'span', {className: 'file-info'}
FileInfo.format Conf['fileInfo'], @, info
$.prepend @file.text, info
format: (formatString, post, outputNode) ->
output = []