Files
fnx_web/res/include/script/file_viewer/viewer_scripts/FileViewer.js

28 lines
998 B
JavaScript
Raw Normal View History

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