Browse Source

use clipboardData.files intead of clipboardData.items

There may be other kinds of items (like an HTML string).
master
lilydjwg 2 years ago
parent
commit
4e11a164d1
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      templates/index.html

+ 1
- 1
templates/index.html View File

@@ -34,5 +34,5 @@ TOOLS

22 Feb 2018 elimage(1)
</pre>
<script>document.onpaste=function(a){var b=a.clipboardData;if('file'===b.items[0].kind){document.getElementsByName('image')[0].files=b.files;document.getElementsByTagName('form')[0].submit()}};</script>
<script>document.onpaste=function(a){var b=a.clipboardData;if(b.files.length>0){document.getElementsByName('image')[0].files=b.files;document.getElementsByTagName('form')[0].submit()}};</script>
<!-- vim: set fdm=marker et sw=4 syntax=html.tornadotmpl: -->

Loading…
Cancel
Save