Replace ZeroClipboard with Clipboard.js

This commit is contained in:
Frederic Junod
2017-12-17 09:53:42 +01:00
parent 60eddb233b
commit 599d3b6c0c
10 changed files with 6 additions and 4736 deletions

View File

@@ -1,14 +1,8 @@
(function() {
var copyButton = document.getElementById('copy-button');
if (copyButton) {
var data = document.getElementById('example-source').textContent;
new ZeroClipboard(copyButton).on('copy', function(event) {
event.clipboardData.setData({
'text/plain': data,
'text/html': data
});
});
}
var clipboard = new Clipboard('#copy-button');
clipboard.on('success', function(e) {
e.clearSelection();
});
var codepenButton = document.getElementById('codepen-button');
if (codepenButton) {