1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 01:09:35 +05:30

(feat): implemented page linkInput copy to clipboard feature

This commit is contained in:
2023-11-27 22:22:41 +05:30
parent a3ecd6addc
commit 764134e830
2 changed files with 14 additions and 1 deletions

View File

@@ -353,4 +353,17 @@ function call_webshare_api() {
window.alert("Sorry, webShareAPI is not supported by your browser");
}
}
}
function copy_to_clipboard(textContent, copyContext) {
if(navigator.clipboard) {
navigator.clipboard.writeText(textContent).then(function() {
window.alert(copyContext + "Copied to Clipboard");
}, function() {
window.alert("Failed to Copy the" + copyContext + "!");
})
}
else {
window.alert("Sorry, webClipboardAPI is not supported by your browser");
}
}