diff --git a/static/js/upload.js b/static/js/upload.js index 5e54d62..159bad2 100644 --- a/static/js/upload.js +++ b/static/js/upload.js @@ -102,8 +102,18 @@ Dropzone.options.dropzone = { previewsContainer: "#uploads", parallelUploads: 5, headers: {"Accept": "application/json"}, - dictDefaultMessage: "Click or Drop file(s)", + dictDefaultMessage: "Click or Drop file(s) or Paste image", dictFallbackMessage: "" }; +document.onpaste = function(event) { + var items = (event.clipboardData || event.originalEvent.clipboardData).items; + for (index in items) { + var item = items[index]; + if (item.kind === "file") { + Dropzone.forElement("#dropzone").addFile(item.getAsFile()); + } + } +}; + // @end-license diff --git a/templates/index.html b/templates/index.html index 5e95d01..87d821d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -13,7 +13,7 @@
- Click or Drop file(s) + Click or Drop file(s) or Paste image