mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
31 lines
915 B
JavaScript
31 lines
915 B
JavaScript
|
|
uploadContainer.addEventListener("dragover", (e) =>{
|
|
try {
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
} catch (error) {
|
|
console.log("Error in renderer.js dragover listener function")
|
|
}
|
|
|
|
});
|
|
|
|
//listener for when a file get dropped on the drag&drop field
|
|
uploadContainer.addEventListener("drop", (e) => {
|
|
try {
|
|
e.stopPropagation()
|
|
e.preventDefault()
|
|
const files = e.dataTransfer.files
|
|
const filePath = window.explorer.onFileDrop(files[0])
|
|
var holdy = filePath + "";
|
|
if(holdy.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
|
|
console.log(filePath)
|
|
|
|
const files1 = e.dataTransfer.files;
|
|
handleFiles(files1);
|
|
}
|
|
} catch (error) {
|
|
console.log("Error in renderer.js with the listerner for the drop function");
|
|
}
|
|
|
|
|
|
}) |