]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/static/js/upload.js
move struct uploaded_file to webcit.h
[citadel.git] / webcit-ng / static / js / upload.js
index 39b9d018728861c56630ee84c234aff37003eab8..28c374edb114302bb8c3217ae21d3b96cbe44e57 100644 (file)
@@ -84,7 +84,9 @@ function upload_file(file) {
                        // Add these uploads to the displayed list
                        j_response.forEach((item) => {
                                let new_upl = document.createElement("li");
-                               new_upl.innerHTML = "Ref: " + item["ref"] + " , Filename: " + item["uploadfilename"] + " , Content-type: " + item["contenttype"] + " , Length: " + item["contentlength"];
+                               // item["ref"] is what we need
+                               new_upl.innerHTML = `<a href="xxx">❌</a>`
+                               + item["uploadfilename"] + " (" + item["contenttype"] + ", " + item["contentlength"] + " " + _("bytes") + ")";
                                document.getElementById("ctdl-upload_list").appendChild(new_upl);
                        });
 
@@ -107,7 +109,7 @@ function upload_file(file) {
        // Make an "uploading in progress" message appear in the uploads list!
        progress = document.createElement("li");
        progress.setAttribute("id", "ctdl_uploading_" + uploads_in_progress.toString());
-       progress.innerHTML = `<img src="/ctdl/s/images/throbber.gif" /> ` + _("Processing dropped files...");
+       progress.innerHTML = `<img src="/ctdl/s/images/dotcrawl.gif" /> ` + _("Processing dropped files...");
        document.getElementById("ctdl-upload_list").appendChild(progress);
 }
 
@@ -143,6 +145,10 @@ function show_or_hide_upload_window() {
 // Flush all uploaded files and close the window
 function flush_uploads() {
         document.getElementById('ctdl-upload').style.display='none';
+
         // FIXME tell the server to delete the files
+       uploads.forEach(u => {
+               console.log(u.ref);
+       });
         uploads=[];
 }