-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathfluorine_info.js
More file actions
29 lines (23 loc) · 828 Bytes
/
Copy pathfluorine_info.js
File metadata and controls
29 lines (23 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"use strict";
const alert = require("./modules/alert");
const ipcRenderer = require("electron").ipcRenderer;
let webUtils = require("electron").webUtils; // Needed from Electron v32 since can't access .path:
const get_path_for_file = (webUtils && webUtils.getPathForFile) ? webUtils.getPathForFile : file => file.path;
ipcRenderer.on("update", (event, msg) => {
let content = document.getElementById("content");
content.innerHTML = msg;
});
// Setup drag-and-drop...
window.ondragover = () => false;
window.ondragleave = () => false;
window.ondragend = () => false;
window.ondrop = (event) => {
event.preventDefault();
ipcRenderer.send("relay", {
receiver: "renderer",
channel: "open",
content: get_path_for_file(event.dataTransfer.files[0]),
});
ipcRenderer.send("stop_monitoring", null);
return false;
};