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
196dfd26
Commit
196dfd26
authored
Sep 18, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move shortcuts classes into behaviors/shortcuts
parent
08c3920c
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
33 additions
and
33 deletions
+33
-33
app/assets/javascripts/behaviors/shortcuts.js
app/assets/javascripts/behaviors/shortcuts.js
+1
-1
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
+3
-3
app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js
app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js
+1
-1
app/assets/javascripts/behaviors/shortcuts/shortcuts_find_file.js
...ts/javascripts/behaviors/shortcuts/shortcuts_find_file.js
+0
-0
app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
...ets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
+2
-2
app/assets/javascripts/behaviors/shortcuts/shortcuts_navigation.js
...s/javascripts/behaviors/shortcuts/shortcuts_navigation.js
+1
-1
app/assets/javascripts/behaviors/shortcuts/shortcuts_network.js
...sets/javascripts/behaviors/shortcuts/shortcuts_network.js
+0
-0
app/assets/javascripts/behaviors/shortcuts/shortcuts_wiki.js
app/assets/javascripts/behaviors/shortcuts/shortcuts_wiki.js
+1
-1
app/assets/javascripts/pages/groups/boards/index.js
app/assets/javascripts/pages/groups/boards/index.js
+1
-1
app/assets/javascripts/pages/groups/show/index.js
app/assets/javascripts/pages/groups/show/index.js
+1
-1
app/assets/javascripts/pages/projects/activity/index.js
app/assets/javascripts/pages/projects/activity/index.js
+1
-1
app/assets/javascripts/pages/projects/artifacts/browse/index.js
...sets/javascripts/pages/projects/artifacts/browse/index.js
+1
-1
app/assets/javascripts/pages/projects/artifacts/file/index.js
...assets/javascripts/pages/projects/artifacts/file/index.js
+1
-1
app/assets/javascripts/pages/projects/boards/index.js
app/assets/javascripts/pages/projects/boards/index.js
+1
-1
app/assets/javascripts/pages/projects/commit/show/index.js
app/assets/javascripts/pages/projects/commit/show/index.js
+1
-1
app/assets/javascripts/pages/projects/commits/show/index.js
app/assets/javascripts/pages/projects/commits/show/index.js
+1
-1
app/assets/javascripts/pages/projects/find_file/show/index.js
...assets/javascripts/pages/projects/find_file/show/index.js
+1
-1
app/assets/javascripts/pages/projects/index.js
app/assets/javascripts/pages/projects/index.js
+1
-1
app/assets/javascripts/pages/projects/init_blob.js
app/assets/javascripts/pages/projects/init_blob.js
+2
-2
app/assets/javascripts/pages/projects/issues/form.js
app/assets/javascripts/pages/projects/issues/form.js
+1
-1
app/assets/javascripts/pages/projects/issues/index/index.js
app/assets/javascripts/pages/projects/issues/index/index.js
+1
-1
app/assets/javascripts/pages/projects/issues/show.js
app/assets/javascripts/pages/projects/issues/show.js
+1
-1
app/assets/javascripts/pages/projects/merge_requests/index/index.js
.../javascripts/pages/projects/merge_requests/index/index.js
+1
-1
app/assets/javascripts/pages/projects/merge_requests/init_merge_request.js
...ripts/pages/projects/merge_requests/init_merge_request.js
+1
-1
app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js
.../pages/projects/merge_requests/init_merge_request_show.js
+1
-1
app/assets/javascripts/pages/projects/network/show/index.js
app/assets/javascripts/pages/projects/network/show/index.js
+1
-1
app/assets/javascripts/pages/projects/show/index.js
app/assets/javascripts/pages/projects/show/index.js
+1
-1
app/assets/javascripts/pages/projects/tree/show/index.js
app/assets/javascripts/pages/projects/tree/show/index.js
+1
-1
app/assets/javascripts/pages/projects/wikis/index.js
app/assets/javascripts/pages/projects/wikis/index.js
+1
-1
spec/javascripts/behaviors/shortcuts/shortcuts_issuable_spec.js
...avascripts/behaviors/shortcuts/shortcuts_issuable_spec.js
+1
-1
spec/javascripts/shortcuts_spec.js
spec/javascripts/shortcuts_spec.js
+1
-1
No files found.
app/assets/javascripts/behaviors/shortcuts.js
View file @
196dfd26
import
Shortcuts
from
'
.
.
/shortcuts
'
;
import
Shortcuts
from
'
.
/shortcuts
/shortcuts
'
;
export
default
function
initPageShortcuts
()
{
const
{
page
}
=
document
.
body
.
dataset
;
...
...
app/assets/javascripts/shortcuts.js
→
app/assets/javascripts/
behaviors/shortcuts/
shortcuts.js
View file @
196dfd26
import
$
from
'
jquery
'
;
import
Cookies
from
'
js-cookie
'
;
import
Mousetrap
from
'
mousetrap
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
refreshCurrentPage
,
visitUrl
}
from
'
./lib/utils/url_utility
'
;
import
findAndFollowLink
from
'
./lib/utils/navigation_utility
'
;
import
axios
from
'
.
./..
/lib/utils/axios_utils
'
;
import
{
refreshCurrentPage
,
visitUrl
}
from
'
.
./..
/lib/utils/url_utility
'
;
import
findAndFollowLink
from
'
.
./..
/lib/utils/navigation_utility
'
;
const
defaultStopCallback
=
Mousetrap
.
stopCallback
;
Mousetrap
.
stopCallback
=
(
e
,
element
,
combo
)
=>
{
...
...
app/assets/javascripts/shortcuts_blob.js
→
app/assets/javascripts/
behaviors/shortcuts/
shortcuts_blob.js
View file @
196dfd26
import
Mousetrap
from
'
mousetrap
'
;
import
{
getLocationHash
,
visitUrl
}
from
'
./lib/utils/url_utility
'
;
import
{
getLocationHash
,
visitUrl
}
from
'
.
./..
/lib/utils/url_utility
'
;
import
Shortcuts
from
'
./shortcuts
'
;
const
defaults
=
{
...
...
app/assets/javascripts/shortcuts_find_file.js
→
app/assets/javascripts/
behaviors/shortcuts/
shortcuts_find_file.js
View file @
196dfd26
File moved
app/assets/javascripts/shortcuts_issuable.js
→
app/assets/javascripts/
behaviors/shortcuts/
shortcuts_issuable.js
View file @
196dfd26
import
$
from
'
jquery
'
;
import
Mousetrap
from
'
mousetrap
'
;
import
_
from
'
underscore
'
;
import
Sidebar
from
'
./right_sidebar
'
;
import
Sidebar
from
'
.
./..
/right_sidebar
'
;
import
Shortcuts
from
'
./shortcuts
'
;
import
{
CopyAsGFM
}
from
'
.
/behaviors
/markdown/copy_as_gfm
'
;
import
{
CopyAsGFM
}
from
'
.
.
/markdown/copy_as_gfm
'
;
export
default
class
ShortcutsIssuable
extends
Shortcuts
{
constructor
(
isMergeRequest
)
{
...
...
app/assets/javascripts/shortcuts_navigation.js
→
app/assets/javascripts/
behaviors/shortcuts/
shortcuts_navigation.js
View file @
196dfd26
import
Mousetrap
from
'
mousetrap
'
;
import
findAndFollowLink
from
'
./lib/utils/navigation_utility
'
;
import
findAndFollowLink
from
'
.
./..
/lib/utils/navigation_utility
'
;
import
Shortcuts
from
'
./shortcuts
'
;
export
default
class
ShortcutsNavigation
extends
Shortcuts
{
...
...
app/assets/javascripts/shortcuts_network.js
→
app/assets/javascripts/
behaviors/shortcuts/
shortcuts_network.js
View file @
196dfd26
File moved
app/assets/javascripts/shortcuts_wiki.js
→
app/assets/javascripts/
behaviors/shortcuts/
shortcuts_wiki.js
View file @
196dfd26
import
Mousetrap
from
'
mousetrap
'
;
import
ShortcutsNavigation
from
'
./shortcuts_navigation
'
;
import
findAndFollowLink
from
'
./lib/utils/navigation_utility
'
;
import
findAndFollowLink
from
'
.
./..
/lib/utils/navigation_utility
'
;
export
default
class
ShortcutsWiki
extends
ShortcutsNavigation
{
constructor
()
{
...
...
app/assets/javascripts/pages/groups/boards/index.js
View file @
196dfd26
import
UsersSelect
from
'
~/users_select
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
initBoards
from
'
~/boards
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
...
...
app/assets/javascripts/pages/groups/show/index.js
View file @
196dfd26
...
...
@@ -6,7 +6,7 @@ import NewGroupChild from '~/groups/new_group_child';
import
notificationsDropdown
from
'
~/notifications_dropdown
'
;
import
NotificationsForm
from
'
~/notifications_form
'
;
import
ProjectsList
from
'
~/projects_list
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
GroupTabs
from
'
./group_tabs
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
...
...
app/assets/javascripts/pages/projects/activity/index.js
View file @
196dfd26
import
Activities
from
'
~/activities
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
Activities
();
// eslint-disable-line no-new
...
...
app/assets/javascripts/pages/projects/artifacts/browse/index.js
View file @
196dfd26
import
BuildArtifacts
from
'
~/build_artifacts
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
ShortcutsNavigation
();
// eslint-disable-line no-new
...
...
app/assets/javascripts/pages/projects/artifacts/file/index.js
View file @
196dfd26
import
BlobViewer
from
'
~/blob/viewer/index
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
ShortcutsNavigation
();
// eslint-disable-line no-new
...
...
app/assets/javascripts/pages/projects/boards/index.js
View file @
196dfd26
import
UsersSelect
from
'
~/users_select
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
initBoards
from
'
~/boards
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
...
...
app/assets/javascripts/pages/projects/commit/show/index.js
View file @
196dfd26
...
...
@@ -3,7 +3,7 @@
import
$
from
'
jquery
'
;
import
Diff
from
'
~/diff
'
;
import
ZenMode
from
'
~/zen_mode
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
MiniPipelineGraph
from
'
~/mini_pipeline_graph_dropdown
'
;
import
initNotes
from
'
~/init_notes
'
;
import
initChangesDropdown
from
'
~/init_changes_dropdown
'
;
...
...
app/assets/javascripts/pages/projects/commits/show/index.js
View file @
196dfd26
import
CommitsList
from
'
~/commits
'
;
import
GpgBadges
from
'
~/gpg_badges
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
CommitsList
(
document
.
querySelector
(
'
.js-project-commits-show
'
).
dataset
.
commitsLimit
);
// eslint-disable-line no-new
...
...
app/assets/javascripts/pages/projects/find_file/show/index.js
View file @
196dfd26
import
$
from
'
jquery
'
;
import
ProjectFindFile
from
'
~/project_find_file
'
;
import
ShortcutsFindFile
from
'
~/shortcuts_find_file
'
;
import
ShortcutsFindFile
from
'
~/
behaviors/shortcuts/
shortcuts_find_file
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
findElement
=
document
.
querySelector
(
'
.js-file-finder
'
);
...
...
app/assets/javascripts/pages/projects/index.js
View file @
196dfd26
import
initDismissableCallout
from
'
~/dismissable_callout
'
;
import
initGkeDropdowns
from
'
~/projects/gke_cluster_dropdowns
'
;
import
Project
from
'
./project
'
;
import
ShortcutsNavigation
from
'
../../shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
../../
behaviors/shortcuts/
shortcuts_navigation
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
{
page
}
=
document
.
body
.
dataset
;
...
...
app/assets/javascripts/pages/projects/init_blob.js
View file @
196dfd26
import
LineHighlighter
from
'
~/line_highlighter
'
;
import
BlobLinePermalinkUpdater
from
'
~/blob/blob_line_permalink_updater
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsBlob
from
'
~/shortcuts_blob
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
ShortcutsBlob
from
'
~/
behaviors/shortcuts/
shortcuts_blob
'
;
import
BlobForkSuggestion
from
'
~/blob/blob_fork_suggestion
'
;
import
initBlobBundle
from
'
~/blob_edit/blob_bundle
'
;
...
...
app/assets/javascripts/pages/projects/issues/form.js
View file @
196dfd26
...
...
@@ -5,7 +5,7 @@ import GLForm from '~/gl_form';
import
IssuableForm
from
'
~/issuable_form
'
;
import
LabelsSelect
from
'
~/labels_select
'
;
import
MilestoneSelect
from
'
~/milestone_select
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
IssuableTemplateSelectors
from
'
~/templates/issuable_template_selectors
'
;
export
default
()
=>
{
...
...
app/assets/javascripts/pages/projects/issues/index/index.js
View file @
196dfd26
/* eslint-disable no-new */
import
IssuableIndex
from
'
~/issuable_index
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
UsersSelect
from
'
~/users_select
'
;
import
initFilteredSearch
from
'
~/pages/search/init_filtered_search
'
;
import
{
FILTERED_SEARCH
}
from
'
~/pages/constants
'
;
...
...
app/assets/javascripts/pages/projects/issues/show.js
View file @
196dfd26
import
initIssuableSidebar
from
'
~/init_issuable_sidebar
'
;
import
Issue
from
'
~/issue
'
;
import
ShortcutsIssuable
from
'
~/shortcuts_issuable
'
;
import
ShortcutsIssuable
from
'
~/
behaviors/shortcuts/
shortcuts_issuable
'
;
import
ZenMode
from
'
~/zen_mode
'
;
import
'
~/notes/index
'
;
import
'
~/issue_show/index
'
;
...
...
app/assets/javascripts/pages/projects/merge_requests/index/index.js
View file @
196dfd26
import
IssuableIndex
from
'
~/issuable_index
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
UsersSelect
from
'
~/users_select
'
;
import
initFilteredSearch
from
'
~/pages/search/init_filtered_search
'
;
import
{
FILTERED_SEARCH
}
from
'
~/pages/constants
'
;
...
...
app/assets/javascripts/pages/projects/merge_requests/init_merge_request.js
View file @
196dfd26
...
...
@@ -2,7 +2,7 @@
import
$
from
'
jquery
'
;
import
Diff
from
'
~/diff
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
GLForm
from
'
~/gl_form
'
;
import
IssuableForm
from
'
~/issuable_form
'
;
import
LabelsSelect
from
'
~/labels_select
'
;
...
...
app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js
View file @
196dfd26
import
ZenMode
from
'
~/zen_mode
'
;
import
initIssuableSidebar
from
'
~/init_issuable_sidebar
'
;
import
ShortcutsIssuable
from
'
~/shortcuts_issuable
'
;
import
ShortcutsIssuable
from
'
~/
behaviors/shortcuts/
shortcuts_issuable
'
;
import
{
handleLocationHash
}
from
'
~/lib/utils/common_utils
'
;
import
howToMerge
from
'
~/how_to_merge
'
;
import
initPipelines
from
'
~/commit/pipelines/pipelines_bundle
'
;
...
...
app/assets/javascripts/pages/projects/network/show/index.js
View file @
196dfd26
import
$
from
'
jquery
'
;
import
ShortcutsNetwork
from
'
../../../..
/shortcuts_network
'
;
import
ShortcutsNetwork
from
'
~/behaviors/shortcuts
/shortcuts_network
'
;
import
Network
from
'
../network
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
...
...
app/assets/javascripts/pages/projects/show/index.js
View file @
196dfd26
import
$
from
'
jquery
'
;
import
initBlob
from
'
~/blob_edit/blob_bundle
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
~/
behaviors/shortcuts/
shortcuts_navigation
'
;
import
NotificationsForm
from
'
~/notifications_form
'
;
import
UserCallout
from
'
~/user_callout
'
;
import
TreeView
from
'
~/tree
'
;
...
...
app/assets/javascripts/pages/projects/tree/show/index.js
View file @
196dfd26
...
...
@@ -4,7 +4,7 @@ import initBlob from '~/blob_edit/blob_bundle';
import
commitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
GpgBadges
from
'
~/gpg_badges
'
;
import
TreeView
from
'
../../../../tree
'
;
import
ShortcutsNavigation
from
'
../../../../shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
../../../../
behaviors/shortcuts/
shortcuts_navigation
'
;
import
BlobViewer
from
'
../../../../blob/viewer
'
;
import
NewCommitForm
from
'
../../../../new_commit_form
'
;
import
{
ajaxGet
}
from
'
../../../../lib/utils/common_utils
'
;
...
...
app/assets/javascripts/pages/projects/wikis/index.js
View file @
196dfd26
...
...
@@ -2,8 +2,8 @@ import $ from 'jquery';
import
Vue
from
'
vue
'
;
import
Translate
from
'
~/vue_shared/translate
'
;
import
csrf
from
'
~/lib/utils/csrf
'
;
import
ShortcutsWiki
from
'
~/behaviors/shortcuts/shortcuts_wiki
'
;
import
Wikis
from
'
./wikis
'
;
import
ShortcutsWiki
from
'
../../../shortcuts_wiki
'
;
import
ZenMode
from
'
../../../zen_mode
'
;
import
GLForm
from
'
../../../gl_form
'
;
import
deleteWikiModal
from
'
./components/delete_wiki_modal.vue
'
;
...
...
spec/javascripts/shortcuts_issuable_spec.js
→
spec/javascripts/
behaviors/shortcuts/
shortcuts_issuable_spec.js
View file @
196dfd26
import
$
from
'
jquery
'
;
import
initCopyAsGFM
from
'
~/behaviors/markdown/copy_as_gfm
'
;
import
ShortcutsIssuable
from
'
~/shortcuts_issuable
'
;
import
ShortcutsIssuable
from
'
~/
behaviors/shortcuts/
shortcuts_issuable
'
;
initCopyAsGFM
();
...
...
spec/javascripts/shortcuts_spec.js
View file @
196dfd26
import
$
from
'
jquery
'
;
import
Shortcuts
from
'
~/shortcuts
'
;
import
Shortcuts
from
'
~/
behaviors/shortcuts/
shortcuts
'
;
describe
(
'
Shortcuts
'
,
()
=>
{
const
fixtureName
=
'
snippets/show.html.raw
'
;
...
...
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