From ed8d828ff129d65bb227ecdb61b7d0072b46e040 Mon Sep 17 00:00:00 2001 From: cpradio Date: Fri, 29 Aug 2014 08:04:57 -0400 Subject: [PATCH] FIX: Added keyboard bindings for dismiss buttons --- .../javascripts/discourse/lib/keyboard_shortcuts.js | 3 +++ .../templates/discovery/topics.js.handlebars | 12 ++++++------ .../templates/mobile/discovery/topics.js.handlebars | 6 +++--- .../modal/keyboard_shortcuts_help.js.handlebars | 7 +++++-- config/locales/client.en.yml | 3 +++ 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js index 991879ba00e..d1b7cdca070 100644 --- a/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js +++ b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js @@ -35,6 +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 + 'd n': '#dismiss-new', // dismiss new + 'd t': '#dismiss-topics', // dismiss topics + 'd p': '#dismiss-posts', // dismiss posts 'n': '#user-notifications', // open notifications menu 'o,enter': '.topic-list tr.selected a.title', // open selected topic 'shift+r': '#topic-footer-buttons button.create', // reply to topic diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars b/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars index 92e101e158c..d88a9976c8c 100644 --- a/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars +++ b/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars @@ -1,11 +1,11 @@ {{#if showDismissAtTop}}
{{#if showDismissRead}} - - + + {{/if}} {{#if showResetNew}} - + {{/if}}
{{/if}} @@ -83,11 +83,11 @@ {{/if}} {{#if allLoaded}} {{#if showDismissRead}} - - + + {{/if}} {{#if showResetNew}} - + {{/if}} {{#if latest}} diff --git a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars index a76edca8621..2dcbabe56f8 100644 --- a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars +++ b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars @@ -29,11 +29,11 @@ {{/if}} {{#if allLoaded}} {{#if showDismissRead}} - - + + {{/if}} {{#if showResetNew}} - + {{/if}} {{#if latest}} 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 76617712dce..44d08a74ce2 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 @@ -10,8 +10,6 @@
  • {{{i18n keyboard_shortcuts_help.jump_to.starred}}}
  • {{{i18n keyboard_shortcuts_help.jump_to.categories}}}
  • - -

    {{i18n keyboard_shortcuts_help.navigation.title}}

    +
    +

    {{i18n keyboard_shortcuts_help.application.title}}

    diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 7fe3c5299ce..2aab846cdd7 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2058,6 +2058,9 @@ en: user_profile_menu: 'p Open user profile menu' search: '/ Search' help: '? Open keyboard shortcuts help' + dismiss_new: 'd, n Dismiss New' + dismiss_topics: 'd, t Dismiss Topics' + dismiss_posts: 'd, p Dismiss Posts' actions: title: 'Actions' star: 'f Star topic'