840eab9566
Also added a license statement at the bottom of the posts.
19 lines
No EOL
368 B
JavaScript
19 lines
No EOL
368 B
JavaScript
/*
|
|
* Copy current page url to clipboard.
|
|
* v2.1
|
|
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
* © 2020 Cotes Chung
|
|
* MIT License
|
|
*/
|
|
|
|
function copyLink() {
|
|
var url = window.location.href;
|
|
var $temp = $("<input>");
|
|
|
|
$("body").append($temp);
|
|
$temp.val(url).select();
|
|
document.execCommand("copy");
|
|
$temp.remove();
|
|
|
|
alert("Link copied successfully!");
|
|
} |