display the size of the attachment in the preview

instead of adding it during post processing
This commit is contained in:
Régis Hanol
2013-07-14 12:28:24 +02:00
parent 6f2ce93ab2
commit 3397c2235f
21 changed files with 197 additions and 25 deletions

View File

@ -88,6 +88,7 @@ test("isAuthorizedUpload", function() {
var getUploadMarkdown = function(filename) {
return utils.getUploadMarkdown({
original_filename: filename,
filesize: 42,
width: 100,
height: 200,
url: "/upload/123/abcdef.ext"
@ -96,7 +97,7 @@ var getUploadMarkdown = function(filename) {
test("getUploadMarkdown", function() {
ok(getUploadMarkdown("lolcat.gif") === '<img src="/upload/123/abcdef.ext" width="100" height="200">');
ok(getUploadMarkdown("important.txt") === '<a class="attachment" href="/upload/123/abcdef.ext">important.txt</a>');
ok(getUploadMarkdown("important.txt") === '<a class="attachment" href="/upload/123/abcdef.ext">important.txt</a><span class="size">(42 Bytes)</span>');
});
test("isAnImage", function() {