// 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);
});
// 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);
}
// 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=[];
}