clipboard-dom
Makes a DOM element (i.e. <button>) write to the system clipboard. This component is based off of the ZeroClipboard project, and in fact uses the same SWF Flash code.
Installation
$ component install component/clipboard-dom
Example
<!-- The "copy-button" *should* be inside a div with "position: relative"or something else that "has layout". -->Copy to Clipboard
// main.jsvar Clip = ;// set the path to the swf file firstClip;// create a "Clip" instancevar ele = document;var parent = eleparentNode; // parent should "have layout"var clip = ele parent;// listen for meaningful eventsclip;clip;clip;
Events
"load"
Fired when the SWF movie for the clipboard instance has loaded.
"complete"
Fired when the user clicks on the button and the text has been copied. The text that got copied is passed in as an argument.
"mouseover"
Fired when the user mouses over the button.
"mouseout"
Fired when the user mouses away from the button.
"mousedown"
Fired when the user pressed the mouse down on the button.
"mouseup"
Fired when the user releases the mouse from the button.