diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-13 12:48:33 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-13 12:48:33 +0900 |
| commit | 89b5d976ee3a2144db49d0d52cbaddc4115bb139 (patch) | |
| tree | 138b37b6ef65841598b8d1f611935e6eb89187de /src/client/app/common/scripts | |
| parent | Merge pull request #2896 from syuilo/greenkeeper/reconnecting-websocket-4.1.7 (diff) | |
| download | sharkey-89b5d976ee3a2144db49d0d52cbaddc4115bb139.tar.gz sharkey-89b5d976ee3a2144db49d0d52cbaddc4115bb139.tar.bz2 sharkey-89b5d976ee3a2144db49d0d52cbaddc4115bb139.zip | |
Add some keyboard shortcuts of note
Diffstat (limited to 'src/client/app/common/scripts')
| -rw-r--r-- | src/client/app/common/scripts/note-mixin.ts | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts index 17182e2757..491c77747a 100644 --- a/src/client/app/common/scripts/note-mixin.ts +++ b/src/client/app/common/scripts/note-mixin.ts @@ -1,7 +1,8 @@ import parse from '../../../../mfm/parse'; import { sum } from '../../../../prelude/array'; -import MkNoteMenu from '..//views/components/note-menu.vue'; +import MkNoteMenu from '../views/components/note-menu.vue'; import MkReactionPicker from '../views/components/reaction-picker.vue'; +import Ok from '../views/components/ok.vue'; function focus(el, fn) { const target = fn(el); @@ -31,6 +32,8 @@ export default (opts: Opts = {}) => ({ 'r|left': () => this.reply(true), 'e|a|plus': () => this.react(true), 'q|right': () => this.renote(true), + 'f|b': this.favorite, + 'delete|ctrl+d': this.del, 'ctrl+q|ctrl+right': this.renoteDirectly, 'up|k|shift+tab': this.focusBefore, 'down|j|tab': this.focusAfter, @@ -129,6 +132,20 @@ export default (opts: Opts = {}) => ({ }); }, + favorite() { + (this as any).api('notes/favorites/create', { + noteId: this.appearNote.id + }).then(() => { + (this as any).os.new(Ok); + }); + }, + + del() { + (this as any).api('notes/delete', { + noteId: this.appearNote.id + }); + }, + menu(viaKeyboard = false) { (this as any).os.new(MkNoteMenu, { source: this.$refs.menuButton, |