copy code
i18n
CRainyDay 5 years ago committed by GitHub
parent 52c6256533
commit 9d19ea78d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      source/js/clipboard-use.js
  2. 4
      source/js/clipboard.min.js

@ -0,0 +1,17 @@
/*页面载入完成后,创建复制按钮*/
!function (e, t, a) {
/* code */
var initCopyCode = function(){
var copyHtml = '';
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
copyHtml += ' <i class="fa fa-globe"></i><span>copy</span>';
copyHtml += '</button>';
$(".highlight .code pre").before(copyHtml);
new ClipboardJS('.btn-copy', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});
}
initCopyCode();
}(window, document);

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save