-
Notifications
You must be signed in to change notification settings - Fork 0
/
initial.js
59 lines (50 loc) · 1.54 KB
/
initial.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
47
48
49
50
51
52
53
54
55
56
57
58
59
let dir;
let dir_path;
var current='C:';
var home_dir='C:';
var tagmodedisplayed=false;
foldernav.readFolder(home_dir);
db.createDatabase();
shortcuts.showRecent();
tagop.showTagList();
document.getElementById('seldir').addEventListener('input', _ => {
dir_path=dir.files[0].path+'\\';
console.log(dir_path);
db.addRecentDir(dir_path); //add selected directory to recent list
shortcuts.showRecent();
foldernav.readFolder(dir_path);
})
document.getElementById('fxbtn').addEventListener('click', _ => {
dir=document.getElementById('seldir');
dir.click();
})
document.getElementById('home').addEventListener('click', _ => {
if(current!==home_dir){
foldernav.readFolder(home_dir);
}
})
document.getElementById('createtag').addEventListener('click', _ => {
tagop.createTag();
})
document.getElementById('deletetag').addEventListener('click', _ => {
tagop.deleteTag();
})
document.getElementById('tagmode').addEventListener('click', _ => {
if(tagmodedisplayed){
foldernav.readFolder(current);
}else{
tagmode.renderFiles(current);
}
})
document.getElementById('back').addEventListener('click', _ => {
foldernav.readFolder(path.dirname(current)+'\\');
})
//dismiss dropdown when clicked outside
window.onclick = function(event) {
if (!event.target.matches('#dd-toggle') && !event.target.matches('#searchbox')) {
var dropdown = document.getElementById("tagdropdown");
if (dropdown.classList.contains('show')) {
dropdown.classList.remove('show');
}
}
}