Browse Source

masterpassword: Avoid so focus doesn't disappear.

Also reformat masterpassword.html in case anyone needs to actually
read it in the future.
pull/3202/head
TheGoddessInari 6 years ago
parent
commit
26702dca86
No known key found for this signature in database
GPG Key ID: 1209B1B7632D69A
  1. 59
      masterpassword.html

59
masterpassword.html

@ -1,32 +1,57 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Rambox</title> <title>Rambox-OS</title>
</head> </head>
<body> <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="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="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 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;">&raquo;</button></div> <div style="text-align:center;margin:30px 0;">
<div style="text-align:center;margin-top:60px;"><a href="#" onclick="exit()" style="text-decoration:none;color:#4e9dbb;font-family:Arial;">Exit Rambox-OS</a></div> <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;">
&raquo;
</button>
</div>
<div style="text-align:center;margin-top:60px;">
<a href="#" onclick="exit()" style="text-decoration:none;color:#4e9dbb;font-family:Arial;">
Exit Rambox-OS
</a>
</div>
<script> <script>
function doValidate(e, value) { function doValidate(e, value) {
if (e.keyCode == 13) { if (e.keyCode == 13) {
const { ipcRenderer } = require('electron'); const {
if ( !ipcRenderer.sendSync('validateMasterPassword', value) ) { ipcRenderer
alert('The password is incorrect. Try again...'); } = require('electron');
document.getElementsByTagName("input")[0].value = ""; if (!ipcRenderer.sendSync('validateMasterPassword', value)) {
const input = document.getElementsByTagName('input')[0];
input.value = '';
input.placeholder = 'The password is incorrect. Try again...';
}
} }
} }
}
function onButtonClick() { function onButtonClick() {
return doValidate({ keyCode: 13 }, document.getElementsByTagName('input')[0].value); return doValidate({
} keyCode: 13
function exit() { }, document.getElementsByTagName('input')[0].value);
require('electron').remote.app.quit(); }
}
function exit() {
require('electron').remote.app.quit();
}
</script> </script>
</body> </body>
</html> </html>

Loading…
Cancel
Save