diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2018-02-15 20:28:53 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2018-02-15 20:28:53 +0100 |
commit | b1c17a50872aef6331883df221662cc361d15a7b (patch) | |
tree | c1cec87f6e106a02d4886dc3359abd8b2f8a2b0d /fbin/templates | |
parent | 24b1a9886be5632730b8f020c358a5d8915f1dbb (diff) |
Add support for pasting files.
Diffstat (limited to 'fbin/templates')
-rw-r--r-- | fbin/templates/upload.html | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fbin/templates/upload.html b/fbin/templates/upload.html index 9fe1571..00f4de8 100644 --- a/fbin/templates/upload.html +++ b/fbin/templates/upload.html @@ -56,6 +56,12 @@ $(document).ready(function() { $(':file')[0].files = event.originalEvent.dataTransfer.files; } }); + $(document).on('paste', function(event) { + var files = (event.clipboardData || event.originalEvent.clipboardData).files; + if (files.length === 1) { + $(':file')[0].files = files; + } + }); }); </script> {% endblock %} |