Skip to content

component/clipboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clipboard

Clipboard library.

Installation

$ component install component/clipboard

Example

var Clipboard = require('clipboard');
var clip = new Clipboard(window);

clip.on('paste', function(e){
  e.items.forEach(function(item){
    console.log(item);
  });
});

clip.on('cut', function(){
  console.log('cut');
});

clip.on('copy', function(e){
  console.log('copy');
});

API

Clipboard#bind()

Bind event handlers. This is done for you in the constructor.

Clipboard#unbind()

Unbind event handlers.

Links

License

MIT