From 4b4d775ad9696947cefe78f409a638360f38694c Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 29 May 2014 16:09:31 +1000 Subject: [PATCH] Add quote post --- .../components/keyboard_shortcuts_component.js | 11 ++++++++++- .../modal/keyboard_shortcuts_help.js.handlebars | 1 + config/locales/client.en.yml | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js index 0f89df1d6e8..55dd6c76f14 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 faf41abf574..b2e64bdddbf 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 2a9b57bbc70..49ae7ee3de7 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'