Add Flash tag to File Info Formatting.

This commit is contained in:
ccd0 2015-04-25 17:57:33 -07:00
parent d0dbf76c08
commit 82b39a4fdf
5 changed files with 5 additions and 1 deletions

View File

@ -742,7 +742,7 @@ Config =
backlink: '>>%id'
fileInfo: '%l (%p%s, %r)'
fileInfo: '%l (%p%s, %r%g)'
favicon: 'ferongr'

View File

@ -462,6 +462,7 @@ Settings =
isImage: true
isVideo: false
isSpoiler: true
tag: 'Loop'
FileInfo.format @value, data, @nextElementSibling
favicon: ->

View File

@ -64,6 +64,7 @@
<div>Spoiler indicator: <code>%p</code></div>
<div>Size: <code>%B</code> (Bytes), <code>%K</code> (KB), <code>%M</code> (MB), <code>%s</code> (4chan default)</div>
<div>Resolution: <code>%r</code> (Displays &#039;PDF&#039; for PDF files)</div>
<div>Tag: <code>%g</code>
<div>Literal <code>%</code>: <code>%%</code></div>
</fieldset>

View File

@ -182,6 +182,7 @@ class Post
isImage: /(jpg|png|gif)$/i.test link.href
isVideo: /webm$/i.test link.href
dimensions: info[0].match(/\d+x\d+/)?[0]
tag: info[0].match(/, ([a-z]+)\)/i)?[1]
size = +@file.size.match(/[\d.]+/)[0]
unit = ['B', 'KB', 'MB', 'GB'].indexOf @file.size.match(/\w+$/)[0]
size *= 1024 while unit-- > 0

View File

@ -46,4 +46,5 @@ FileInfo =
K: -> <%= html('${Math.round(this.file.sizeInBytes/1024)} KB') %>
M: -> <%= html('${Math.round(this.file.sizeInBytes/1048576*100)/100} MB') %>
r: -> <%= html('${this.file.dimensions || "PDF"}') %>
g: -> <%= html('?{this.file.tag}{, ${this.file.tag}}{}') %>
'%': -> <%= html('%') %>