blob: 53634b483d9ae984460991eb4a3fd21a0d6400ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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>
|