2015-04-26 12:48:37 +05:30
|
|
|
#= require shortcuts
|
|
|
|
|
|
|
|
class @ShortcutsNavigation extends Shortcuts
|
|
|
|
constructor: ->
|
|
|
|
super()
|
|
|
|
Mousetrap.bind('g p', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project'))
|
2015-09-11 14:41:01 +05:30
|
|
|
Mousetrap.bind('g e', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project-activity'))
|
2015-04-26 12:48:37 +05:30
|
|
|
Mousetrap.bind('g f', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-tree'))
|
|
|
|
Mousetrap.bind('g c', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-commits'))
|
2015-10-24 18:46:33 +05:30
|
|
|
Mousetrap.bind('g b', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-builds'))
|
2015-04-26 12:48:37 +05:30
|
|
|
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-06-02 11:05:42 +05:30
|
|
|
Mousetrap.bind('i', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-new-issue'))
|
2015-04-26 12:48:37 +05:30
|
|
|
@enabledHelp.push('.hidden-shortcut.project')
|
|
|
|
|
|
|
|
@findAndFollowLink: (selector) ->
|
|
|
|
link = $(selector).attr('href')
|
|
|
|
if link
|
|
|
|
window.location = link
|