support new thumbnail api

This commit is contained in:
2019-12-10 14:47:11 +01:00
parent dc744b65e4
commit 4c33b0841e
12 changed files with 149 additions and 91 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

View File

@@ -128,7 +128,7 @@ var ListNavigator = {
continue; // Thumbnail already loaded
}
var thumb = "/api/file/" + this.data[i].id + "/thumbnail";
var thumb = "/api/file/" + this.data[i].id + "/thumbnail?width=48&height=48";
var name = this.data[i].name;
var itemHtml = "<img src=\"" + thumb + "\" "

View File

@@ -34,22 +34,12 @@ $(document).ready(function () {
});
function historyAddItem(json) {
if(!json.success){
var uploadItem = "<div class=\"file_button\" >"
+ "<img src=\"/res/img/cross.png\" "
+ "alt=\"File has expired\" />"
+ "File has expired"
+ "</div>";
$("#uploadedFiles").append($(uploadItem).hide().fadeIn(400));
return;
}
if(!json.success){return;}
var date = new Date(json.date_upload);
var uploadItem = '<a href="/u/'+ json.id +'" target="_blank" class="file_button">'
+ '<img src="'+ apiEndpoint + json.thumbnail_href + '"'
+ '<img src="'+ apiEndpoint + json.thumbnail_href + '?width=80&height=80"'
+ "alt=\"" + json.name + "\" />"
+ '<span style="color: var(--highlight_color);">'+json.name+'</span>'
+ "<br/>"