From 1ac033ff184a82840a584a12bed1e74960619f57 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 18 Sep 2018 14:30:50 +0900 Subject: [PATCH] Improve keyboard shortcut --- .../desktop/views/components/notes.note.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/client/app/desktop/views/components/notes.note.vue b/src/client/app/desktop/views/components/notes.note.vue index 18a1ce9e5..e53dbe121 100644 --- a/src/client/app/desktop/views/components/notes.note.vue +++ b/src/client/app/desktop/views/components/notes.note.vue @@ -115,9 +115,19 @@ export default Vue.extend({ return { 'r|left': this.reply, 'a|plus': () => this.react(true), - 'n|right': this.renote, + 'q|n|right': this.renote, 'up|shift+tab': this.focusBefore, 'down|tab': this.focusAfter, + '1': () => this.reactDirectly('like'), + '2': () => this.reactDirectly('love'), + '3': () => this.reactDirectly('laugh'), + '4': () => this.reactDirectly('hmm'), + '5': () => this.reactDirectly('surprise'), + '6': () => this.reactDirectly('congrats'), + '7': () => this.reactDirectly('angry'), + '8': () => this.reactDirectly('confused'), + '9': () => this.reactDirectly('rip'), + '0': () => this.reactDirectly('pudding'), }; }, @@ -252,6 +262,13 @@ export default Vue.extend({ }).$once('closed', this.focus); }, + reactDirectly(reaction) { + (this as any).api('notes/reactions/create', { + noteId: this.p.id, + reaction: reaction + }); + }, + menu() { (this as any).os.new(MkNoteMenu, { source: this.$refs.menuButton,