-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui_passwordDialog.html
47 lines (42 loc) · 1.39 KB
/
ui_passwordDialog.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
<div class="modal fade" id="passwordModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<form>
<div class="modal-header">
<h4 class="modal-title">Setup Your Password</h4>
</div>
<div class="modal-body">
<div class="form-group">
<p>This password will be used to encrypt your markdown data. It is app-wide (all markdowns use the same password).</p>
<p>Please keep password in mind. If you forget it, there is no other way to decrypt existing markdowns</p>
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwdInput">
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-default" data-dismiss="modal">Submit</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
function showPasswordDialog() {
return new Promise(function(resolve, reject) {
$("#passwordModal").on('shown.bs.modal', function () {
$("#pwdInput").focus();
});
$("#passwordModal").on('hide.bs.modal', function () {
var pwd = $("#pwdInput").val();
if(pwd.length == 0)
return false;
resolve(pwd);
});
// get password from user
$('#passwordModal').modal({
backdrop: 'static',
keyboard: false
})
});
}
</script>