diff --git a/public/global.js b/public/global.js index aa7f0339..f24d8673 100644 --- a/public/global.js +++ b/public/global.js @@ -939,6 +939,7 @@ function mainInit(){ }); } catch(e) { // TODO: Use a notice instead + console.log("e:",e); alert(e); } } @@ -952,11 +953,13 @@ function mainInit(){ let fileItem = document.createElement("label"); console.log("fileItem",fileItem); - let ext = getExt(filename) + let ext = getExt(filename); + // TODO: Push ImageFileExts to the client from the server in some sort of gen.js? + let isImage = ["png", "jpg", "jpeg", "svg", "bmp", "gif", "tif", "webp"].includes(ext); fileItem.innerText = "." + ext; fileItem.className = "formbutton uploadItem"; // TODO: Check if this is actually an image - fileItem.style.backgroundImage = "url("+e.target.result+")"; + if(isImage) fileItem.style.backgroundImage = "url("+e.target.result+")"; fileDock.appendChild(fileItem); },(e,hash, filename) => { @@ -976,6 +979,7 @@ function mainInit(){ }); } catch(e) { // TODO: Use a notice instead + console.log("e:",e); alert(e); } } diff --git a/templates/topics_quick_topic.html b/templates/topics_quick_topic.html index 2d511ed4..2d2c1195 100644 --- a/templates/topics_quick_topic.html +++ b/templates/topics_quick_topic.html @@ -18,7 +18,7 @@ {{if .CurrentUser.Perms.UploadFiles}} - +
{{end}} diff --git a/themes/nox/public/main.css b/themes/nox/public/main.css index 39c50a16..a69090d5 100644 --- a/themes/nox/public/main.css +++ b/themes/nox/public/main.css @@ -418,6 +418,9 @@ h2 { height: 100px; resize: vertical; } +.uploadItem { + display: inline-block; +} .more_topic_block_initial { display: none;