Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
610ea22e
Commit
610ea22e
authored
Mar 29, 2017
by
Annabel Dunstone Gray
Committed by
Jacob Schatz
Apr 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Map bindings to lowercase letters; only show key bindings when using keyboard shortcut
parent
82ababf0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
39 deletions
+45
-39
app/assets/javascripts/shortcuts.js
app/assets/javascripts/shortcuts.js
+31
-25
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+14
-14
No files found.
app/assets/javascripts/shortcuts.js
View file @
610ea22e
...
@@ -19,44 +19,50 @@
...
@@ -19,44 +19,50 @@
return
_this
.
focusFilter
(
e
);
return
_this
.
focusFilter
(
e
);
};
};
})(
this
));
})(
this
));
function
gotoMenu
(
menu
){
function
gotoMenu
(
menu
){
if
(
$
(
'
.global-dropdown.open
'
).
length
)
{
window
.
location
.
href
=
$
(
'
.js-dashboard-shortcuts-
'
+
menu
).
attr
(
'
href
'
);
window
.
location
.
href
=
$
(
'
.global-dropdown-menu .dashboard-shortcuts-
'
+
menu
).
attr
(
'
href
'
);
}
}
}
Mousetrap
.
bind
(
'
n
'
,
function
()
{
$
(
'
.global-dropdown
'
).
on
(
'
hide.bs.dropdow
n
'
,
function
()
{
$
(
'
.global-dropdown-menu
'
).
addClass
(
'
shortcuts
'
)
$
(
'
.global-dropdown-menu
'
).
removeClass
(
'
shortcuts
'
);
$
(
'
.global-dropdown-toggle
'
).
trigger
(
'
click
'
);
Mousetrap
.
unbind
([
'
p
'
,
'
a
'
,
'
r
'
,
'
l
'
,
'
i
'
,
'
m
'
,
'
e
'
]
);
});
});
Mousetrap
.
bind
(
'
P
'
,
function
()
{
$
(
'
.global-dropdown
'
).
on
(
'
show.bs.dropdown
'
,
function
()
{
Mousetrap
.
bind
(
'
p
'
,
function
()
{
gotoMenu
(
'
projects
'
);
gotoMenu
(
'
projects
'
);
});
});
Mousetrap
.
bind
(
'
A
'
,
function
()
{
Mousetrap
.
bind
(
'
a
'
,
function
()
{
gotoMenu
(
'
activity
'
);
gotoMenu
(
'
activity
'
);
});
});
Mousetrap
.
bind
(
'
G
'
,
function
()
{
Mousetrap
.
bind
(
'
r
'
,
function
()
{
gotoMenu
(
'
groups
'
);
gotoMenu
(
'
groups
'
);
});
});
Mousetrap
.
bind
(
'
L
'
,
function
()
{
Mousetrap
.
bind
(
'
l
'
,
function
()
{
gotoMenu
(
'
milestones
'
);
gotoMenu
(
'
milestones
'
);
});
});
Mousetrap
.
bind
(
'
I
'
,
function
()
{
Mousetrap
.
bind
(
'
i
'
,
function
()
{
gotoMenu
(
'
issues
'
);
gotoMenu
(
'
issues
'
);
});
});
Mousetrap
.
bind
(
'
M
'
,
function
()
{
Mousetrap
.
bind
(
'
m
'
,
function
()
{
gotoMenu
(
'
merge_requests
'
);
gotoMenu
(
'
merge_requests
'
);
});
});
Mousetrap
.
bind
(
'
S
'
,
function
()
{
Mousetrap
.
bind
(
'
e
'
,
function
()
{
gotoMenu
(
'
snippets
'
);
gotoMenu
(
'
snippets
'
);
});
});
});
Mousetrap
.
bind
(
'
n
'
,
function
()
{
$
(
'
.global-dropdown-menu
'
).
addClass
(
'
shortcuts
'
);
$
(
'
.global-dropdown-toggle
'
).
trigger
(
'
click
'
);
});
Mousetrap
.
bind
([
'
ctrl+shift+p
'
,
'
command+shift+p
'
],
this
.
toggleMarkdownPreview
);
Mousetrap
.
bind
([
'
ctrl+shift+p
'
,
'
command+shift+p
'
],
this
.
toggleMarkdownPreview
);
if
(
typeof
findFileURL
!==
"
undefined
"
&&
findFileURL
!==
null
)
{
if
(
typeof
findFileURL
!==
"
undefined
"
&&
findFileURL
!==
null
)
{
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
610ea22e
%ul
%ul
=
nav_link
(
path:
[
'root#index'
,
'projects#trending'
,
'projects#starred'
,
'dashboard/projects#index'
],
html_options:
{
class:
"
#{
project_tab_class
}
home"
})
do
=
nav_link
(
path:
[
'root#index'
,
'projects#trending'
,
'projects#starred'
,
'dashboard/projects#index'
],
html_options:
{
class:
"
#{
project_tab_class
}
home"
})
do
=
link_to
dashboard_projects_path
,
title:
'Projects'
,
class:
'dashboard-shortcuts-projects'
do
=
link_to
dashboard_projects_path
,
title:
'Projects'
,
class:
'
js-
dashboard-shortcuts-projects'
do
.kbd
.kbd
P
p
%span
%span
Projects
Projects
=
nav_link
(
path:
'dashboard#activity'
)
do
=
nav_link
(
path:
'dashboard#activity'
)
do
=
link_to
activity_dashboard_path
,
class:
'dashboard-shortcuts-activity'
,
title:
'Activity'
do
=
link_to
activity_dashboard_path
,
class:
'
js-
dashboard-shortcuts-activity'
,
title:
'Activity'
do
.kbd
.kbd
A
a
%span
%span
Activity
Activity
-
if
koding_enabled?
-
if
koding_enabled?
...
@@ -17,35 +17,35 @@
...
@@ -17,35 +17,35 @@
%span
%span
Koding
Koding
=
nav_link
(
controller:
[
:groups
,
'groups/milestones'
,
'groups/group_members'
])
do
=
nav_link
(
controller:
[
:groups
,
'groups/milestones'
,
'groups/group_members'
])
do
=
link_to
dashboard_groups_path
,
class:
'dashboard-shortcuts-groups'
,
title:
'Groups'
do
=
link_to
dashboard_groups_path
,
class:
'
js-
dashboard-shortcuts-groups'
,
title:
'Groups'
do
.kbd
.kbd
G
r
%span
%span
Groups
Groups
=
nav_link
(
controller:
'dashboard/milestones'
)
do
=
nav_link
(
controller:
'dashboard/milestones'
)
do
=
link_to
dashboard_milestones_path
,
class:
'dashboard-shortcuts-milestones'
,
title:
'Milestones'
do
=
link_to
dashboard_milestones_path
,
class:
'
js-
dashboard-shortcuts-milestones'
,
title:
'Milestones'
do
.kbd
.kbd
L
l
%span
%span
Milestones
Milestones
=
nav_link
(
path:
'dashboard#issues'
)
do
=
nav_link
(
path:
'dashboard#issues'
)
do
=
link_to
assigned_issues_dashboard_path
,
title:
'Issues'
,
class:
'dashboard-shortcuts-issues'
do
=
link_to
assigned_issues_dashboard_path
,
title:
'Issues'
,
class:
'
js-
dashboard-shortcuts-issues'
do
.kbd
.kbd
I
i
%span
%span
Issues
Issues
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:issues
,
:opened
))
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:issues
,
:opened
))
=
nav_link
(
path:
'dashboard#merge_requests'
)
do
=
nav_link
(
path:
'dashboard#merge_requests'
)
do
=
link_to
assigned_mrs_dashboard_path
,
title:
'Merge Requests'
,
class:
'dashboard-shortcuts-merge_requests'
do
=
link_to
assigned_mrs_dashboard_path
,
title:
'Merge Requests'
,
class:
'
js-
dashboard-shortcuts-merge_requests'
do
.kbd
.kbd
M
m
%span
%span
Merge Requests
Merge Requests
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:merge_requests
,
:opened
))
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:merge_requests
,
:opened
))
=
nav_link
(
controller:
'dashboard/snippets'
)
do
=
nav_link
(
controller:
'dashboard/snippets'
)
do
=
link_to
dashboard_snippets_path
,
class:
'dashboard-shortcuts-snippets'
,
title:
'Snippets'
do
=
link_to
dashboard_snippets_path
,
class:
'
js-
dashboard-shortcuts-snippets'
,
title:
'Snippets'
do
.kbd
.kbd
S
e
%span
%span
Snippets
Snippets
%li
.divider
%li
.divider
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment