Add file.dimensions to Build.coffee object.
This commit is contained in:
parent
c1f62d1612
commit
27e8c59297
@ -69,6 +69,7 @@ Build =
|
||||
twidth: data.tn_w
|
||||
isSpoiler: !!data.spoiler
|
||||
tag: data.tag
|
||||
o.file.dimensions = "#{o.file.width}x#{o.file.height}" unless /\.pdf$/.test o.file.url
|
||||
Build.post o, suppressThumb
|
||||
post: (o, suppressThumb) ->
|
||||
###
|
||||
@ -111,7 +112,6 @@ Build =
|
||||
protocol = /^https?:(?=\/\/i\.4cdn\.org\/)/
|
||||
fileURL = file.url.replace protocol, ''
|
||||
shortFilename = Build.shortFilename file.name
|
||||
fileDims = if file.url[-4..] is '.pdf' then 'PDF' else "#{file.width}x#{file.height}"
|
||||
fileThumb = if file.isSpoiler then Build.spoilerThumb(boardID) else file.thumbURL.replace(protocol, '')
|
||||
|
||||
fileBlock = <%= importHTML('Build/File') %>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<div class="fileInfo"><span class="fileText" id="fT${postID}">
|
||||
File:
|
||||
<a data-width="${file.width}" data-height="${file.height}" href="${fileURL}" target="_blank">${file.name}</a>
|
||||
-(${file.size}, ${fileDims}, ${file.tag})
|
||||
-(${file.size}, ${file.dimensions}, ${file.tag})
|
||||
</span></div>
|
||||
}{
|
||||
<div class="fileText" id="fT${postID}"?{file.isSpoiler}{ title="${file.name}"}>
|
||||
@ -12,7 +12,7 @@
|
||||
<a?{file.name === shortFilename || file.isSpoiler}{}{ title="${file.name}"} href="${fileURL}" target="_blank">
|
||||
?{file.isSpoiler}{Spoiler Image}{${shortFilename}}
|
||||
</a>
|
||||
(${file.size}, ${fileDims})
|
||||
(${file.size}, ${file.dimensions || "PDF"})
|
||||
</div>
|
||||
<a class="fileThumb?{file.isSpoiler}{ imgspoiler}{}" href="${fileURL}" target="_blank">
|
||||
<img
|
||||
|
||||
@ -160,6 +160,7 @@ class Fetcher
|
||||
theight: data.media.preview_h
|
||||
twidth: data.media.preview_w
|
||||
isSpoiler: data.media.spoiler is '1'
|
||||
o.file.dimensions = "#{o.file.width}x#{o.file.height}" unless /\.pdf$/.test o.file.url
|
||||
o.file.tag = JSON.parse(data.media.exif).Tag if @boardID is 'f'
|
||||
|
||||
board = g.boards[@boardID] or
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user