This repository has been archived by the owner on Oct 13, 2023. It is now read-only.
forked from ramboxapp/community-edition
-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
masterpassword.html
57 lines (51 loc) · 1.73 KB
/
masterpassword.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
53
54
55
56
57
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Hamsket</title>
</head>
<body>
<div
style="background-image: url(resources/Icon.png);background-size:200px;width:200px;height:200px;position:relative;left:50%;margin-left:-100px;margin-top:100px;">
</div>
<div style="color:#FFF;text-align:center;font-size:20px;font-family:Verdana;margin:30px 0;">Master Password</div>
<div style="text-align:center;margin:30px 0;">
<input type="password" autofocus tabindex="-1" placeholder="Enter your password..."
onkeyup="doValidate(event, this.value)"
style="text-align:center;font-size:20px;font-family:Verdana;padding:10px;border: 0;" />
<button onclick="onButtonClick()"
style="height:44px;border:0;width:44px;position:relative;top:2px;font-size:30px;background-color:#053767;color:white;">
»
</button>
</div>
<div style="text-align:center;margin-top:60px;">
<a href="#" onclick="exit()" style="text-decoration:none;color:#4e9dbb;font-family:Arial;">
Exit Hamsket
</a>
</div>
<script>
function doValidate(e, value) {
if (e.keyCode == 13) {
const {
ipcRenderer
} = require('electron');
if (!ipcRenderer.sendSync('validateMasterPassword', value)) {
const input = document.getElementsByTagName('input')[0];
input.value = '';
input.placeholder = 'The password is incorrect. Try again...';
}
}
}
function onButtonClick() {
return doValidate({
keyCode: 13
}, document.getElementsByTagName('input')[0].value);
}
function exit() {
require('@electron/remote').app.quit();
}
</script>
</body>
</html>