github-actions[bot]
commited on
Commit
·
7f974bd
1
Parent(s):
249f430
Auto-deploy from GitHub: 4eeaf00f478bb7059b5d8019401e760b14edfa96
Browse files- .gitattributes +1 -1
- index.html +9 -42
.gitattributes
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 4 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 5 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 1 |
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 4 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
index.html
CHANGED
|
@@ -633,59 +633,26 @@
|
|
| 633 |
fileInput.click();
|
| 634 |
});
|
| 635 |
|
| 636 |
-
// File input change -
|
| 637 |
-
fileInput.addEventListener('change',
|
| 638 |
const file = e.target.files[0];
|
| 639 |
if (!file) return;
|
| 640 |
|
| 641 |
// Read file content
|
| 642 |
const reader = new FileReader();
|
| 643 |
-
reader.onload =
|
| 644 |
const text = event.target.result.trim();
|
| 645 |
-
|
| 646 |
if (!text) {
|
| 647 |
showNotification('File is empty!', 'error');
|
| 648 |
-
fileInput.value = '';
|
| 649 |
return;
|
| 650 |
}
|
| 651 |
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
//
|
| 656 |
-
loader.style.display = 'flex';
|
| 657 |
-
uploadBtn.disabled = true;
|
| 658 |
-
generateBtn.disabled = true;
|
| 659 |
-
|
| 660 |
-
try {
|
| 661 |
-
const response = await fetch(`${API_URL}/generate`, {
|
| 662 |
-
method: 'POST',
|
| 663 |
-
headers: {
|
| 664 |
-
'Content-Type': 'application/json'
|
| 665 |
-
},
|
| 666 |
-
body: JSON.stringify({
|
| 667 |
-
text,
|
| 668 |
-
voice,
|
| 669 |
-
speed
|
| 670 |
-
})
|
| 671 |
-
});
|
| 672 |
-
|
| 673 |
-
const data = await response.json();
|
| 674 |
-
|
| 675 |
-
if (response.ok) {
|
| 676 |
-
showNotification(`File "${file.name}" queued for TTS! 🎉`);
|
| 677 |
-
loadFiles();
|
| 678 |
-
} else {
|
| 679 |
-
showNotification(data.error || 'Upload failed', 'error');
|
| 680 |
-
}
|
| 681 |
-
} catch (error) {
|
| 682 |
-
showNotification('Network error: ' + error.message, 'error');
|
| 683 |
-
} finally {
|
| 684 |
-
loader.style.display = 'none';
|
| 685 |
-
uploadBtn.disabled = false;
|
| 686 |
-
generateBtn.disabled = false;
|
| 687 |
-
fileInput.value = ''; // Reset file input for next upload
|
| 688 |
-
}
|
| 689 |
};
|
| 690 |
|
| 691 |
reader.onerror = () => {
|
|
|
|
| 633 |
fileInput.click();
|
| 634 |
});
|
| 635 |
|
| 636 |
+
// File input change - fill textarea with file content
|
| 637 |
+
fileInput.addEventListener('change', (e) => {
|
| 638 |
const file = e.target.files[0];
|
| 639 |
if (!file) return;
|
| 640 |
|
| 641 |
// Read file content
|
| 642 |
const reader = new FileReader();
|
| 643 |
+
reader.onload = (event) => {
|
| 644 |
const text = event.target.result.trim();
|
| 645 |
+
|
| 646 |
if (!text) {
|
| 647 |
showNotification('File is empty!', 'error');
|
| 648 |
+
fileInput.value = '';
|
| 649 |
return;
|
| 650 |
}
|
| 651 |
|
| 652 |
+
// Fill textarea with file content
|
| 653 |
+
textInput.value = text;
|
| 654 |
+
showNotification(`Loaded "${file.name}" - Ready to generate! 📄`);
|
| 655 |
+
fileInput.value = ''; // Reset for next upload
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 656 |
};
|
| 657 |
|
| 658 |
reader.onerror = () => {
|