From 3c6c929854ec1897893d096ea6076c0875564dde Mon Sep 17 00:00:00 2001 From: antelle Date: Tue, 8 Oct 2019 19:41:08 +0200 Subject: [PATCH 1/4] fix #1289: crash on Auto sorting mode --- app/scripts/collections/entry-collection.js | 4 ++-- release-notes.md | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/scripts/collections/entry-collection.js b/app/scripts/collections/entry-collection.js index a06e0ff6..a0b68dd3 100644 --- a/app/scripts/collections/entry-collection.js +++ b/app/scripts/collections/entry-collection.js @@ -17,10 +17,10 @@ class EntryCollection extends Collection { '-created': Comparators.dateComparator('created', false), 'updated': Comparators.dateComparator('updated', true), '-updated': Comparators.dateComparator('updated', false), - '-attachments'(x, y) { + '-attachments': (x, y) => { return this.attachmentSortVal(x).localeCompare(this.attachmentSortVal(y)); }, - '-rank': Comparators.rankComparator() + '-rank': Comparators.rankComparator().bind(this) }; defaultComparator = 'title'; diff --git a/release-notes.md b/release-notes.md index d732c143..7bf1980e 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,8 @@ Release notes ------------- +##### v1.11.7 (2019-10-08) +`-` fix #1289: crash on Auto sorting mode + ##### v1.11.6 (2019-10-04) `-` fix #1285: issues in moving entries across files From 77423ad833d94adc6cb04a960fbc855b8a1be1f8 Mon Sep 17 00:00:00 2001 From: antelle Date: Tue, 8 Oct 2019 20:09:06 +0200 Subject: [PATCH 2/4] fix #1288: issues when opening a file during in auto-type mode --- app/scripts/auto-type/index.js | 1 - app/scripts/comp/browser/key-handler.js | 2 +- app/scripts/views/app-view.js | 3 ++- .../views/auto-type/auto-type-select-view.js | 6 ++++++ app/scripts/views/modal-view.js | 3 ++- app/scripts/views/open-view.js | 14 ++++++++------ release-notes.md | 1 + 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/scripts/auto-type/index.js b/app/scripts/auto-type/index.js index c5e9fafd..c2cd02ec 100644 --- a/app/scripts/auto-type/index.js +++ b/app/scripts/auto-type/index.js @@ -254,7 +254,6 @@ const AutoType = { Events.emit('open-file'); Events.once('closed-open-view', () => { this.selectEntryView.show(); - this.selectEntryView.setupKeys(); }); }); }, diff --git a/app/scripts/comp/browser/key-handler.js b/app/scripts/comp/browser/key-handler.js index b41166d9..5a821a36 100644 --- a/app/scripts/comp/browser/key-handler.js +++ b/app/scripts/comp/browser/key-handler.js @@ -63,7 +63,7 @@ class KeyHandler { const keyShortcuts = this.shortcuts[code]; if (keyShortcuts && keyShortcuts.length) { for (const sh of keyShortcuts) { - if (this.modal && sh.modal !== this.modal) { + if (this.modal && (sh.modal !== this.modal || sh.modal === '*')) { e.stopPropagation(); continue; } diff --git a/app/scripts/views/app-view.js b/app/scripts/views/app-view.js index 8bc7eff5..7af5bbd9 100644 --- a/app/scripts/views/app-view.js +++ b/app/scripts/views/app-view.js @@ -103,7 +103,8 @@ class AppView extends View { this.onKey( Keys.DOM_VK_I, this.openDevTools, - KeyHandler.SHORTCUT_ACTION + KeyHandler.SHORTCUT_OPT + KeyHandler.SHORTCUT_ACTION + KeyHandler.SHORTCUT_OPT, + '*' ); } diff --git a/app/scripts/views/auto-type/auto-type-select-view.js b/app/scripts/views/auto-type/auto-type-select-view.js index 077b8a06..21418b67 100644 --- a/app/scripts/views/auto-type/auto-type-select-view.js +++ b/app/scripts/views/auto-type/auto-type-select-view.js @@ -61,6 +61,12 @@ class AutoTypeSelectView extends View { this.once('remove', () => { KeyHandler.setModal(null); }); + this.on('show', () => { + KeyHandler.setModal('auto-type'); + }); + this.on('hide', () => { + KeyHandler.setModal(null); + }); } render() { diff --git a/app/scripts/views/modal-view.js b/app/scripts/views/modal-view.js index c1cddfad..829d7826 100644 --- a/app/scripts/views/modal-view.js +++ b/app/scripts/views/modal-view.js @@ -21,9 +21,10 @@ class ModalView extends View { if (typeof this.model.enter === 'string') { this.onKey(Keys.DOM_VK_RETURN, this.enterPressed, false, 'alert'); } + const prevModal = KeyHandler.modal; KeyHandler.setModal('alert'); this.once('remove', () => { - KeyHandler.setModal(null); + KeyHandler.setModal(prevModal); if (this.model.view) { this.model.view.remove(); } diff --git a/app/scripts/views/open-view.js b/app/scripts/views/open-view.js index 1b28b8a7..93caccb7 100644 --- a/app/scripts/views/open-view.js +++ b/app/scripts/views/open-view.js @@ -60,15 +60,17 @@ class OpenView extends View { super(model); this.resetParams(); this.passwordInput = new SecureInput(); - this.onKey(Keys.DOM_VK_Z, this.undoKeyPress, KeyHandler.SHORTCUT_ACTION); - this.onKey(Keys.DOM_VK_TAB, this.tabKeyPress); - this.onKey(Keys.DOM_VK_ENTER, this.enterKeyPress); - this.onKey(Keys.DOM_VK_RETURN, this.enterKeyPress); - this.onKey(Keys.DOM_VK_DOWN, this.moveOpenFileSelectionDown); - this.onKey(Keys.DOM_VK_UP, this.moveOpenFileSelectionUp); + this.onKey(Keys.DOM_VK_Z, this.undoKeyPress, KeyHandler.SHORTCUT_ACTION, 'open'); + this.onKey(Keys.DOM_VK_TAB, this.tabKeyPress, null, 'open'); + this.onKey(Keys.DOM_VK_ENTER, this.enterKeyPress, null, 'open'); + this.onKey(Keys.DOM_VK_RETURN, this.enterKeyPress, null, 'open'); + this.onKey(Keys.DOM_VK_DOWN, this.moveOpenFileSelectionDown, null, 'open'); + this.onKey(Keys.DOM_VK_UP, this.moveOpenFileSelectionUp, null, 'open'); this.listenTo(Events, 'main-window-focus', this.windowFocused.bind(this)); + KeyHandler.setModal('open'); this.once('remove', () => { this.passwordInput.reset(); + KeyHandler.setModal(null); }); } diff --git a/release-notes.md b/release-notes.md index 7bf1980e..64f66c1b 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,6 +2,7 @@ Release notes ------------- ##### v1.11.7 (2019-10-08) `-` fix #1289: crash on Auto sorting mode +`-` fix #1288: issues when opening a file during in auto-type mode ##### v1.11.6 (2019-10-04) `-` fix #1285: issues in moving entries across files From 458ba2de77f6fcbc97c8b40a9ca6c3466d133441 Mon Sep 17 00:00:00 2001 From: Antelle Date: Tue, 8 Oct 2019 20:19:45 +0200 Subject: [PATCH 3/4] bump version --- desktop/package-lock.json | 2 +- desktop/package.json | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/package-lock.json b/desktop/package-lock.json index 52c5f785..1b8752b8 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -1,6 +1,6 @@ { "name": "KeeWeb", - "version": "1.11.6", + "version": "1.11.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/desktop/package.json b/desktop/package.json index 02215600..f840846b 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -1,6 +1,6 @@ { "name": "KeeWeb", - "version": "1.11.6", + "version": "1.11.7", "description": "Free cross-platform password manager compatible with KeePass", "main": "main.js", "homepage": "https://keeweb.info", diff --git a/package-lock.json b/package-lock.json index 762d459f..12a89f85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "keeweb", - "version": "1.11.6", + "version": "1.11.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 61bc80c6..6ac2b397 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keeweb", - "version": "1.11.6", + "version": "1.11.7", "description": "Free cross-platform password manager compatible with KeePass", "main": "Gruntfile.js", "private": true, From dc6afb765a4202f6e042d6e168582410a7b1f4e9 Mon Sep 17 00:00:00 2001 From: Antelle Date: Wed, 9 Oct 2019 22:54:32 +0200 Subject: [PATCH 4/4] added a hook for rcedit while wine is not working on macOS --- Gruntfile.js | 3 +++ build/util/hook-rcedit.js | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 build/util/hook-rcedit.js diff --git a/Gruntfile.js b/Gruntfile.js index 5b720723..c8d427de 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,6 +5,9 @@ const path = require('path'); const webpackConfig = require('./build/webpack.config'); const pkg = require('./package.json'); +const hookRcedit = require('./build/util/hook-rcedit'); + +hookRcedit.setup(); module.exports = function(grunt) { require('time-grunt')(grunt); diff --git a/build/util/hook-rcedit.js b/build/util/hook-rcedit.js new file mode 100644 index 00000000..035ae44b --- /dev/null +++ b/build/util/hook-rcedit.js @@ -0,0 +1,21 @@ +const childProcess = require('child_process'); + +// remove this once wine can be run on macOS + +const childProcessSpawn = childProcess.spawn; + +function hookedSpawn(command, options) { + if (command === 'wine') { + options = options.map(option => { + if (option.includes(' ')) { + option = `"${option.replace('"', '\\"')}"`; + } + return option; + }); + } + return childProcessSpawn.call(childProcess, command, options); +} + +module.exports.setup = function() { + childProcess.spawn = hookedSpawn; +};