5 changed files with 136 additions and 3 deletions
@ -0,0 +1,28 @@
|
||||
<!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>Rambox</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 placeholder="Enter your password..." onkeyup="doValidate(this.value)" style="text-align:center;font-size:20px;font-family:Verdana;padding:10px;" /></div> |
||||
<script> |
||||
var to; |
||||
function doValidate(value) { |
||||
clearTimeout(to); |
||||
to = setTimeout(function() { |
||||
const {ipcRenderer} = require('electron'); |
||||
if ( ipcRenderer.sendSync('validateMasterPassword', value) ) { |
||||
//require('electron').remote. |
||||
} else { |
||||
alert('The password is incorrect. Try again...'); |
||||
} |
||||
}, 3000); |
||||
} |
||||
</script> |
||||
</body> |
||||
</html> |
@ -0,0 +1,37 @@
|
||||
Ext.apply(Ext.form.field.VTypes, { |
||||
daterange: function(val, field) { |
||||
var date = field.parseDate(val); |
||||
|
||||
if (!date) { |
||||
return false; |
||||
} |
||||
if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) { |
||||
var start = field.up('form').down('#' + field.startDateField); |
||||
start.setMaxValue(date); |
||||
start.validate(); |
||||
this.dateRangeMax = date; |
||||
} else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) { |
||||
var end = field.up('form').down('#' + field.endDateField); |
||||
end.setMinValue(date); |
||||
end.validate(); |
||||
this.dateRangeMin = date; |
||||
} |
||||
/* |
||||
* Always return true since we're only using this vtype to set the |
||||
* min/max allowed values (these are tested for after the vtype test) |
||||
*/ |
||||
return true; |
||||
}, |
||||
|
||||
daterangeText: 'Start date must be less than end date', |
||||
|
||||
password: function(val, field) { |
||||
if (field.initialPassField) { |
||||
var pwd = field.up('form').down('#' + field.initialPassField); |
||||
return (val == pwd.getValue()); |
||||
} |
||||
return true; |
||||
}, |
||||
|
||||
passwordText: 'Passwords do not match' |
||||
}); |
Loading…
Reference in new issue