Improve JS code style.

This commit is contained in:
Cotes Chung
2020-08-19 12:26:45 +08:00
parent a8f8bbaa1c
commit 9b35380849
11 changed files with 268 additions and 262 deletions

View File

@@ -1,13 +1,16 @@
/*
* Copy current page url to clipboard.
* v2.1
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2020 Cotes Chung
* MIT License
*/
* Copy current page url to clipboard.
* v2.1
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2020 Cotes Chung
* MIT License
*/
function copyLink(url) {
if (!url || 0 === url.length)
if (!url || 0 === url.length) {
return;
}
url = window.location.href;
var $temp = $("<input>");
@@ -17,4 +20,5 @@ function copyLink(url) {
$temp.remove();
alert("Link copied successfully!");
}