mirror of https://github.com/keeweb/keeweb.git
Merge branch 'release-1.0' into develop
Conflicts: app/scripts/models/app-settings-model.js release-notes.md
This commit is contained in:
commit
0d256ac6c3
|
@ -123,6 +123,7 @@ var AppModel = Backbone.Model.extend({
|
|||
this.menu.filesSection.removeAllItems();
|
||||
this.tags.splice(0, this.tags.length);
|
||||
this.filter = {};
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
closeFile: function(file) {
|
||||
|
|
|
@ -20,7 +20,8 @@ var AppSettingsModel = Backbone.Model.extend({
|
|||
colorfulIcons: false,
|
||||
lockOnMinimize: true,
|
||||
lockOnCopy: false,
|
||||
helpTipCopyShown: false
|
||||
helpTipCopyShown: false,
|
||||
skipOpenLocalWarn: false
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
|
|
|
@ -113,6 +113,12 @@ var Locale = {
|
|||
openSelectFile: 'Select a file',
|
||||
openSelectFileBody: 'Select a file from your Dropbox which you would like to open',
|
||||
openPassFor: 'Password for',
|
||||
openRemoveLastQuestion: 'Delete local file?',
|
||||
openRemoveLastQuestionBody: 'The file you are deleting is stored only in browser. Delete it permanently?',
|
||||
openLocalFile: 'Local file',
|
||||
openLocalFileBody: 'You are going to open a local file. Changes you make will not be saved back to file system. ' +
|
||||
'To get the file with your data, export it from settings.',
|
||||
openLocalFileDontShow: 'Don\'t show this again',
|
||||
|
||||
detAttDownload: 'Shift-click attachment button to download or ',
|
||||
detAttDelToRemove: 'Delete to remove',
|
||||
|
|
|
@ -457,7 +457,11 @@ var AppView = Backbone.View.extend({
|
|||
}
|
||||
if (this.views.settings) {
|
||||
if (this.views.settings.page === page || !menuItem) {
|
||||
this.showEntries();
|
||||
if (this.model.files.hasOpenFiles()) {
|
||||
this.showEntries();
|
||||
} else {
|
||||
this.showLastOpenFile();
|
||||
}
|
||||
} else {
|
||||
if (menuItem) {
|
||||
this.model.menu.select({item: menuItem});
|
||||
|
|
|
@ -87,9 +87,34 @@ var OpenView = Backbone.View.extend({
|
|||
Backbone.View.prototype.remove.apply(this, arguments);
|
||||
},
|
||||
|
||||
showLocalFileAlert: function() {
|
||||
if (this.model.settings.get('skipOpenLocalWarn')) {
|
||||
return;
|
||||
}
|
||||
var that = this;
|
||||
Alerts.alert({
|
||||
header: Locale.openLocalFile,
|
||||
body: Locale.openLocalFileBody,
|
||||
icon: 'file-text',
|
||||
buttons: [
|
||||
{result: 'skip', title: Locale.openLocalFileDontShow, error: true},
|
||||
{result: 'ok', title: Locale.alertOk}
|
||||
],
|
||||
click: '',
|
||||
esc: '',
|
||||
enter: '',
|
||||
success: function(res) {
|
||||
if (res === 'skip') {
|
||||
that.model.settings.set('skipOpenLocalWarn', true);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
fileSelected: function(e) {
|
||||
var file = e.target.files[0];
|
||||
if (file) {
|
||||
this.showLocalFileAlert();
|
||||
this.processFile(file);
|
||||
}
|
||||
},
|
||||
|
@ -193,15 +218,35 @@ var OpenView = Backbone.View.extend({
|
|||
}
|
||||
var id = $(e.target).closest('.open__last-item').data('id').toString();
|
||||
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();
|
||||
var fileInfo = this.model.fileInfos.get(id);
|
||||
if (!fileInfo.get('storage')) {
|
||||
var that = this;
|
||||
Alerts.yesno({
|
||||
header: Locale.openRemoveLastQuestion,
|
||||
body: Locale.openRemoveLastQuestionBody,
|
||||
buttons: [
|
||||
{result: 'yes', title: Locale.alertYes},
|
||||
{result: '', title: Locale.alertNo}
|
||||
],
|
||||
success: function() {
|
||||
that.removeFile(id);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.removeFile(id);
|
||||
return;
|
||||
}
|
||||
this.showOpenFileInfo(this.model.fileInfos.get(id));
|
||||
},
|
||||
|
||||
removeFile: function(id) {
|
||||
this.model.removeFileInfo(id);
|
||||
this.$el.find('.open__last-item[data-id="' + id + '"]').remove();
|
||||
this.initialize();
|
||||
this.render();
|
||||
},
|
||||
|
||||
inputKeydown: function(e) {
|
||||
var code = e.keyCode || e.which;
|
||||
if (code === Keys.DOM_VK_RETURN) {
|
||||
|
@ -263,6 +308,7 @@ var OpenView = Backbone.View.extend({
|
|||
var dataFile = _.find(files, function(file) { return file.name.split('.').pop().toLowerCase() === 'kdbx'; });
|
||||
var keyFile = _.find(files, function(file) { return file.name.split('.').pop().toLowerCase() === 'key'; });
|
||||
if (dataFile) {
|
||||
this.showLocalFileAlert();
|
||||
this.setFile(dataFile, keyFile);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -9,6 +9,12 @@ Storage providers, usability improvements
|
|||
`+` shortcut to copy username
|
||||
`-` fix #88: capslock indicator
|
||||
|
||||
##### v1.0.3 (TBD)
|
||||
Hotfix
|
||||
`+` #94: warn user about local files
|
||||
`-` #92: save files on exit
|
||||
`-` #95: unlock by opening settings
|
||||
|
||||
##### v1.0.2 (2016-02-17)
|
||||
Hotfix
|
||||
`-` #80: dragdrop bug
|
||||
|
|
Loading…
Reference in New Issue