Update index.js
Browse files
index.js
CHANGED
@@ -361,9 +361,9 @@ exampleButton.addEventListener('click', (e) => {
|
|
361 |
});
|
362 |
|
363 |
uploadInput.addEventListener('change', (e) => {
|
|
|
364 |
const file = e.target.files[0];
|
365 |
if (!file) return;
|
366 |
-
console.log('file hcange');
|
367 |
|
368 |
const reader = new FileReader();
|
369 |
reader.onload = (e2) => {
|
@@ -373,10 +373,13 @@ uploadInput.addEventListener('change', (e) => {
|
|
373 |
reader.readAsDataURL(file);
|
374 |
});
|
375 |
|
|
|
|
|
|
|
|
|
376 |
|
377 |
form.addEventListener('submit', (e) => {
|
378 |
e.preventDefault();
|
379 |
-
e.stopPropagation();
|
380 |
|
381 |
if (!currentImage || !currentQuery) {
|
382 |
status.textContent = 'Please select an image and type a prompt';
|
|
|
361 |
});
|
362 |
|
363 |
uploadInput.addEventListener('change', (e) => {
|
364 |
+
console.log('upload change');
|
365 |
const file = e.target.files[0];
|
366 |
if (!file) return;
|
|
|
367 |
|
368 |
const reader = new FileReader();
|
369 |
reader.onload = (e2) => {
|
|
|
373 |
reader.readAsDataURL(file);
|
374 |
});
|
375 |
|
376 |
+
prompt.addEventListener('keypress', (e) => {
|
377 |
+
currentQuery = e.target.value;
|
378 |
+
});
|
379 |
+
|
380 |
|
381 |
form.addEventListener('submit', (e) => {
|
382 |
e.preventDefault();
|
|
|
383 |
|
384 |
if (!currentImage || !currentQuery) {
|
385 |
status.textContent = 'Please select an image and type a prompt';
|