From 7318f592c84cddf566f8efbd04d1f7531e53f9cc Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Thu, 27 Feb 2025 08:32:26 +0100 Subject: [PATCH] use basename of uploaded file as default collection name, support https://github.com/Kozea/Radicale/issues/1633 --- radicale/web/internal_data/fn.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radicale/web/internal_data/fn.js b/radicale/web/internal_data/fn.js index 61492a34..a83a6edd 100644 --- a/radicale/web/internal_data/fn.js +++ b/radicale/web/internal_data/fn.js @@ -874,8 +874,7 @@ function UploadCollectionScene(user, password, collection) { upload_btn.onclick = upload_start; uploadfile_form.onchange = onfileschange; - let href = random_uuid(); - href_form.value = href; + href_form.value = ""; /** @type {?number} */ let scene_index = null; /** @type {?XMLHttpRequest} */ let upload_req = null; @@ -993,10 +992,12 @@ function UploadCollectionScene(user, password, collection) { hreflimitmsg_html.classList.remove("hidden"); href_form.classList.add("hidden"); href_label.classList.add("hidden"); + href_form.value = random_uuid(); // dummy, will be replaced on upload }else{ hreflimitmsg_html.classList.add("hidden"); href_form.classList.remove("hidden"); href_label.classList.remove("hidden"); + href_form.value = files[0].name.replace(/\.(ics|vcf)$/, ''); } return false; }