Implemented a deaktivateProgressbar function

This commit is contained in:
2025-11-17 13:15:37 +01:00
parent 1e3d830ae2
commit ada231cd28
3 changed files with 32 additions and 8 deletions
+3 -1
View File
@@ -12,6 +12,8 @@
<div class="flagsBtns" id="flagsBtns"> <div class="flagsBtns" id="flagsBtns">
<select name="ai_type" id="ai_type"> <select name="ai_type" id="ai_type">
</select> </select>
<select name="transkript_type" id="transkript_type">
</select>
<select name="language_option" id="language_option"> <select name="language_option" id="language_option">
</select> </select>
</div> </div>
@@ -40,7 +42,7 @@
<button class="submit-btn" id="submitButton" onclick="checkBoxes()" disabled>Submit</button> <button class="submit-btn" id="submitButton" onclick="checkBoxes()" disabled>Submit</button>
<div class="progressbar"> <div class="progressbar" id="progressbar">
<div class="progress_fill"></div> <div class="progress_fill"></div>
<span class="progress_text">0%</span> <span class="progress_text">0%</span>
</div> </div>
+28 -7
View File
@@ -23,9 +23,17 @@ function checkBoxes() {
if(isChecked){ if(isChecked){
//Code to submit the video //Code to submit the video
var selectedCheckboxes = {};
checkboxes.forEach(function(checkbox){
if(checkbox.checked){
selectedCheckboxes[checkbox.nextElementSibling.textContent] = "";
}
});
console.log(selectedCheckboxes);
var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]); var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]);
if(pathTest.endsWith(".mp4") || pathTest.endsWith(".mov") || pathTest.endsWith(".avi") || pathTest.endsWith( ".mkv")){ if(pathTest.endsWith(".mp4") || pathTest.endsWith(".mov") || pathTest.endsWith(".avi") || pathTest.endsWith( ".mkv")){
window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"}); document.getElementById("progressbar").style.visibility = "visible";
//window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"});
} }
} else { } else {
//language only english at the moment //language only english at the moment
@@ -102,12 +110,13 @@ function updateProgressBar(bar, value){
function loadAiOptions(options){ function loadAiOptions(options){
try { try {
var menu = document.getElementById('ai_type'); var menu = document.getElementById('ai_type');
var object_holdy;
var choice ;
object_holdy = Object.keys(languageOptions);
for(i = 0; i < options.length; i++){ for(i = 0; i < options.length; i++){
var opty = options[i]; choice = document.createElement('option');
var namey = "option" + i; choice.textContent = object_holdy[i];
var choice = document.createElement(namey); choice.value = object_holdy[i];
choice.textContent = "t";
choice.value = i;
menu.appendChild(choice); menu.appendChild(choice);
} }
} catch (error) { } catch (error) {
@@ -137,7 +146,19 @@ function loadLanguageOptions(){
} }
function activateSubmitBtn(hasFile){ function activateSubmitBtn(hasFile){
submitButton.disabled = !hasFile; try {
submitButton.disabled = !hasFile;
} catch (error) {
console.log(error);
}
}
function deaktivateProgressbar(){
try {
document.getElementById("progressbar").style.visibility = "hidden";
} catch (error) {
console.log(error);
}
} }
videoUpload.addEventListener("change", () => { videoUpload.addEventListener("change", () => {
+1
View File
@@ -131,6 +131,7 @@ h1 {
background: rgb(42, 46, 78); background: rgb(42, 46, 78);
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
visibility: hidden;
} }
.progress_fill{ .progress_fill{