|
|
|
@ -10,7 +10,9 @@
|
|
|
|
|
<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 placeholder="Enter your password..." onpaste="handlePaste(event)" 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 id='wrong-pass' style="color:crimson;text-align:center;font-size:20px;font-family:Verdana;margin:30px 0;visibility:hidden;">The password is incorrect. Try again...</div> |
|
|
|
|
<div style="text-align:center;margin-top:60px;"><a href="#" onclick="exit()" style="text-decoration:none;color:#4e9dbb;font-family:Arial;">Exit Rambox</a></div> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
function handlePaste(e) { |
|
|
|
|
var clipboardData, pastedData; |
|
|
|
@ -26,11 +28,12 @@
|
|
|
|
|
// Do whatever with pasteddata |
|
|
|
|
} |
|
|
|
|
function doValidate(e, value) { |
|
|
|
|
document.getElementById('wrong-pass').style.visibility = 'hidden' |
|
|
|
|
if (e.keyCode == 13) { |
|
|
|
|
const { ipcRenderer } = require('electron'); |
|
|
|
|
if ( !ipcRenderer.sendSync('validateMasterPassword', value) ) { |
|
|
|
|
alert('The password is incorrect. Try again...'); |
|
|
|
|
document.getElementsByTagName("input")[0].value = ""; |
|
|
|
|
document.getElementById('wrong-pass').style.visibility = 'visible' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|