diff --git a/assets/javascripts/app/shortcuts.coffee b/assets/javascripts/app/shortcuts.coffee index 11140667..8ea37a24 100644 --- a/assets/javascripts/app/shortcuts.coffee +++ b/assets/javascripts/app/shortcuts.coffee @@ -104,6 +104,9 @@ class app.Shortcuts when 40 @trigger 'pageBottom' false + when 188 + @trigger 'preferences' + false handleKeydownShiftEvent: (event, _force) -> return @handleKeydownEvent(event, true) if not _force and event.which in [37, 38, 39, 40] and @swapArrowKeysBehavior() diff --git a/assets/javascripts/templates/pages/help_tmpl.coffee b/assets/javascripts/templates/pages/help_tmpl.coffee index afee16ea..c6489c1d 100644 --- a/assets/javascripts/templates/pages/help_tmpl.coffee +++ b/assets/javascripts/templates/pages/help_tmpl.coffee @@ -45,7 +45,7 @@ app.templates.helpPage = """

Keyboard Shortcuts

-

Selection

+

Sidebar

@@ -61,8 +61,11 @@ app.templates.helpPage = """
#{ctrlKey} + enter
Open selection in a new tab +
+ alt + r +
Reveal current page in sidebar
-

Navigation

+

Browsing

#{navKey} + ← @@ -83,15 +86,24 @@ app.templates.helpPage = """ #{ctrlKey} + ↑ #{ctrlKey} + ↓
Scroll to the top/bottom -
-

Misc

-
alt + f
Focus first link in the content area
(press tab to focus the other links) +
+

App

+
- alt + r -
Reveal current page in sidebar + ctrl + , +
Open preferences +
+ escape +
Reset UI +
+ ? +
Show this page +
+

Miscellaneous

+
alt + o
Open original page @@ -101,12 +113,6 @@ app.templates.helpPage = """
alt + s
Search on Stack Overflow -
- escape -
Reset
(press twice in single doc mode) -
- ? -
Show this page

Tip: If the cursor is no longer in the search field, press / or diff --git a/assets/javascripts/views/layout/document.coffee b/assets/javascripts/views/layout/document.coffee index 6cc507dc..8a541361 100644 --- a/assets/javascripts/views/layout/document.coffee +++ b/assets/javascripts/views/layout/document.coffee @@ -5,10 +5,11 @@ class app.views.Document extends app.View visibilitychange: 'onVisibilityChange' @shortcuts: - help: 'onHelp' - escape: 'onEscape' - superLeft: 'onBack' - superRight: 'onForward' + help: 'onHelp' + preferences: 'onPreferences' + escape: 'onEscape' + superLeft: 'onBack' + superRight: 'onForward' @routes: after: 'afterRoute' @@ -46,6 +47,11 @@ class app.views.Document extends app.View onHelp: -> app.router.show '/help#shortcuts' + return + + onPreferences: -> + app.router.show '/settings' + return onEscape: -> path = if !app.isSingleDoc() or location.pathname is app.doc.fullPath() @@ -54,12 +60,15 @@ class app.views.Document extends app.View app.doc.fullPath() app.router.show(path) + return onBack: -> history.back() + return onForward: -> history.forward() + return onClick: (event) -> return unless event.target.hasAttribute('data-behavior')