Make file.size, file.sizeInBytes match Post class.

This commit is contained in:
ccd0 2015-04-12 23:01:27 -07:00
parent c2080e8629
commit 0847161bf5
3 changed files with 7 additions and 6 deletions

View File

@ -62,7 +62,8 @@ Build =
height: data.h
width: data.w
MD5: data.md5
size: data.fsize
size: $.bytesToString data.fsize
sizeInBytes: data.fsize
turl: "//i.4cdn.org/#{boardID}/#{data.tim}s.jpg"
theight: data.tn_h
twidth: data.tn_w
@ -108,7 +109,6 @@ Build =
if file
shortFilename = Build.shortFilename file.name
fileSize = $.bytesToString file.size
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.turl

View 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="${file.url}" target="_blank">${file.name}</a>
-(${fileSize}, ${fileDims}, ${file.tag})
-(${file.size}, ${fileDims}, ${file.tag})
</span></div>
}{
<div class="fileText" id="fT${postID}"?{file.isSpoiler}{ title="${file.name}"}>
@ -12,12 +12,12 @@
<a?{file.name === shortFilename || file.isSpoiler}{}{ title="${file.name}"} href="${file.url}" target="_blank">
?{file.isSpoiler}{Spoiler Image}{${shortFilename}}
</a>
(${fileSize}, ${fileDims})
(${file.size}, ${fileDims})
</div>
<a class="fileThumb?{file.isSpoiler}{ imgspoiler}{}" href="${file.url}" target="_blank">
<img
?{suppressThumb}{ data-src="${fileThumb}"}{ src="${fileThumb}"}
alt="${fileSize}"
alt="${file.size}"
data-md5="${file.MD5}"
style="height: ${file.isSpoiler ? 100 : file.theight}px; width: ${file.isSpoiler ? 100 : file.twidth}px;"
>

View File

@ -154,7 +154,8 @@ class Fetcher
height: data.media.media_h
width: data.media.media_w
MD5: data.media.media_hash
size: data.media.media_size
size: $.bytesToString data.media.media_size
sizeInBytes: data.media.media_size
turl: data.media.thumb_link or "//i.4cdn.org/#{@boardID}/#{data.media.preview_orig}"
theight: data.media.preview_h
twidth: data.media.preview_w