Add keyboard shortcut for opening original page

Closes #510.
pull/546/head
Thibaut Courouble 8 years ago
parent 3508fa8225
commit 2f19cf9664

@ -137,6 +137,9 @@ class app.Shortcuts
when 71
@trigger 'altG'
false
when 79
@trigger 'altO'
false
when 82
@trigger 'altR'
false

@ -90,6 +90,9 @@ app.templates.helpPage = """
<dt class="_shortcuts-dt">
<code class="_shortcut-code">alt + r</code>
<dd class="_shortcuts-dd">Reveal current page in sidebar
<dt class="_shortcuts-dt">
<code class="_shortcut-code">alt + o</code>
<dd class="_shortcuts-dd">Open original page
<dt class="_shortcuts-dt">
<code class="_shortcut-code">alt + g</code>
<dd class="_shortcuts-dd">Search on Google

@ -5,6 +5,9 @@ class app.views.EntryPage extends app.View
@events:
click: 'onClick'
@shortcuts:
altO: 'onAltO'
@routes:
before: 'beforeRoute'
@ -146,3 +149,8 @@ class app.views.EntryPage extends app.View
target.classList.add if $.copyToClipboard(target.parentNode.textContent) then '_pre-clip-success' else '_pre-clip-error'
setTimeout (-> target.className = '_pre-clip'), 2000
return
onAltO: =>
return unless link = @find('._attribution:last-child ._attribution-link')
$.popup(link.href + location.hash)
return

Loading…
Cancel
Save