-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (43 loc) · 1.79 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GPG PIN Entry</title>
<link href="bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<div class="text-center">
<h1 class="display-4">GPG PIN Entry</h1>
</div>
<div class="container">
<form onsubmit="form_ok()">
<p id="description">Default</p>
<div id="passphraseWrapper" class="form-group">
<label for="passphrase">Passphrase</label>
<input id="passphrase" type="password" class="form-control" placeholder="Enter passphrase"/>
</div>
<div class="float-right">
<button id="cancel" type="button" class="btn btn-secondary" onclick="form_cancel()">Cancel</button>
<button id="ok" type="submit" class="btn btn-primary">OK</button>
</div>
</form>
</div>
<script>
const electron = require("electron");
const configuration = electron.remote.getGlobal("configuration");
document.getElementById("description").innerText = configuration.description;
document.getElementById("passphraseWrapper").style.display =
configuration.isConfirmation ? "none" : "block";
if (!configuration.isConfirmation) {
document.getElementById("passphrase").focus();
}
function form_ok() {
const passphrase = !configuration.isConfirmation && document.getElementById("passphrase").value;
electron.ipcRenderer.send('synchronous-message', 'ok', passphrase)
}
function form_cancel() {
electron.ipcRenderer.send('synchronous-message', 'cancel')
}
</script>
</body>
</html>