parent
52c6256533
commit
9d19ea78d1
2 changed files with 21 additions and 0 deletions
@ -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…
Reference in new issue