Add new sharing dialog to filesystem

This commit is contained in:
2025-06-05 21:29:07 +02:00
parent 9c8c9bb5f5
commit dd1a038bca
7 changed files with 232 additions and 68 deletions

View File

@@ -339,6 +339,15 @@ export const fs_share_url = (path: FSNode[]): string => {
return share_path
}
export const fs_share_hotlink_url = (path: FSNode[]): string => {
let share_path = fs_share_path(path)
if (share_path !== "") {
share_path = window.location.protocol + "//" + window.location.host + fs_path_url(share_path)
}
return share_path
}
export const fs_share_path = (path: FSNode[]): string => {
let share_url = ""
let bucket_idx = -1
@@ -373,6 +382,7 @@ export const fs_download = (node: FSNode) => {
a.download = node.name + ".zip"
}
a.click()
a.remove()
// You can't call .click() on an element that is not in the DOM. But
// emitting a click event works
a.dispatchEvent(new MouseEvent("click"))
}