2014-08-21 04:14:31 -04:00
|
|
|
#= require shortcuts
|
|
|
|
|
|
|
|
class @ShortcutsNavigation extends Shortcuts
|
|
|
|
constructor: ->
|
|
|
|
super()
|
2015-04-01 21:50:28 -04:00
|
|
|
Mousetrap.bind('g p', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project'))
|
2015-07-08 06:43:46 -04:00
|
|
|
Mousetrap.bind('g e', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project-activity'))
|
2015-04-01 21:50:28 -04:00
|
|
|
Mousetrap.bind('g f', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-tree'))
|
|
|
|
Mousetrap.bind('g c', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-commits'))
|
2015-10-14 06:15:03 -04:00
|
|
|
Mousetrap.bind('g b', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-builds'))
|
2015-04-01 21:50:28 -04:00
|
|
|
Mousetrap.bind('g n', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-network'))
|
|
|
|
Mousetrap.bind('g g', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-graphs'))
|
|
|
|
Mousetrap.bind('g i', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-issues'))
|
|
|
|
Mousetrap.bind('g m', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-merge_requests'))
|
|
|
|
Mousetrap.bind('g w', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-wiki'))
|
|
|
|
Mousetrap.bind('g s', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-snippets'))
|
2016-04-12 17:16:40 -04:00
|
|
|
Mousetrap.bind('i', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-new-issue'))
|
2014-08-21 04:14:31 -04:00
|
|
|
@enabledHelp.push('.hidden-shortcut.project')
|
2015-04-01 21:50:28 -04:00
|
|
|
|
|
|
|
@findAndFollowLink: (selector) ->
|
2014-08-21 04:14:31 -04:00
|
|
|
link = $(selector).attr('href')
|
|
|
|
if link
|
|
|
|
window.location = link
|