UI: Add copy to clipboard button to URL displays
This commit is contained in:
@@ -168,6 +168,7 @@ export class CollectionsScene {
|
||||
/** @type {HTMLElement} */ let edit_btn = get_element(node, "[data-name=edit]");
|
||||
/** @type {HTMLElement} */ let share_btn = get_element(node, "[data-name=share]");
|
||||
/** @type {HTMLAnchorElement} */ let download_btn = /** @type {HTMLAnchorElement} */ (get_element(node, "[data-name=download]"));
|
||||
/** @type {HTMLButtonElement} */ let copy_btn = /** @type {HTMLButtonElement} */ (get_element(node, "[data-name=copy-url]"));
|
||||
if (collection.color) {
|
||||
color_form.style.background = collection.color;
|
||||
}
|
||||
@@ -226,7 +227,7 @@ export class CollectionsScene {
|
||||
contentcount_form.textContent = contentcount_form_txt;
|
||||
}
|
||||
let href = collection.href;
|
||||
new UrlTextHandler(url_form).setHref(href);
|
||||
new UrlTextHandler(url_form, copy_btn).setHref(href);
|
||||
download_btn.href = href;
|
||||
download_btn.onclick = (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -119,8 +119,9 @@ export class IncomingSharingScene {
|
||||
let permissions_td = /** @type {HTMLElement} */ (get_element(node, "[data-name=permissions]"));
|
||||
let enabled_cb = /** @type {HTMLInputElement} */ (get_element(node, "[data-name=enabled]"));
|
||||
let shown_cb = /** @type {HTMLInputElement} */ (get_element(node, "[data-name=shown]"));
|
||||
let copy_btn = /** @type {HTMLButtonElement} */ (get_element(node, "[data-name=copy-url]"));
|
||||
|
||||
new UrlTextHandler(pathortoken).setHref(share.PathOrToken);
|
||||
new UrlTextHandler(pathortoken, copy_btn).setHref(share.PathOrToken);
|
||||
owner_td.textContent = share.Owner;
|
||||
displayPermissionsOrConversion(share.Conversion, share.Permissions, permissions_td);
|
||||
|
||||
|
||||
@@ -181,8 +181,9 @@ function add_share_row_node(user, password, collection, share, template, delete_
|
||||
node.classList.remove("hidden");
|
||||
|
||||
/** @type {HTMLInputElement} */ let pathortoken_form = /** @type {HTMLInputElement} */ (get_element(node, "[data-name=pathortoken]"));
|
||||
/** @type {HTMLButtonElement} */ let copy_btn = /** @type {HTMLButtonElement} */ (get_element(node, "[data-name=copy-url]"));
|
||||
if (pathortoken_form) {
|
||||
new UrlTextHandler(pathortoken_form).setHref(pathortoken);
|
||||
new UrlTextHandler(pathortoken_form, copy_btn).setHref(pathortoken);
|
||||
}
|
||||
|
||||
let permissions = (share["Permissions"] || "").toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user