diff --git a/res/include/script/dependencies/UploadManager.js b/res/include/script/dependencies/UploadManager.js index 6003658..c2b6549 100644 --- a/res/include/script/dependencies/UploadManager.js +++ b/res/include/script/dependencies/UploadManager.js @@ -1,5 +1,5 @@ -function UploadManager(apiAddress, uploadsFinished) { - this.apiAddress = apiAddress; +function UploadManager(uploadEndpoint, uploadsFinished) { + this.uploadEndpoint = uploadEndpoint; // Callback function for when the queue is empty this.uploadsFinished = uploadsFinished; @@ -99,11 +99,10 @@ UploadManager.prototype.uploadThread = function() { console.debug("Starting upload of " + job.name); let form = new FormData(); - form.append("name", job.name); form.append('file', job.file); let xhr = new XMLHttpRequest(); - xhr.open("POST", this.apiAddress + "/file", true); + xhr.open("POST", this.uploadEndpoint, true); xhr.timeout = 21600000; // 6 hours, to account for slow connections // Report progress updates back to the caller diff --git a/res/include/script/history.js b/res/include/script/history.js index f35b496..580b18e 100644 --- a/res/include/script/history.js +++ b/res/include/script/history.js @@ -31,10 +31,9 @@ let uploadsStr = localStorage.getItem("uploaded_files") if (uploadsStr === null) { uploadsStr = "" } let uploads = Array() - if (uploadsStr != "") { - uploadsStr = uploadsStr.slice(0, -1) // Strip the trailing comma - uploads = uploadsStr.split(",") + // Strip the trailing comma + uploads = uploadsStr.slice(0, -1).split(",") } // Get the uploads from a cookie diff --git a/res/include/script/homepage.js b/res/include/script/homepage.js index a74ce7f..a8c90fc 100644 --- a/res/include/script/homepage.js +++ b/res/include/script/homepage.js @@ -75,7 +75,7 @@ let shareLink = "" function handleUploads(files) { if (uploader === null){ - uploader = new UploadManager(apiEndpoint, uploadsFinished) + uploader = new UploadManager(apiEndpoint+"/file", uploadsFinished) } if (files.length === 0) { diff --git a/res/include/script/textupload.js b/res/include/script/textupload.js index e50cb4f..dee090e 100644 --- a/res/include/script/textupload.js +++ b/res/include/script/textupload.js @@ -9,7 +9,7 @@ function uploadText() { return; } - new UploadManager(apiEndpoint, null).addFile( + new UploadManager(apiEndpoint+"/file", null).addFile( blob, filename, null, diff --git a/res/include/style/layout.css b/res/include/style/layout.css index 2299abc..6e165c7 100644 --- a/res/include/style/layout.css +++ b/res/include/style/layout.css @@ -296,33 +296,6 @@ pre{ font-size: 1.8em; } -.progress_bar{ - position: relative; - width: 100%; - height: 0; - background-color: #555; - overflow: hidden; - color: #eeeeee; - text-align: left; - white-space: nowrap; -} -.progressbar_inner{ - position: absolute; - top: 0; - width: 0%; - left: 0; - height: 100%; - background-color: var(--highlight_color);; - overflow: hidden; - color: #000; - white-space: nowrap; -} -.progress_text{ - overflow: hidden; - width: 100%; - white-space: nowrap; -} - .file_button{ position: relative; box-sizing: border-box;