mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Created a preload.js, small changes in the package.json, main.js, index.html and script.js like removing whitespace
This commit is contained in:
@@ -7,8 +7,7 @@
|
|||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form method="post" enctype="multipart/form-data" >
|
|
||||||
<input type="file" name="uploaddatei" >
|
|
||||||
|
|
||||||
|
|
||||||
<div class="upload-container" id="uploadContainer">
|
<div class="upload-container" id="uploadContainer">
|
||||||
@@ -17,10 +16,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<button class="custom-btn" id="manualUploadBtn">Upload video</button>
|
<button class="custom-btn" id="manualUploadBtn">Search video</button>
|
||||||
<input type="file" id="videoUpload" accept="video/*">
|
<input type="file" id="videoUpload" accept="video/*">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="script.js"></script>
|
<script src="script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -19,7 +19,7 @@ function createWindow() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mainWindow.loadFile('index.html');
|
mainWindow.loadFile('main/index.html');
|
||||||
}
|
}
|
||||||
|
|
||||||
app.whenReady().then(createWindow);
|
app.whenReady().then(createWindow);
|
||||||
@@ -40,3 +40,5 @@ ipcMain.handle('convert-video', async (event, filePath) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
const { contextBridge, ipcRenderer } = require('electron');
|
||||||
|
contextBridge.exposeInMainWorld('electronAPI', {
|
||||||
|
sendDropPath: (path) => ipcRenderer.send('file-dropped', path)
|
||||||
|
});
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -17,10 +17,11 @@ uploadContainer.addEventListener('dragleave', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
uploadContainer.addEventListener('drop', (e) => {
|
uploadContainer.addEventListener('drop', (e) => { e.preventDefault();
|
||||||
e.preventDefault();
|
const file = e.dataTransfer.files[0]; // Pfad der Datei
|
||||||
uploadContainer.classList.remove('dragover');
|
const filePath = file.path;
|
||||||
|
console.log('Pfad:', filePath); // ggf. an den Hauptprozess senden, wenn nötig
|
||||||
|
window.electronAPI?.sendDropPath?.(filePath);
|
||||||
|
|
||||||
const files = e.dataTransfer.files;
|
const files = e.dataTransfer.files;
|
||||||
handleFiles(files);
|
handleFiles(files);
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "electron",
|
"name": "electron",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "index.js",
|
"main": "main/main.js",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron.",
|
"start": "electron.",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
|||||||
Reference in New Issue
Block a user