nocoolyoyo / ImageClipboard

Insert images to a site from your clipboard. Works on Chrome, Firefox and Opera

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install

bower install image-clipboard

Paste images from clipboard to your site.

<div id="box"></div>
<script type="text/javascript" src="ImageClipBoard.min.js"></script>
<script type="text/javascript">

  var clipboard = new ImageClipboard('#box', function (base64) {
    //do stuff with pasted image
  });
  
  //onpaste-callback can also be passed as second argument
  //in the constructor above.
  clipboard.onpaste = function (base64) {
    //do stuff with the pasted image
  });

  //you can also pass in single DOM-element instead of 
  //query as the first parameter.

</script>

Tested on the latest versions of Chrome, Firefox and Opera. Not tested on Safari.

About

Insert images to a site from your clipboard. Works on Chrome, Firefox and Opera


Languages

Language:JavaScript 92.9%Language:HTML 7.1%