diff --git a/4chan_x.user.js b/4chan_x.user.js index 4b348f5ad..824fa3c7d 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -477,7 +477,7 @@ size /= 1024; 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]; } }); @@ -1692,7 +1692,7 @@ var fileUrl, img, url, _this = this; this.file = file; - this.el.title = file.name; + this.el.title = "" + file.name + " (" + ($.bytesToString(file.size)) + ")"; if (QR.spoiler) { $('label', this.el).hidden = false; } diff --git a/script.coffee b/script.coffee index 0dfe819ea..10c4869d7 100644 --- a/script.coffee +++ b/script.coffee @@ -366,7 +366,7 @@ $.extend $, if unit > 1 # Keep the size as a float if the size is greater than 2^20 B. # Round to hundredth. - Math.round(a * 100) / 100 + Math.round(size * 100) / 100 else # Round to an integer otherwise. Math.round size @@ -1261,7 +1261,7 @@ QR = QR.replies.push @ setFile: (@file) -> - @el.title = file.name + @el.title = "#{file.name} (#{$.bytesToString file.size})" $('label', @el).hidden = false if QR.spoiler if file.type is 'application/pdf' @el.style.backgroundImage = null