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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
e220eecb
Commit
e220eecb
authored
Mar 30, 2017
by
Annabel Dunstone Gray
Committed by
Jacob Schatz
Apr 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch global shortcuts to shift; reuse key styles from help menu
parent
610ea22e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
101 deletions
+75
-101
app/assets/javascripts/shortcuts.js
app/assets/javascripts/shortcuts.js
+25
-36
app/assets/javascripts/shortcuts_dashboard_navigation.js
app/assets/javascripts/shortcuts_dashboard_navigation.js
+0
-15
app/assets/javascripts/shortcuts_navigation.js
app/assets/javascripts/shortcuts_navigation.js
+1
-1
app/assets/stylesheets/framework/dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+2
-13
app/views/help/_shortcuts.html.haml
app/views/help/_shortcuts.html.haml
+25
-14
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+21
-21
changelogs/unreleased/menu-shortcut.yml
changelogs/unreleased/menu-shortcut.yml
+1
-1
No files found.
app/assets/javascripts/shortcuts.js
View file @
e220eecb
...
...
@@ -20,50 +20,39 @@
};
})(
this
));
function
gotoMenu
(
menu
){
window
.
location
.
href
=
$
(
'
.js-dashboard-shortcuts-
'
+
menu
).
attr
(
'
href
'
);
}
const
globalDropdownMenu
=
$
(
'
.global-dropdown-menu
'
);
$
(
'
.global-dropdown
'
).
on
(
'
hide.bs.dropdown
'
,
function
()
{
$
(
'
.global-dropdown-menu
'
).
removeClass
(
'
shortcuts
'
);
Mousetrap
.
unbind
([
'
p
'
,
'
a
'
,
'
r
'
,
'
l
'
,
'
i
'
,
'
m
'
,
'
e
'
]);
});
$
(
'
.global-dropdown
'
).
on
(
'
show.bs.dropdown
'
,
function
()
{
Mousetrap
.
bind
(
'
p
'
,
function
()
{
gotoMenu
(
'
projects
'
);
});
Mousetrap
.
bind
(
'
a
'
,
function
()
{
gotoMenu
(
'
activity
'
);
});
Mousetrap
.
bind
(
'
r
'
,
function
()
{
gotoMenu
(
'
groups
'
);
});
Mousetrap
.
bind
(
'
l
'
,
function
()
{
gotoMenu
(
'
milestones
'
);
});
Mousetrap
.
bind
(
'
i
'
,
function
()
{
gotoMenu
(
'
issues
'
);
});
Mousetrap
.
bind
(
'
m
'
,
function
()
{
gotoMenu
(
'
merge_requests
'
);
});
Mousetrap
.
bind
(
'
e
'
,
function
()
{
gotoMenu
(
'
snippets
'
);
});
globalDropdownMenu
.
removeClass
(
'
shortcuts
'
);
});
Mousetrap
.
bind
(
'
n
'
,
function
()
{
$
(
'
.global-dropdown-menu
'
)
.
addClass
(
'
shortcuts
'
);
globalDropdownMenu
.
addClass
(
'
shortcuts
'
);
$
(
'
.global-dropdown-toggle
'
).
trigger
(
'
click
'
);
});
Mousetrap
.
bind
(
'
shift+a
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-activity
'
);
});
Mousetrap
.
bind
(
'
shift+i
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-issues
'
);
});
Mousetrap
.
bind
(
'
shift+m
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-merge_requests
'
);
});
Mousetrap
.
bind
(
'
shift+p
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-projects
'
);
});
Mousetrap
.
bind
(
'
shift+g
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-groups
'
);
});
Mousetrap
.
bind
(
'
shift+l
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-milestones
'
);
});
Mousetrap
.
bind
(
'
shift+s
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-snippets
'
);
});
Mousetrap
.
bind
([
'
ctrl+shift+p
'
,
'
command+shift+p
'
],
this
.
toggleMarkdownPreview
);
if
(
typeof
findFileURL
!==
"
undefined
"
&&
findFileURL
!==
null
)
{
Mousetrap
.
bind
(
'
t
'
,
function
()
{
...
...
app/assets/javascripts/shortcuts_dashboard_navigation.js
View file @
e220eecb
...
...
@@ -13,21 +13,6 @@ require('./shortcuts');
function
ShortcutsDashboardNavigation
()
{
ShortcutsDashboardNavigation
.
__super__
.
constructor
.
call
(
this
);
Mousetrap
.
bind
(
'
g a
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-activity
'
);
});
Mousetrap
.
bind
(
'
g i
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-issues
'
);
});
Mousetrap
.
bind
(
'
g m
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-merge_requests
'
);
});
Mousetrap
.
bind
(
'
g t
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.shortcuts-todos
'
);
});
Mousetrap
.
bind
(
'
g p
'
,
function
()
{
return
ShortcutsDashboardNavigation
.
findAndFollowLink
(
'
.dashboard-shortcuts-projects
'
);
});
}
ShortcutsDashboardNavigation
.
findAndFollowLink
=
function
(
selector
)
{
...
...
app/assets/javascripts/shortcuts_navigation.js
View file @
e220eecb
...
...
@@ -31,7 +31,7 @@ require('./shortcuts');
Mousetrap
.
bind
(
'
g n
'
,
function
()
{
return
ShortcutsNavigation
.
findAndFollowLink
(
'
.shortcuts-network
'
);
});
Mousetrap
.
bind
(
'
g
g
'
,
function
()
{
Mousetrap
.
bind
(
'
g
d
'
,
function
()
{
return
ShortcutsNavigation
.
findAndFollowLink
(
'
.shortcuts-repository-charts
'
);
});
Mousetrap
.
bind
(
'
g i
'
,
function
()
{
...
...
app/assets/stylesheets/framework/dropdowns.scss
View file @
e220eecb
...
...
@@ -187,24 +187,13 @@
}
}
.
kbd
{
.
shortcut-mappings
{
display
:
none
;
}
&
.shortcuts
.kbd
{
background-color
:
$gray-light
;
color
:
$gl-text-color
;
border
:
1px
solid
$gray-darkest
;
box-shadow
:
0
-1px
0
$gray-darkest
inset
;
&
.shortcuts
.shortcut-mappings
{
display
:
inline-block
;
vertical-align
:
top
;
padding
:
3px
0
;
margin-right
:
5px
;
font-size
:
11px
;
line-height
:
10px
;
border-radius
:
3px
;
width
:
20px
;
text-align
:
center
;
}
ul
{
...
...
app/views/help/_shortcuts.html.haml
View file @
e220eecb
...
...
@@ -100,34 +100,39 @@
%th
Global Dashboard
%tr
%td
.shortcut
.key
g
.key
a
.key
shift a
%td
Go to the activity feed
%tr
%td
.shortcut
.key
g
.key
p
.key
shift p
%td
Go to projects
%tr
%td
.shortcut
.key
g
.key
i
.key
shift i
%td
Go to issues
%tr
%td
.shortcut
.key
g
.key
m
.key
shift m
%td
Go to merge requests
%tr
%td
.shortcut
.key
g
.key
t
.key
shift g
%td
Go to groups
%tr
%td
.shortcut
.key
shift l
%td
Go to todos
Go to milestones
%tr
%td
.shortcut
.key
shift s
%td
Go to snippets
%tbody
%tr
%th
...
...
@@ -159,7 +164,7 @@
%tr
%td
.shortcut
.key
g
.key
b
.key
j
%td
Go to jobs
%tr
...
...
@@ -171,7 +176,7 @@
%tr
%td
.shortcut
.key
g
.key
g
.key
d
%td
Go to repository charts
%tr
...
...
@@ -183,7 +188,7 @@
%tr
%td
.shortcut
.key
g
.key
l
.key
b
%td
Go to issue boards
%tr
...
...
@@ -198,6 +203,12 @@
.key
s
%td
Go to snippets
%tr
%td
.shortcut
.key
g
.key
w
%td
Go to wiki
%tr
%td
.shortcut
.key
t
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
e220eecb
%ul
=
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:
'
js-
dashboard-shortcuts-projects'
do
.
kbd
p
=
link_to
dashboard_projects_path
,
title:
'Projects'
,
class:
'dashboard-shortcuts-projects'
do
.
shortcut-mappings
.key
shift
p
%span
Projects
=
nav_link
(
path:
'dashboard#activity'
)
do
=
link_to
activity_dashboard_path
,
class:
'
js-
dashboard-shortcuts-activity'
,
title:
'Activity'
do
.
kbd
a
=
link_to
activity_dashboard_path
,
class:
'dashboard-shortcuts-activity'
,
title:
'Activity'
do
.
shortcut-mappings
.key
shift
a
%span
Activity
-
if
koding_enabled?
...
...
@@ -17,35 +17,35 @@
%span
Koding
=
nav_link
(
controller:
[
:groups
,
'groups/milestones'
,
'groups/group_members'
])
do
=
link_to
dashboard_groups_path
,
class:
'
js-
dashboard-shortcuts-groups'
,
title:
'Groups'
do
.
kbd
r
=
link_to
dashboard_groups_path
,
class:
'dashboard-shortcuts-groups'
,
title:
'Groups'
do
.
shortcut-mappings
.key
shift l
%span
Groups
=
nav_link
(
controller:
'dashboard/milestones'
)
do
=
link_to
dashboard_milestones_path
,
class:
'
js-
dashboard-shortcuts-milestones'
,
title:
'Milestones'
do
.
kbd
l
=
link_to
dashboard_milestones_path
,
class:
'dashboard-shortcuts-milestones'
,
title:
'Milestones'
do
.
shortcut-mappings
.key
shift w
%span
Milestones
=
nav_link
(
path:
'dashboard#issues'
)
do
=
link_to
assigned_issues_dashboard_path
,
title:
'Issues'
,
class:
'
js-
dashboard-shortcuts-issues'
do
.
kbd
i
=
link_to
assigned_issues_dashboard_path
,
title:
'Issues'
,
class:
'dashboard-shortcuts-issues'
do
.
shortcut-mappings
.key
shift
i
%span
Issues
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:issues
,
:opened
))
=
nav_link
(
path:
'dashboard#merge_requests'
)
do
=
link_to
assigned_mrs_dashboard_path
,
title:
'Merge Requests'
,
class:
'
js-
dashboard-shortcuts-merge_requests'
do
.
kbd
m
=
link_to
assigned_mrs_dashboard_path
,
title:
'Merge Requests'
,
class:
'dashboard-shortcuts-merge_requests'
do
.
shortcut-mappings
.key
shift
m
%span
Merge Requests
.badge
=
number_with_delimiter
(
cached_assigned_issuables_count
(
current_user
,
:merge_requests
,
:opened
))
=
nav_link
(
controller:
'dashboard/snippets'
)
do
=
link_to
dashboard_snippets_path
,
class:
'
js-
dashboard-shortcuts-snippets'
,
title:
'Snippets'
do
.
kbd
e
=
link_to
dashboard_snippets_path
,
class:
'dashboard-shortcuts-snippets'
,
title:
'Snippets'
do
.
shortcut-mappings
.key
shift s
%span
Snippets
%li
.divider
...
...
changelogs/unreleased/menu-shortcut.yml
View file @
e220eecb
---
title
:
Add keyboard shortcuts to main menu
merge_request
:
author
:
Jacob Schatz
author
:
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