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
4 changed files with 18 additions and 1 deletions

View File

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

View File

@ -65,9 +65,10 @@ const bindings = {
"shift+p": { handler: "pinUnpinTopic" }, "shift+p": { handler: "pinUnpinTopic" },
"shift+r": { handler: "replyToTopic" }, "shift+r": { handler: "replyToTopic" },
"shift+s": { click: "#topic-footer-buttons button.share", anonymous: true }, // share topic "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+z shift+z": { handler: "logout" },
"shift+f11": { handler: "fullscreenComposer", global: true }, "shift+f11": { handler: "fullscreenComposer", global: true },
"shift+u": { handler: "deferTopic" },
t: { postAction: "replyAsNewTopic" }, t: { postAction: "replyAsNewTopic" },
u: { handler: "goBack", anonymous: true }, u: { handler: "goBack", anonymous: true },
"x r": { "x r": {
@ -618,5 +619,9 @@ export default {
_replyToPost() { _replyToPost() {
this.container.lookup("controller:topic").send("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.up_down}}}</li>
<li>{{{shortcuts.navigation.open}}}</li> <li>{{{shortcuts.navigation.open}}}</li>
<li>{{{shortcuts.navigation.next_prev}}}</li> <li>{{{shortcuts.navigation.next_prev}}}</li>
<li>{{{shortcuts.navigation.go_to_unread_post}}}</li>
</ul> </ul>
</div> </div>
<div> <div>
@ -64,6 +65,7 @@
<li>{{{shortcuts.actions.mark_regular}}}</li> <li>{{{shortcuts.actions.mark_regular}}}</li>
<li>{{{shortcuts.actions.mark_tracking}}}</li> <li>{{{shortcuts.actions.mark_tracking}}}</li>
<li>{{{shortcuts.actions.mark_watching}}}</li> <li>{{{shortcuts.actions.mark_watching}}}</li>
<li>{{{shortcuts.actions.defer}}}</li>
<li>{{{shortcuts.actions.print}}}</li> <li>{{{shortcuts.actions.print}}}</li>
</ul> </ul>
</div> </div>

View File

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