Replace ZeroClipboard with Clipboard.js to remove flash dependency

This commit is contained in:
ThomasG77
2015-10-05 01:23:20 +02:00
parent faff14c44c
commit 7192a6d1a5
10 changed files with 5 additions and 4698 deletions

View File

@@ -1,12 +1,9 @@
(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();
});
}