UX: add shortcut for deferring topics (#7798)

This commit is contained in:
Osama Sayegh 2019-06-25 07:20:55 +03:00 committed by GitHub
parent a0aeabbb94
commit 2eece2c41b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 1 deletions

View File

@ -77,6 +77,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
keys2: [SHIFT, "k"],
keysDelimiter: PLUS,
shortcutsDelimiter: "slash"
}),
go_to_unread_post: buildShortcut("navigation.go_to_unread_post", {
keys1: [SHIFT, "l"],
keysDelimiter: PLUS
})
},
application: {
@ -158,6 +162,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
print: buildShortcut("actions.print", {
keys1: [CTRL, "p"],
keysDelimiter: PLUS
}),
defer: buildShortcut("actions.defer", {
keys1: [SHIFT, "u"],
keysDelimiter: PLUS
})
}
}

View File

@ -65,9 +65,10 @@ const bindings = {
"shift+p": { handler: "pinUnpinTopic" },
"shift+r": { handler: "replyToTopic" },
"shift+s": { click: "#topic-footer-buttons button.share", anonymous: true }, // share topic
"shift+u": { handler: "goToUnreadPost" },
"shift+l": { handler: "goToUnreadPost" },
"shift+z shift+z": { handler: "logout" },
"shift+f11": { handler: "fullscreenComposer", global: true },
"shift+u": { handler: "deferTopic" },
t: { postAction: "replyAsNewTopic" },
u: { handler: "goBack", anonymous: true },
"x r": {
@ -618,5 +619,9 @@ export default {
_replyToPost() {
this.container.lookup("controller:topic").send("replyToPost");
},
deferTopic() {
this.container.lookup("controller:topic").send("deferTopic");
}
};

View File

@ -23,6 +23,7 @@
<li>{{{shortcuts.navigation.up_down}}}</li>
<li>{{{shortcuts.navigation.open}}}</li>
<li>{{{shortcuts.navigation.next_prev}}}</li>
<li>{{{shortcuts.navigation.go_to_unread_post}}}</li>
</ul>
</div>
<div>
@ -64,6 +65,7 @@
<li>{{{shortcuts.actions.mark_regular}}}</li>
<li>{{{shortcuts.actions.mark_tracking}}}</li>
<li>{{{shortcuts.actions.mark_watching}}}</li>
<li>{{{shortcuts.actions.defer}}}</li>
<li>{{{shortcuts.actions.print}}}</li>
</ul>
</div>

View File

@ -2853,6 +2853,7 @@ en:
up_down: "%{shortcut} Move selection &uarr; &darr;"
open: "%{shortcut} Open selected topic"
next_prev: "%{shortcut} Next/previous section"
go_to_unread_post: "%{shortcut} Go to the first unread post"
application:
title: "Application"
create: "%{shortcut} Create a new topic"
@ -2889,6 +2890,7 @@ en:
mark_tracking: "%{shortcut} Track topic"
mark_watching: "%{shortcut} Watch topic"
print: "%{shortcut} Print topic"
defer: "%{shortcut} Defer topic"
badges:
earned_n_times: