mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Fixed an error in checkBoxes function and uploadContainer "drop" listener regarding file path testing
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
|
|
||||||
const dropzone = document.getElementById("uploadContainer");
|
uploadContainer.addEventListener("dragover", (e) =>{
|
||||||
|
|
||||||
dropzone.addEventListener("dragover", (e) =>{
|
|
||||||
try {
|
try {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -12,14 +10,14 @@ dropzone.addEventListener("dragover", (e) =>{
|
|||||||
});
|
});
|
||||||
|
|
||||||
//listener for when a file get dropped on the drag&drop field
|
//listener for when a file get dropped on the drag&drop field
|
||||||
dropzone.addEventListener("drop", (e) => {
|
uploadContainer.addEventListener("drop", (e) => {
|
||||||
try {
|
try {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
const files = e.dataTransfer.files
|
const files = e.dataTransfer.files
|
||||||
const filePath = window.explorer.onFileDrop(files[0])
|
const filePath = window.explorer.onFileDrop(files[0])
|
||||||
var holdy = filePath + "";
|
var holdy = filePath + "";
|
||||||
if(holdy.endsWith(".mp4", ".mov", ".avi", ".mkv")){
|
if(holdy.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
|
||||||
console.log(filePath)
|
console.log(filePath)
|
||||||
|
|
||||||
const files1 = e.dataTransfer.files;
|
const files1 = e.dataTransfer.files;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function checkBoxes() {
|
|||||||
if(isChecked){
|
if(isChecked){
|
||||||
//Code to submit the video
|
//Code to submit the video
|
||||||
var pathTest = fileName.textContent + "";
|
var pathTest = fileName.textContent + "";
|
||||||
if(pathTest.endsWith(".mp4", ".mov", ".avi", ".mkv")){
|
if(pathTest.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
|
||||||
mapFunctions.get("extraction-video-to-audio").function({inputVideoPath: pathTest, outputType:"wav"});
|
mapFunctions.get("extraction-video-to-audio").function({inputVideoPath: pathTest, outputType:"wav"});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user