Add the filesize in QR thumnbails' title.
This commit is contained in:
parent
414846c1df
commit
431bcf6ee1
@ -477,7 +477,7 @@
|
|||||||
size /= 1024;
|
size /= 1024;
|
||||||
unit++;
|
unit++;
|
||||||
}
|
}
|
||||||
size = unit > 1 ? Math.round(a * 100) / 100 : Math.round(size);
|
size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size);
|
||||||
return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit];
|
return "" + size + " " + ['B', 'KB', 'MB', 'GB'][unit];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1692,7 +1692,7 @@
|
|||||||
var fileUrl, img, url,
|
var fileUrl, img, url,
|
||||||
_this = this;
|
_this = this;
|
||||||
this.file = file;
|
this.file = file;
|
||||||
this.el.title = file.name;
|
this.el.title = "" + file.name + " (" + ($.bytesToString(file.size)) + ")";
|
||||||
if (QR.spoiler) {
|
if (QR.spoiler) {
|
||||||
$('label', this.el).hidden = false;
|
$('label', this.el).hidden = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -366,7 +366,7 @@ $.extend $,
|
|||||||
if unit > 1
|
if unit > 1
|
||||||
# Keep the size as a float if the size is greater than 2^20 B.
|
# Keep the size as a float if the size is greater than 2^20 B.
|
||||||
# Round to hundredth.
|
# Round to hundredth.
|
||||||
Math.round(a * 100) / 100
|
Math.round(size * 100) / 100
|
||||||
else
|
else
|
||||||
# Round to an integer otherwise.
|
# Round to an integer otherwise.
|
||||||
Math.round size
|
Math.round size
|
||||||
@ -1261,7 +1261,7 @@ QR =
|
|||||||
|
|
||||||
QR.replies.push @
|
QR.replies.push @
|
||||||
setFile: (@file) ->
|
setFile: (@file) ->
|
||||||
@el.title = file.name
|
@el.title = "#{file.name} (#{$.bytesToString file.size})"
|
||||||
$('label', @el).hidden = false if QR.spoiler
|
$('label', @el).hidden = false if QR.spoiler
|
||||||
if file.type is 'application/pdf'
|
if file.type is 'application/pdf'
|
||||||
@el.style.backgroundImage = null
|
@el.style.backgroundImage = null
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user