Update static/script.js
Browse files- static/script.js +4 -2
static/script.js
CHANGED
@@ -52,7 +52,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
52 |
function handleFiles(files) {
|
53 |
if (files.length > 0) {
|
54 |
currentFile = files[0];
|
55 |
-
isDecrypting = currentFile.type === 'audio/
|
56 |
options.style.display = 'block';
|
57 |
processButton.textContent = isDecrypting ? 'Decrypt' : 'Encrypt';
|
58 |
dropArea.textContent = `File selected: ${currentFile.name}`;
|
@@ -87,12 +87,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
87 |
result.style.display = 'block';
|
88 |
if (isDecrypting) {
|
89 |
audioPlayer.style.display = 'none';
|
|
|
90 |
} else {
|
91 |
audioPlayer.style.display = 'block';
|
92 |
audioPlayer.src = url;
|
|
|
93 |
}
|
94 |
downloadLink.href = url;
|
95 |
-
downloadLink.download = isDecrypting ? 'decrypted_file' : 'encrypted.
|
96 |
console.log('File processed successfully. Size:', blob.size, 'bytes');
|
97 |
})
|
98 |
.catch(error => {
|
|
|
52 |
function handleFiles(files) {
|
53 |
if (files.length > 0) {
|
54 |
currentFile = files[0];
|
55 |
+
isDecrypting = currentFile.type === 'audio/mpeg';
|
56 |
options.style.display = 'block';
|
57 |
processButton.textContent = isDecrypting ? 'Decrypt' : 'Encrypt';
|
58 |
dropArea.textContent = `File selected: ${currentFile.name}`;
|
|
|
87 |
result.style.display = 'block';
|
88 |
if (isDecrypting) {
|
89 |
audioPlayer.style.display = 'none';
|
90 |
+
downloadLink.textContent = 'Download Decrypted File';
|
91 |
} else {
|
92 |
audioPlayer.style.display = 'block';
|
93 |
audioPlayer.src = url;
|
94 |
+
downloadLink.textContent = 'Download Encrypted MP3';
|
95 |
}
|
96 |
downloadLink.href = url;
|
97 |
+
downloadLink.download = isDecrypting ? 'decrypted_file' : 'encrypted.mp3';
|
98 |
console.log('File processed successfully. Size:', blob.size, 'bytes');
|
99 |
})
|
100 |
.catch(error => {
|