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
|
- Hash-Funktion durch einen UUID-Generator ersetzen
|
||||||
- maximale Größe der Datei
|
- maximale Größe der Datei
|
||||||
- Code aufräumen
|
- Code aufräumen
|
||||||
- Klick-Funktionalität fertigstellen
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
$title = "imgpaste by gideonstar";
|
$title = "imgpaste by gideonstar";
|
||||||
|
|
||||||
// Displayed text
|
// Displayed text
|
||||||
$text = "Drop image here...";
|
$text = "Click or drop image here...";
|
||||||
|
|
||||||
// Writable data directory for images
|
// Writable data directory for images
|
||||||
$datadir = "i";
|
$datadir = "i";
|
||||||
|
14
script.js
14
script.js
@ -14,14 +14,24 @@ dropzone.addEventListener('dragleave', function(e)
|
|||||||
this.classList.add('nodrop');
|
this.classList.add('nodrop');
|
||||||
});
|
});
|
||||||
|
|
||||||
/*dropzone.addEventListener('click', function(e)
|
dropzone.addEventListener('click', function(e)
|
||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
input = document.createElement('input');
|
input = document.createElement('input');
|
||||||
input.type = 'file';
|
input.type = 'file';
|
||||||
input.click();
|
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)
|
dropzone.addEventListener('drop', function(e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user