diff options
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 |
