From 1678a91a60c9025967448cb40234e2a0ed0a14ed Mon Sep 17 00:00:00 2001 From: cpradio Date: Tue, 26 Aug 2014 20:30:20 -0400 Subject: [PATCH] Add shortcuts for Profile Menu and Hamburger Menu Added shortcuts of p and = for the profile and hamburger menu https://meta.discourse.org/t/keyboard-shortcuts-wish-list/15952 --- app/assets/javascripts/discourse/lib/keyboard_shortcuts.js | 4 +++- .../templates/modal/keyboard_shortcuts_help.js.handlebars | 2 ++ config/locales/client.en.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js index 53ead108e1c..473f9d14e57 100644 --- a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js +++ b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js @@ -35,7 +35,9 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ 'm r': 'div.notification-options li[data-id="1"] a', // mark topic as regular 'm t': 'div.notification-options li[data-id="2"] a', // mark topic as tracking 'm w': 'div.notification-options li[data-id="3"] a', // mark topic as watching - 'n': '#user-notifications', // open notifictions menu + 'n': '#user-notifications', // open notifications menu + '=': '#site-map', // open site map menu + 'p': '#current-user', // open current user menu 'o,enter': '.topic-list tr.selected a.title', // open selected topic 'shift+r': '#topic-footer-buttons button.create', // reply to topic 'shift+s': '#topic-footer-buttons button.share', // share topic 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 998819db1bd..76617712dce 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 @@ -24,6 +24,8 @@ diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 50b7c981eea..65d0f10c9f2 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2052,6 +2052,8 @@ en: title: 'Application' create: 'c Create a new topic' notifications: 'n Open notifications' + site_map_menu: '= Open site map menu' + user_profile_menu: 'p Open user profile menu' search: '/ Search' help: '? Open keyboard shortcuts help' actions: