diff --git a/static/js/app.js b/static/js/app.js index eecf779..2e862cc 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1,5 +1,7 @@ /** * Copyright (c) 2016 Luminarys + * + * Copyright (c) 2021 Eric Johansson (Nekunekus) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,7 +22,7 @@ * SOFTWARE. */ -document.addEventListener('DOMContentLoaded', function() { + document.addEventListener('DOMContentLoaded', function() { /** * Sets up the elements inside file upload rows. * @@ -251,6 +253,17 @@ document.addEventListener('DOMContentLoaded', function() { target.click(); } + /* Handles the pasting function */ + window.addEventListener("paste", e =>{ + var len = e.clipboardData.files.length; + for (var i = 0; i < len; i++) { + var file = e.clipboardData.files[i]; + var row = addRow(file); + uploadFile(file, row); + } + }); + + /* Set-up the event handlers for the +