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
Léo-Paul Géneau
gitlab-ce
Commits
71eae208
Commit
71eae208
authored
Mar 26, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add keyboard shortcuts to main menu.
1. Show shortcuts for easy navigation.
parent
5fbb9e95
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
3 deletions
+83
-3
app/assets/javascripts/shortcuts.js
app/assets/javascripts/shortcuts.js
+39
-0
app/assets/stylesheets/framework/dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+27
-0
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+17
-3
No files found.
app/assets/javascripts/shortcuts.js
View file @
71eae208
...
@@ -19,6 +19,45 @@
...
@@ -19,6 +19,45 @@
return
_this
.
focusFilter
(
e
);
return
_this
.
focusFilter
(
e
);
};
};
})(
this
));
})(
this
));
function
gotoMenu
(
menu
){
if
(
$
(
'
.global-dropdown.open
'
).
length
)
{
window
.
location
.
href
=
$
(
'
.global-dropdown-menu .dashboard-shortcuts-
'
+
menu
).
attr
(
'
href
'
);
}
}
Mousetrap
.
bind
(
'
m
'
,
function
()
{
$
(
'
.global-dropdown-menu
'
).
addClass
(
'
shortcuts
'
)
$
(
'
.global-dropdown-toggle
'
).
trigger
(
'
click
'
);
});
Mousetrap
.
bind
(
'
P
'
,
function
()
{
gotoMenu
(
'
projects
'
);
});
Mousetrap
.
bind
(
'
A
'
,
function
()
{
gotoMenu
(
'
activity
'
);
});
Mousetrap
.
bind
(
'
G
'
,
function
()
{
gotoMenu
(
'
groups
'
);
});
Mousetrap
.
bind
(
'
L
'
,
function
()
{
gotoMenu
(
'
milestones
'
);
});
Mousetrap
.
bind
(
'
I
'
,
function
()
{
gotoMenu
(
'
issues
'
);
});
Mousetrap
.
bind
(
'
M
'
,
function
()
{
gotoMenu
(
'
merge_requests
'
);
});
Mousetrap
.
bind
(
'
S
'
,
function
()
{
gotoMenu
(
'
snippets
'
);
});
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
)
{
Mousetrap
.
bind
(
'
t
'
,
function
()
{
Mousetrap
.
bind
(
'
t
'
,
function
()
{
...
...
app/assets/stylesheets/framework/dropdowns.scss
View file @
71eae208
...
@@ -187,6 +187,33 @@
...
@@ -187,6 +187,33 @@
}
}
}
}
.kbd
{
display
:
none
;
}
&
.shortcuts
span
{
display
:
inline-block
;
width
:
140px
;
}
&
.shortcuts
.kbd
{
display
:
inline-block
;
padding
:
3px
5px
;
font-size
:
11px
;
line-height
:
10px
;
color
:
#555
;
vertical-align
:
middle
;
background-color
:
#fcfcfc
;
border-width
:
1px
;
border-style
:
solid
;
border-color
:
#ccc
#ccc
#bbb
;
border-image
:
none
;
border-radius
:
3px
;
box-shadow
:
0
-1px
0
#bbb
inset
;
width
:
21px
;
text-align
:
center
;
}
ul
{
ul
{
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
71eae208
...
@@ -3,37 +3,51 @@
...
@@ -3,37 +3,51 @@
=
link_to
dashboard_projects_path
,
title:
'Projects'
,
class:
'dashboard-shortcuts-projects'
do
=
link_to
dashboard_projects_path
,
title:
'Projects'
,
class:
'dashboard-shortcuts-projects'
do
%span
%span
Projects
Projects
.kbd
P
=
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:
'dashboard-shortcuts-activity'
,
title:
'Activity'
do
%span
%span
Activity
Activity
.kbd
A
-
if
koding_enabled?
-
if
koding_enabled?
=
nav_link
(
controller: :koding
)
do
=
nav_link
(
controller: :koding
)
do
=
link_to
koding_path
,
title:
'Koding'
do
=
link_to
koding_path
,
title:
'Koding'
do
%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
,
title:
'Groups'
do
=
link_to
dashboard_groups_path
,
class:
'dashboard-shortcuts-groups'
,
title:
'Groups'
do
%span
%span
Groups
Groups
.kbd
G
=
nav_link
(
controller:
'dashboard/milestones'
)
do
=
nav_link
(
controller:
'dashboard/milestones'
)
do
=
link_to
dashboard_milestones_path
,
title:
'Milestones'
do
=
link_to
dashboard_milestones_path
,
class:
'dashboard-shortcuts-milestones'
,
title:
'Milestones'
do
%span
%span
Milestones
Milestones
.kbd
L
=
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:
'dashboard-shortcuts-issues'
do
%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
))
.kbd
I
=
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:
'dashboard-shortcuts-merge_requests'
do
%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
))
.kbd
M
=
nav_link
(
controller:
'dashboard/snippets'
)
do
=
nav_link
(
controller:
'dashboard/snippets'
)
do
=
link_to
dashboard_snippets_path
,
title:
'Snippets'
do
=
link_to
dashboard_snippets_path
,
class:
'dashboard-shortcuts-snippets'
,
title:
'Snippets'
do
%span
%span
Snippets
Snippets
.kbd
S
%li
.divider
%li
.divider
%li
%li
=
link_to
"Help"
,
help_path
,
title:
'About GitLab CE'
,
class:
'about-gitlab'
=
link_to
"Help"
,
help_path
,
title:
'About GitLab CE'
,
class:
'about-gitlab'
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