I'm using the JS version of ZeroClipboard.
When the user clicks the copy button I want to capture the data from data-clipboard-text add some extra data to this and then copy this to the clipboard.
This the code I'm currently using, How do I add to the text before it is copied to the clipboard ?
var clip = new ZeroClipboard( $("input[type='button']"), {
moviePath: "clip/ZeroClipboard.swf"
});
clip.on( 'complete', function(client, args) {
alert ('Copied');
});
I've tried using this before clip.on but it failed :
clip.on('dataRequested', function (client, args) {
clip.setText(args + "NEW VALUE");
} );
Any ideas ?
Thanks
Setting the clipboard text can be done using the 'copy' event handler [v2.x] :
For previous version [1.x] using the 'dataRequested' event handler: