Update static/script.js
Browse files9 unmodified lines10111213141534 unmodified lines505152535455565758592 unmodified lines62636465666768697071727374759 unmodified linesconst downloadLink = document.getElementById('downloadLink');let isDecrypting = false;['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {dropArea.addEventListener(eventName, preventDefaults, false);34 unmodified linesfunction handleFiles(files) {if (files.length > 0) {const file = files[0];isDecrypting = file.type === 'audio/mpeg';options.style.display = 'block';processButton.textContent = isDecrypting ? 'Deconvert' : 'Convert';}}2 unmodified lines});processButton.addEventListener('click', function() {const file = fileInput.files[0];if (!file) {alert('Please select a file first.');return;}const formData = new FormData();formData.append('file', file);formData.append('factor', multiplicationFactor.value);fetch('/process', {9 unmodified lines1011121314151634 unmodified lines51525354555657585960612 unmodified lines646566676869707172737475769 unmodified linesconst downloadLink = document.getElementById('downloadLink');let isDecrypting = false;let currentFile = null;['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {dropArea.addEventListener(eventName, preventDefaults, false);34 unmodified linesfunction handleFiles(files) {if (files.length > 0) {currentFile = files[0];isDecrypting = currentFile.type === 'audio/mpeg';options.style.display = 'block';processButton.textContent = isDecrypting ? 'Deconvert' : 'Convert';dropArea.textContent = `File selected: ${currentFile.name}`;}}2 unmodified lines});processButton.addEventListener('click', function() {if (!currentFile) {alert('Please select a file first.');return;}const formData = new FormData();formData.append('file', currentFile);formData.append('factor', multiplicationFactor.value);fetch('/process', {
static/script.js+6-5