Implemented the function for the download button.

This commit is contained in:
2025-12-15 17:21:02 +01:00
parent aee1428cb6
commit bac6e2b7f0
3 changed files with 13 additions and 7 deletions
+1 -6
View File
@@ -147,12 +147,7 @@
</div> </div>
<div class="step" id="step6" style="display:none;"> <div class="step" id="step6" style="display:none;">
<button class="download-btn" id="downloadButton" onclick="" disabled>Download</button> <button class="download-btn" id="downloadButton" disabled>Download</button>
<div class="progressbar" id="progressbar">
<div class="progress_fill"></div>
<span class="progress_text">0%</span>
</div>
</div> </div>
</div> </div>
+5
View File
@@ -26,6 +26,11 @@ try {
submitSpeaker: (speaker_names) => {ipcRenderer.send("speaker_submit", speaker_names)} submitSpeaker: (speaker_names) => {ipcRenderer.send("speaker_submit", speaker_names)}
}) })
contextBridge.exposeInMainWorld("download", {
file_download: () => {ipcRenderer.send("file_download")}
})
ipcRenderer.on("error", (event, err) => {alert(err)}) ipcRenderer.on("error", (event, err) => {alert(err)})
} catch (error) { } catch (error) {
console.log("Error in preload.js"); console.log("Error in preload.js");
+7 -1
View File
@@ -105,7 +105,6 @@ function changeLanguage(language) {
function handleFiles(files) { function handleFiles(files) {
try { try {
if (files.length > 0) { if (files.length > 0) {
document.getElementById("progressbar").style.visibility = "visible";
const file = files[0]; const file = files[0];
if (file.type.startsWith('video/')) { if (file.type.startsWith('video/')) {
const filePath = window.explorer.onFileDrop(files[0]) const filePath = window.explorer.onFileDrop(files[0])
@@ -330,3 +329,10 @@ function sendSpeakerPackages(){
} }
} }
function fileDownload(){
try {
window.file_download.fileDownload();
} catch (error) {
}
}