diff --git a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js index 0f89df1d6..55dd6c76f 100644 --- a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js +++ b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js @@ -48,7 +48,8 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ '`': 'nextSection', '~': 'prevSection', '/': 'showSearch', - '?': 'showHelpModal' // open keyboard shortcut help + '?': 'showHelpModal', // open keyboard shortcut help + 'q': 'quoteReply' }, bindEvents: function(keyTrapper) { @@ -58,6 +59,14 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ _.each(this.FUNCTION_BINDINGS, this._bindToFunction, this); }, + quoteReply: function(){ + $('.topic-post.selected button.create').click(); + // lazy but should work for now + setTimeout(function(){ + $('#wmd-quote-post').click(); + }, 500); + }, + goToFirstPost: function() { this._jumpTo('jumpTop'); }, diff --git a/app/assets/javascripts/discourse/templates/modal/keyboard_shortcuts_help.js.handlebars b/app/assets/javascripts/discourse/templates/modal/keyboard_shortcuts_help.js.handlebars index faf41abf5..b2e64bddd 100644 --- a/app/assets/javascripts/discourse/templates/modal/keyboard_shortcuts_help.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/keyboard_shortcuts_help.js.handlebars @@ -35,6 +35,7 @@
  • {{{i18n keyboard_shortcuts_help.actions.share_post}}}
  • {{{i18n keyboard_shortcuts_help.actions.reply_topic}}}
  • {{{i18n keyboard_shortcuts_help.actions.reply_post}}}
  • +
  • {{{i18n keyboard_shortcuts_help.actions.quote_post}}}
  • {{{i18n keyboard_shortcuts_help.actions.like}}}
  • {{{i18n keyboard_shortcuts_help.actions.flag}}}
  • {{{i18n keyboard_shortcuts_help.actions.bookmark}}}
  • diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 2a9b57bbc..49ae7ee3d 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1837,6 +1837,7 @@ en: share_post: 's Share post' reply_topic: 'shift r Reply to topic' reply_post: 'r Reply to post' + quote_post: 'q Quote post' like: 'l Like post' flag: '! Flag post' bookmark: 'b Bookmark post'