-
Notifications
You must be signed in to change notification settings - Fork 1
/
folder-select.html
52 lines (51 loc) · 1.79 KB
/
folder-select.html
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
<!DOCTYPE html>
<html>
<head> </head>
<body>
<div class="contentBox">
<div class="cancelRow">
<div class="cancel" id="cancelButton" />
</div>
<div class="logo" />
<div class="pickFolder">
<div class="info">Pick a folder for your local backups.</div>
<div class="select-container">
<input type="file" id="folderSelect" nwdirectory directory>
<label for="folderSelect" class="folder-select-bg">Select Folder</label>
</div>
<div class="pathBox">
<p class="info" id="pathPara"></p>
<button id="applyButton" disabled>Confirm</button>
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="./folder-select.css" />
<link rel="stylesheet" type="text/css" href="./fonts/Poppins/poppins.css" />
<script src="./HTTPKoaServer.js"></script>
<script>
var win = gui.Window.get();
win.setShowInTaskbar(false);
var folderSelect = document.getElementById("folderSelect");
var applyButton = document.getElementById("applyButton");
var pathPara = document.getElementById("pathPara");
var cancelButton = document.getElementById("cancelButton");
win.on("loaded", () => {
if (backupPath) {
pathPara.innerHTML = "<span>Backup Location:</span><br>" + backupPath;
}
});
folderSelect.addEventListener("change", () => {
var path = "" + folderSelect.value;
if (path && path != backupPath) {
if (path.length > 35) {
path = "..." + path.slice(-35);
}
applyButton.disabled = false;
pathPara.innerHTML = "<span>Backup Location:</span><br>" + path;
} else {
applyButton.disabled = true;
}
});
</script>
</body>
</html>