2013-01-07 12:29:16 -08:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
// Backup the clipboard button's original text.
|
2013-01-21 19:45:45 -05:00
|
|
|
$(".js-clipboard-button").data('clipboard-prompt', $('.js-clipboard-button').text());
|
|
|
|
|
2013-01-07 12:29:16 -08:00
|
|
|
// Hook up copy to clipboard buttons
|
2013-01-21 19:45:45 -05:00
|
|
|
var clip = new ZeroClipboard($(".js-clipboard-button"), {
|
2013-01-17 13:45:36 -08:00
|
|
|
moviePath: "../../javascripts/ZeroClipboard.swf"
|
2013-01-21 19:45:45 -05:00
|
|
|
});
|
2013-01-07 12:29:16 -08:00
|
|
|
|
2013-01-21 19:45:45 -05:00
|
|
|
clip.on('mouseover', function(client, args) {
|
2013-01-07 12:29:16 -08:00
|
|
|
// Restore the clipboard button's original text.
|
|
|
|
this.innerText = $(this).data('clipboard-prompt');
|
2013-01-21 19:45:45 -05:00
|
|
|
});
|
2013-01-07 12:29:16 -08:00
|
|
|
|
2013-01-21 19:45:45 -05:00
|
|
|
clip.on('complete', function(client, args) {
|
2013-01-07 12:29:16 -08:00
|
|
|
this.innerText = 'Copied!';
|
2013-01-21 19:45:45 -05:00
|
|
|
});
|
2013-01-07 12:29:16 -08:00
|
|
|
|
|
|
|
});
|