mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
Feature: Added post sharing options.
Also added a license statement at the bottom of the posts.
This commit is contained in:
19
assets/js/_src/_commons/copy-link.js
Normal file
19
assets/js/_src/_commons/copy-link.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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!");
|
||||
}
|
||||
1
assets/js/dist/_commons/copy-link.min.js
vendored
Normal file
1
assets/js/dist/_commons/copy-link.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function copyLink(){var a=window.location.href;var b=$("<input>");$("body").append(b);b.val(a).select();document.execCommand("copy");b.remove();alert("Link copied successfully!")};
|
||||
3
assets/js/dist/commons.js
vendored
3
assets/js/dist/commons.js
vendored
@@ -9,4 +9,5 @@
|
||||
{% include_relative _commons/sidebar.min.js %}
|
||||
{% include_relative _commons/topbar-switch.min.js %}
|
||||
{% include_relative _commons/topbar-title.min.js %}
|
||||
{% include_relative _commons/tooltip.min.js %}
|
||||
{% include_relative _commons/tooltip.min.js %}
|
||||
{% include_relative _commons/copy-link.min.js %}
|
||||
Reference in New Issue
Block a user