diff --git a/frontend/src/components/files/Listing.vue b/frontend/src/components/files/Listing.vue index 3e4c64c2..4c222285 100644 --- a/frontend/src/components/files/Listing.vue +++ b/frontend/src/components/files/Listing.vue @@ -190,7 +190,7 @@ export default { document.removeEventListener('drop', this.drop) }, methods: { - ...mapMutations([ 'updateUser' ]), + ...mapMutations([ 'updateUser', 'addSelected' ]), base64: function (name) { return window.btoa(unescape(encodeURIComponent(name))) }, @@ -213,6 +213,19 @@ export default { case 'v': this.paste(event) break + case 'a': + event.preventDefault() + for (let file of this.items.files) { + if (this.$store.state.selected.indexOf(file.index) === -1) { + this.addSelected(file.index) + } + } + for (let dir of this.items.dirs) { + if (this.$store.state.selected.indexOf(dir.index) === -1) { + this.addSelected(dir.index) + } + } + break } }, preventDefault (event) { diff --git a/frontend/src/components/prompts/Prompts.vue b/frontend/src/components/prompts/Prompts.vue index 29d4112b..00ed511f 100644 --- a/frontend/src/components/prompts/Prompts.vue +++ b/frontend/src/components/prompts/Prompts.vue @@ -1,6 +1,6 @@ @@ -46,6 +46,33 @@ export default { } } }, + created () { + window.addEventListener('keydown', (event) => { + if (this.show == null) + return + + let prompt = this.$refs.currentComponent; + + // Enter + if (event.keyCode == 13) { + switch (this.show) { + case 'delete': + prompt.submit() + break; + case 'copy': + prompt.copy(event) + break; + case 'move': + prompt.move(event) + break; + case 'replace': + prompt.showConfirm(event) + break; + } + + } + }) + }, computed: { ...mapState(['show', 'plugins']), currentComponent: function () {