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:
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user