diff --git a/src/hub.js b/src/hub.js index 95133f739dc7c80750370dc685d6fbc923463ac3..c68af15955ea500268bac9075750e40bb7ab22ca 100644 --- a/src/hub.js +++ b/src/hub.js @@ -318,6 +318,19 @@ const onReady = async () => { addMedia(imgUrl); }); + document.addEventListener("dragover", e => { + e.preventDefault(); + }); + + document.addEventListener("drop", e => { + e.preventDefault(); + const imgUrl = e.dataTransfer.getData("url"); + if (imgUrl) { + console.log("Droped: ", imgUrl); + addMedia(imgUrl); + } + }); + if (!qsTruthy("offline")) { document.body.addEventListener("connected", () => { if (!isBotMode) {