diff options
| author | Julie Lala <jules@okfoc.us> | 2014-12-19 00:17:18 -0500 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-12-19 00:17:18 -0500 |
| commit | 063a9f9f4aeb5c59d007778cba5f3702cb8d39f5 (patch) | |
| tree | 7e0254e37c2947f9565417a92299cd41e7cae5c8 /assets/test | |
| parent | 0a3e6acd015211aa64a0d0918fabc17096e2b654 (diff) | |
clipboard test
Diffstat (limited to 'assets/test')
| -rw-r--r-- | assets/test/clipboard.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/assets/test/clipboard.html b/assets/test/clipboard.html new file mode 100644 index 0000000..53634b4 --- /dev/null +++ b/assets/test/clipboard.html @@ -0,0 +1,34 @@ + +<body></body> + + +<script src="/assets/javascripts/math/util.js"></script> +<script> +document.body.addEventListener('copy', function (e) { + if (disabled) { return } + if (e.clipboardData) { + e.preventDefault(); + e.clipboardData.setData("text/plain", canvas.irssi()); + } + if (window.clipboardData) { + e.returnValue = false; + window.clipboardData.setData("text/plain", canvas.irssi()); + } +}, false); + + +document.body.addEventListener('paste', function (e) { + toArray(e.clipboardData.items).forEach(function(item,i){ +// if (item.kind == 'file' && item.type.match('image/')) { + var blob = item.getAsFile(); + window.URL = window.URL || window.webkitURL; + var blobUrl = window.URL.createObjectURL(blob); + + var img = document.createElement('img'); + img.src = blobUrl; + console.log(blob, blobUrl) + document.body.appendChild(img); +// } + }) +}) +</script>
\ No newline at end of file |
