1
0
mirror of https://github.com/github/choosealicense.com synced 2024-07-03 17:09:12 +02:00
choosealicense.com/javascripts/clipboard.js

20 lines
581 B
JavaScript

$(document).ready(function() {
// Backup the clipboard button's original text.
$("#clipboard-button").data('clipboard-prompt', $('#clipboard-button').text());
// Hook up copy to clipboard buttons
var clip = new ZeroClipboard( $("#clipboard-button"), {
moviePath: "../../javascripts/ZeroClipboard.swf"
} );
clip.on( 'mouseover', function(client, args) {
// Restore the clipboard button's original text.
this.innerText = $(this).data('clipboard-prompt');
} );
clip.on( 'complete', function(client, args) {
this.innerText = 'Copied!';
} );
});