upload page after uploading
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const link = document.getElementById("copy-link");
|
||||
|
||||
if (link && navigator.clipboard?.writeText) {
|
||||
link.style.display = "";
|
||||
link.hidden = false;
|
||||
link.onclick = async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
await navigator.clipboard.writeText(`${location.origin}/${link.dataset.id}`);
|
||||
link.textContent = "copied";
|
||||
setTimeout(() => {
|
||||
link.textContent = "copy link";
|
||||
}, 2000);
|
||||
} catch (error) {
|
||||
console.error("failed to copy link:", error);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user