Klick-Funktion hinzugefügt
This commit is contained in:
parent
4af6907f36
commit
4f95661b3b
1
TODO.md
1
TODO.md
@ -3,4 +3,3 @@
|
||||
- Hash-Funktion durch einen UUID-Generator ersetzen
|
||||
- maximale Größe der Datei
|
||||
- Code aufräumen
|
||||
- Klick-Funktionalität fertigstellen
|
||||
|
@ -4,7 +4,7 @@
|
||||
$title = "imgpaste by gideonstar";
|
||||
|
||||
// Displayed text
|
||||
$text = "Drop image here...";
|
||||
$text = "Click or drop image here...";
|
||||
|
||||
// Writable data directory for images
|
||||
$datadir = "i";
|
||||
|
14
script.js
14
script.js
@ -14,14 +14,24 @@ dropzone.addEventListener('dragleave', function(e)
|
||||
this.classList.add('nodrop');
|
||||
});
|
||||
|
||||
/*dropzone.addEventListener('click', function(e)
|
||||
dropzone.addEventListener('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.click();
|
||||
});*/
|
||||
|
||||
input.onchange = function(e) {
|
||||
file = e.target.files[0];
|
||||
if(
|
||||
file.type == 'image/png' ||
|
||||
file.type == 'image/jpeg' )
|
||||
{
|
||||
upload(e.target.files[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dropzone.addEventListener('drop', function(e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user