2020-01-27 16:56:16 +01:00
|
|
|
function FileViewer(viewer, file, next) {let v = this;
|
|
|
|
v.viewer = viewer;
|
|
|
|
v.file = file;
|
|
|
|
v.next = next;
|
2020-01-21 15:33:09 +01:00
|
|
|
|
2020-01-27 16:56:16 +01:00
|
|
|
v.container = document.createElement("div");
|
|
|
|
v.container.classList = "image-container";
|
|
|
|
v.container.appendChild(document.createElement("br"));
|
2020-01-21 15:33:09 +01:00
|
|
|
|
2020-01-27 16:56:16 +01:00
|
|
|
v.icon = document.createElement("img");
|
|
|
|
v.icon.src = apiEndpoint+"/"+file.thumbnail_href;
|
|
|
|
v.container.appendChild(v.icon);
|
2020-01-21 15:33:09 +01:00
|
|
|
|
2020-01-27 16:56:16 +01:00
|
|
|
v.container.appendChild(document.createElement("br"));
|
|
|
|
v.container.appendChild(document.createTextNode(file.name));
|
|
|
|
v.container.appendChild(document.createElement("br"));
|
|
|
|
v.container.appendChild(document.createTextNode("Type: "+file.mime_type));
|
|
|
|
v.container.appendChild(document.createElement("br"));
|
|
|
|
v.container.appendChild(document.createElement("br"));
|
|
|
|
v.container.appendChild(document.createTextNode(
|
|
|
|
"Press the 'Download' button in the menu to download this file"
|
|
|
|
));
|
|
|
|
}
|
2020-01-21 15:33:09 +01:00
|
|
|
|
2020-01-27 16:56:16 +01:00
|
|
|
FileViewer.prototype.render = function(parent) {let v = this;
|
|
|
|
parent.appendChild(v.container);
|
2020-01-21 15:33:09 +01:00
|
|
|
}
|