fix #62: allow empty password

This commit is contained in:
Antelle 2015-12-08 21:02:50 +03:00
parent 5fc6780912
commit 24a86abdbc
3 changed files with 16 additions and 6 deletions

View File

@ -190,6 +190,8 @@ var OpenView = Backbone.View.extend({
if ($(e.target).is('.open__last-item-icon-del')) {
this.model.removeFileInfo(id);
this.$el.find('.open__last-item[data-id="' + id + '"]').remove();
this.initialize();
this.render();
return;
}
this.showOpenFileInfo(this.model.fileInfos.get(id));
@ -197,7 +199,7 @@ var OpenView = Backbone.View.extend({
inputKeydown: function(e) {
var code = e.keyCode || e.which;
if (code === Keys.DOM_VK_RETURN && this.passwordInput.length) {
if (code === Keys.DOM_VK_RETURN) {
this.openDb();
} else if (code === Keys.DOM_VK_CAPS_LOCK) {
this.$el.find('.open__pass-warning').removeClass('invisible');

View File

@ -84,18 +84,25 @@ var SettingsAboutView = Backbone.View.extend({
validate: function() {
if (!this.model.get('passwordLength')) {
Alerts.error({
var that = this;
Alerts.yesno({
header: 'Empty password',
body: 'Please, enter the password. You will use it the next time you open this file.',
complete: (function() { this.$el.find('#settings__file-master-pass').focus(); }).bind(this)
body: 'Saving database with empty password makes it completely unprotected. Do you really want to do it?',
success: function() {
that.model.setPassword(kdbxweb.ProtectedValue.fromString(''));
that.saveToFile(true);
},
cancel: function() {
that.$el.find('#settings__file-master-pass').focus();
}
});
return false;
}
return true;
},
saveToFile: function() {
if (!this.validate()) {
saveToFile: function(skipValidation) {
if (skipValidation !== true && !this.validate()) {
return;
}
var that = this;

View File

@ -7,6 +7,7 @@ Release notes
`+` #46: option to show colorful icons
`+` #45: optional auto-lock on minimize
`+` option to disable searching for group
`+` #62: saving files with empty password
`-` #55: custom scrollbar issues
##### v0.4.6 (2015-11-25)