mirror of https://github.com/jkjoy/sunpeiwen.git
19 lines
579 B
Plaintext
19 lines
579 B
Plaintext
|
|
||
|
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js"></script>
|
||
|
<script>
|
||
|
!function (e, t, a) {
|
||
|
var initCopyCode = function(){
|
||
|
var copyHtml = '';
|
||
|
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
|
||
|
copyHtml += ' <i class="fa fa-clipboard"></i><span>复制</span>';
|
||
|
copyHtml += '</button>';
|
||
|
$(".highlight .code pre").before(copyHtml);
|
||
|
new ClipboardJS('.btn-copy', {
|
||
|
target: function(trigger) {
|
||
|
return trigger.nextElementSibling;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
initCopyCode();
|
||
|
}(window, document);
|
||
|
</script>
|