-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex-renderer.js
46 lines (41 loc) · 1.37 KB
/
index-renderer.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$("#quit_button").click(function(){
console.log(window);
window.api.send('quit-app');
})
$("#settings_button").click(function(){
window.api.send('show-preferences');
});
$("#help_button").click(function(){
$("#drag-file-container").toggle();
$("#help_section").toggle();
$(this).toggleClass("active");
});
$("#external_link").click(function(e){
e.preventDefault();
window.api.send('open-external-link', 'https://github.com/lowercasename/docdown');
})
$(document).ready(function() {
$("#convert_again_button").click(function(){
window.api.send('convert_again');
})
var holder = document.getElementById('drag-file')
holder.ondragover = (event) => {
event.preventDefault();
$("#drag-file").css("background-color","#ededed")
console.log("Dragging over!")
};
holder.ondragleave = (event) => {
event.preventDefault();
$("#drag-file").css("background-color","#fafafa")
console.log("Dragging left!")
};
holder.ondrop = (event) => {
event.preventDefault();
$("#drag-file").css("background-color","#fafafa")
console.log("Done did dropped!")
for (let f of event.dataTransfer.files) {
window.api.send('convert-file', {"path": f.path, "type": f.type});
}
return false;
};
});