);
if (response.ok) { // If the server accepted the delete, remove it from the screen
- // FIXME do the delete
+ console.log("server deleted " + ref);
+ var el = document.getElementById(ref);
+ el.parentNode.removeChild(el);
}
}
// Add these uploads to the displayed list
j_response.forEach((item) => {
let new_upl = document.createElement("li");
- // item["ref"] is what we need
+ new_upl.setAttribute("id", item["ref"]); // set the element id to the upload reference
new_upl.innerHTML = `<i class="fa-solid fa-circle-xmark" style="color:red" onClick="delete_upload('` + item["ref"] + `')"></i>`
+ ` `
+ item["uploadfilename"] + " (" + item["contenttype"] + ", " + item["contentlength"] + " " + _("bytes") + ")";