mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Fixed a merg mistake and added try/catch lines
This commit is contained in:
@@ -30,12 +30,21 @@ uploadContainer.addEventListener("drop", (e) => {
|
|||||||
|
|
||||||
|
|
||||||
window.addEventListener('load', (e) => {
|
window.addEventListener('load', (e) => {
|
||||||
console.log("test");
|
try {
|
||||||
loadLanguageOptions();
|
console.log("test");
|
||||||
|
loadLanguageOptions();
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
language_option.addEventListener('change', (e)=>{
|
language_option.addEventListener('change', (e)=>{
|
||||||
const select = document.getElementById('language_option');
|
try {
|
||||||
console.log(select.value);
|
const select = document.getElementById('language_option');
|
||||||
changeLanguage(select.value);
|
changeLanguage(select.value);
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
+24
-9
@@ -4,6 +4,7 @@ manualUploadBtn.addEventListener('click', () => {
|
|||||||
videoUpload.click();
|
videoUpload.click();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in manualBtn EventListener click");
|
console.log("Error in manualBtn EventListener click");
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -23,18 +24,18 @@ function checkBoxes() {
|
|||||||
if(isChecked){
|
if(isChecked){
|
||||||
//Code to submit the video
|
//Code to submit the video
|
||||||
var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]);
|
var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]);
|
||||||
if(pathTest.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
|
if(pathTest.endsWith(".mp4") || pathTest.endsWith(".mov") || pathTest.endsWith(".avi") || pathTest.endsWith( ".mkv")){
|
||||||
window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"})
|
window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//language only english at the moment
|
//language only english at the moment
|
||||||
alert('Please select at least one document type.');
|
alert('Please select at least one document type.');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log("Error in script.js checkBoxes function");
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//language changing feature
|
//language changing feature
|
||||||
@@ -50,6 +51,7 @@ function changeLanguage(language) {
|
|||||||
document.getElementById('label_summary').textContent = languageOptions[language].label_summary;
|
document.getElementById('label_summary').textContent = languageOptions[language].label_summary;
|
||||||
document.getElementById('submitButton').textContent = languageOptions[language].submitButton;
|
document.getElementById('submitButton').textContent = languageOptions[language].submitButton;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log("Error in script.js changeLanguage function");
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,6 +63,7 @@ videoUpload.addEventListener('change', () => {
|
|||||||
handleFiles(videoUpload.files);
|
handleFiles(videoUpload.files);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in manualBtn EventListener change");
|
console.log("Error in manualBtn EventListener change");
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -77,6 +80,7 @@ function handleFiles(files) {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in script.js handleFiles function");
|
console.log("Error in script.js handleFiles function");
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -89,6 +93,7 @@ function updateProgressBar(bar, value){
|
|||||||
bar.querySelector(".progress_text").textContent = `${value}%`;
|
bar.querySelector(".progress_text").textContent = `${value}%`;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in scripts.js updateProgressBar function");
|
console.log("Error in scripts.js updateProgressBar function");
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -136,14 +141,24 @@ function activateSubmitBtn(hasFile){
|
|||||||
}
|
}
|
||||||
|
|
||||||
videoUpload.addEventListener("change", () => {
|
videoUpload.addEventListener("change", () => {
|
||||||
activateSubmitBtn(videoUpload.files.length > 0);
|
try {
|
||||||
|
activateSubmitBtn(videoUpload.files.length > 0);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
uploadContainer.addEventListener("drop", (e) => {
|
uploadContainer.addEventListener("drop", (e) => {
|
||||||
e.preventDefault();
|
try {
|
||||||
const file = e.dataTransfer.files[0];
|
e.preventDefault();
|
||||||
|
const file = e.dataTransfer.files[0];
|
||||||
|
|
||||||
if(file){
|
if(file){
|
||||||
activateSubmitBtn(true);
|
activateSubmitBtn(true);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user