From 170d77b3ecb2d0c5c35263a2f5598002af599a43 Mon Sep 17 00:00:00 2001 From: Jfriedli Date: Thu, 18 Mar 2021 09:25:11 +0100 Subject: installed tailwind and removed old css/js --- static/script.js | 78 -------------------------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 static/script.js (limited to 'static/script.js') diff --git a/static/script.js b/static/script.js deleted file mode 100644 index a579a3e..0000000 --- a/static/script.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; - -(function () { - const dropZone = document.body; - if (!dropZone) { - return; - } - - const hoverClassName = "hover"; - - // Handle drag* events to handle style - // Add the css you want when the class "hover" is present - dropZone.addEventListener("dragenter", function (e) { - e.preventDefault(); - dropZone.classList.add(hoverClassName); - }); - - dropZone.addEventListener("dragover", function (e) { - e.preventDefault(); - dropZone.classList.add(hoverClassName); - }); - - dropZone.addEventListener("dragleave", function (e) { - e.preventDefault(); - dropZone.classList.remove(hoverClassName); - }); - - // Handle copy/paste - dropZone.addEventListener("paste", function (e) { - e.preventDefault(); - - if (e.clipboardData.items.length != 1) { - return - } - - const item = e.clipboardData.items[0]; - if (item.type.indexOf("image") == -1) { - return; - } - - fetch('/', { - method: 'POST', - body: item.getAsFile(), - }) - .then(response => response.text()) - .then(body => { // Yes, this is ugly - document.open() - document.write(body) - document.close() - }) - - }); - - dropZone.addEventListener("drop", function (e) { - e.preventDefault(); - dropZone.classList.remove(hoverClassName); - - const files = Array.from(e.dataTransfer.files); - if (files.length != 1 ) { - return; - } - const data = new FormData(); - for (const file of files) { - data.append('file', file); - } - - fetch('/', { - method: 'POST', - body: data, - }) - .then(response => response.text()) - .then(body => { // Yes, this is ugly - document.open() - document.write(body) - document.close() - }) - }); -})(); -- cgit v1.3