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
Jérome Perrin
gitlab-ce
Commits
adb84833
Commit
adb84833
authored
Dec 14, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted JS modules into exported modules
parent
1fbda39c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
67 additions
and
121 deletions
+67
-121
app/assets/javascripts/activities.js
app/assets/javascripts/activities.js
+1
-4
app/assets/javascripts/admin.js
app/assets/javascripts/admin.js
+55
-59
app/assets/javascripts/aside.js
app/assets/javascripts/aside.js
+0
-24
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+7
-6
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+0
-3
app/assets/javascripts/users/user_tabs.js
app/assets/javascripts/users/user_tabs.js
+2
-1
app/assets/stylesheets/framework/mobile.scss
app/assets/stylesheets/framework/mobile.scss
+0
-17
app/assets/stylesheets/framework/variables.scss
app/assets/stylesheets/framework/variables.scss
+0
-3
app/views/shared/_show_aside.html.haml
app/views/shared/_show_aside.html.haml
+0
-2
spec/javascripts/activities_spec.js
spec/javascripts/activities_spec.js
+2
-2
No files found.
app/assets/javascripts/activities.js
View file @
adb84833
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
{
localTimeAgo
}
from
'
./lib/utils/datetime_utility
'
;
import
{
localTimeAgo
}
from
'
./lib/utils/datetime_utility
'
;
class
Activities
{
export
default
class
Activities
{
constructor
()
{
constructor
()
{
Pager
.
init
(
20
,
true
,
false
,
data
=>
data
,
this
.
updateTooltips
);
Pager
.
init
(
20
,
true
,
false
,
data
=>
data
,
this
.
updateTooltips
);
...
@@ -34,6 +34,3 @@ class Activities {
...
@@ -34,6 +34,3 @@ class Activities {
$sender
.
closest
(
'
li
'
).
toggleClass
(
'
active
'
);
$sender
.
closest
(
'
li
'
).
toggleClass
(
'
active
'
);
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
Activities
=
Activities
;
app/assets/javascripts/admin.js
View file @
adb84833
/* eslint-disable func-names, space-before-function-paren, wrap-iife, one-var, no-var, one-var-declaration-per-line, no-unused-vars, no-else-return, prefer-arrow-callback, camelcase, quotes, comma-dangle, max-len */
import
{
refreshCurrentPage
}
from
'
./lib/utils/url_utility
'
;
import
{
refreshCurrentPage
}
from
'
./lib/utils/url_utility
'
;
window
.
Admin
=
(
function
()
{
function
showBlacklistType
()
{
function
Admin
()
{
if
(
$
(
'
input[name="blacklist_type"]:checked
'
).
val
()
===
'
file
'
)
{
var
modal
,
showBlacklistType
;
$
(
'
.blacklist-file
'
).
show
();
$
(
'
input#user_force_random_password
'
).
on
(
'
change
'
,
function
(
elem
)
{
$
(
'
.blacklist-raw
'
).
hide
();
var
elems
;
}
else
{
elems
=
$
(
'
#user_password, #user_password_confirmation
'
);
$
(
'
.blacklist-file
'
).
hide
();
if
(
$
(
this
).
attr
(
'
checked
'
))
{
$
(
'
.blacklist-raw
'
).
show
();
return
elems
.
val
(
''
).
attr
(
'
disabled
'
,
true
);
}
else
{
return
elems
.
removeAttr
(
'
disabled
'
);
}
});
$
(
'
body
'
).
on
(
'
click
'
,
'
.js-toggle-colors-link
'
,
function
(
e
)
{
e
.
preventDefault
();
return
$
(
'
.js-toggle-colors-container
'
).
toggle
();
});
$
(
'
.log-tabs a
'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
return
$
(
this
).
tab
(
'
show
'
);
});
$
(
'
.log-bottom
'
).
click
(
function
(
e
)
{
var
visible_log
;
e
.
preventDefault
();
visible_log
=
$
(
"
.file-content:visible
"
);
return
visible_log
.
animate
({
scrollTop
:
visible_log
.
find
(
'
ol
'
).
height
()
},
"
fast
"
);
});
modal
=
$
(
'
.change-owner-holder
'
);
$
(
'
.change-owner-link
'
).
bind
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
hide
();
return
modal
.
show
();
});
$
(
'
.change-owner-cancel-link
'
).
bind
(
"
click
"
,
function
(
e
)
{
e
.
preventDefault
();
modal
.
hide
();
return
$
(
'
.change-owner-link
'
).
show
();
});
$
(
'
li.project_member
'
).
bind
(
'
ajax:success
'
,
function
()
{
return
refreshCurrentPage
();
});
$
(
'
li.group_member
'
).
bind
(
'
ajax:success
'
,
function
()
{
return
refreshCurrentPage
();
});
showBlacklistType
=
function
()
{
if
(
$
(
"
input[name='blacklist_type']:checked
"
).
val
()
===
'
file
'
)
{
$
(
'
.blacklist-file
'
).
show
();
return
$
(
'
.blacklist-raw
'
).
hide
();
}
else
{
$
(
'
.blacklist-file
'
).
hide
();
return
$
(
'
.blacklist-raw
'
).
show
();
}
};
$
(
"
input[name='blacklist_type']
"
).
click
(
showBlacklistType
);
showBlacklistType
();
}
}
}
return
Admin
;
export
default
function
adminInit
()
{
})();
const
modal
=
$
(
'
.change-owner-holder
'
);
$
(
'
input#user_force_random_password
'
).
on
(
'
change
'
,
function
randomPasswordClick
()
{
const
$elems
=
$
(
'
#user_password, #user_password_confirmation
'
);
if
(
$
(
this
).
attr
(
'
checked
'
))
{
$elems
.
val
(
''
).
attr
(
'
disabled
'
,
true
);
}
else
{
$elems
.
removeAttr
(
'
disabled
'
);
}
});
$
(
'
body
'
).
on
(
'
click
'
,
'
.js-toggle-colors-link
'
,
(
e
)
=>
{
e
.
preventDefault
();
$
(
'
.js-toggle-colors-container
'
).
toggle
();
});
$
(
'
.log-tabs a
'
).
on
(
'
click
'
,
function
logTabsClick
(
e
)
{
e
.
preventDefault
();
$
(
this
).
tab
(
'
show
'
);
});
$
(
'
.log-bottom
'
).
on
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
const
$visibleLog
=
$
(
'
.file-content:visible
'
);
$visibleLog
.
animate
({
scrollTop
:
$visibleLog
.
find
(
'
ol
'
).
height
(),
},
'
fast
'
);
});
$
(
'
.change-owner-link
'
).
on
(
'
click
'
,
function
changeOwnerLinkClick
(
e
)
{
e
.
preventDefault
();
$
(
this
).
hide
();
modal
.
show
();
});
$
(
'
.change-owner-cancel-link
'
).
on
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
modal
.
hide
();
$
(
'
.change-owner-link
'
).
show
();
});
$
(
'
li.project_member, li.group_member
'
).
on
(
'
ajax:success
'
,
refreshCurrentPage
);
$
(
"
input[name='blacklist_type']
"
).
on
(
'
click
'
,
showBlacklistType
);
showBlacklistType
();
}
app/assets/javascripts/aside.js
deleted
100644 → 0
View file @
1fbda39c
/* eslint-disable func-names, space-before-function-paren, wrap-iife, quotes, prefer-arrow-callback, no-var, one-var, one-var-declaration-per-line, no-else-return, max-len */
window
.
Aside
=
(
function
()
{
function
Aside
()
{
$
(
document
).
off
(
"
click
"
,
"
a.show-aside
"
);
$
(
document
).
on
(
"
click
"
,
'
a.show-aside
'
,
function
(
e
)
{
var
btn
,
icon
;
e
.
preventDefault
();
btn
=
$
(
e
.
currentTarget
);
icon
=
btn
.
find
(
'
i
'
);
if
(
icon
.
hasClass
(
'
fa-angle-left
'
))
{
btn
.
parent
().
find
(
'
section
'
).
hide
();
btn
.
parent
().
find
(
'
aside
'
).
fadeIn
();
return
icon
.
removeClass
(
'
fa-angle-left
'
).
addClass
(
'
fa-angle-right
'
);
}
else
{
btn
.
parent
().
find
(
'
aside
'
).
hide
();
btn
.
parent
().
find
(
'
section
'
).
fadeIn
();
return
icon
.
removeClass
(
'
fa-angle-right
'
).
addClass
(
'
fa-angle-left
'
);
}
});
}
return
Aside
;
})();
app/assets/javascripts/dispatcher.js
View file @
adb84833
...
@@ -16,7 +16,7 @@ import BuildArtifacts from './build_artifacts';
...
@@ -16,7 +16,7 @@ import BuildArtifacts from './build_artifacts';
import
CILintEditor
from
'
./ci_lint_editor
'
;
import
CILintEditor
from
'
./ci_lint_editor
'
;
import
groupsSelect
from
'
./groups_select
'
;
import
groupsSelect
from
'
./groups_select
'
;
import
Search
from
'
./search
'
;
import
Search
from
'
./search
'
;
/* global Admin */
import
initAdmin
from
'
./admin
'
;
import
NamespaceSelect
from
'
./namespace_select
'
;
import
NamespaceSelect
from
'
./namespace_select
'
;
import
NewCommitForm
from
'
./new_commit_form
'
;
import
NewCommitForm
from
'
./new_commit_form
'
;
import
Project
from
'
./project
'
;
import
Project
from
'
./project
'
;
...
@@ -92,6 +92,7 @@ import Diff from './diff';
...
@@ -92,6 +92,7 @@ import Diff from './diff';
import
ProjectLabelSubscription
from
'
./project_label_subscription
'
;
import
ProjectLabelSubscription
from
'
./project_label_subscription
'
;
import
ProjectVariables
from
'
./project_variables
'
;
import
ProjectVariables
from
'
./project_variables
'
;
import
SearchAutocomplete
from
'
./search_autocomplete
'
;
import
SearchAutocomplete
from
'
./search_autocomplete
'
;
import
Activities
from
'
./activities
'
;
(
function
()
{
(
function
()
{
var
Dispatcher
;
var
Dispatcher
;
...
@@ -334,7 +335,7 @@ import SearchAutocomplete from './search_autocomplete';
...
@@ -334,7 +335,7 @@ import SearchAutocomplete from './search_autocomplete';
shortcut_handler
=
new
ShortcutsIssuable
(
true
);
shortcut_handler
=
new
ShortcutsIssuable
(
true
);
break
;
break
;
case
'
dashboard:activity
'
:
case
'
dashboard:activity
'
:
new
gl
.
Activities
();
new
Activities
();
break
;
break
;
case
'
projects:commit:show
'
:
case
'
projects:commit:show
'
:
new
Diff
();
new
Diff
();
...
@@ -355,7 +356,7 @@ import SearchAutocomplete from './search_autocomplete';
...
@@ -355,7 +356,7 @@ import SearchAutocomplete from './search_autocomplete';
$
(
'
.commit-info.branches
'
).
load
(
document
.
querySelector
(
'
.js-commit-box
'
).
dataset
.
commitPath
);
$
(
'
.commit-info.branches
'
).
load
(
document
.
querySelector
(
'
.js-commit-box
'
).
dataset
.
commitPath
);
break
;
break
;
case
'
projects:activity
'
:
case
'
projects:activity
'
:
new
gl
.
Activities
();
new
Activities
();
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
break
;
break
;
case
'
projects:commits:show
'
:
case
'
projects:commits:show
'
:
...
@@ -373,7 +374,7 @@ import SearchAutocomplete from './search_autocomplete';
...
@@ -373,7 +374,7 @@ import SearchAutocomplete from './search_autocomplete';
if
(
$
(
'
#tree-slider
'
).
length
)
new
TreeView
();
if
(
$
(
'
#tree-slider
'
).
length
)
new
TreeView
();
if
(
$
(
'
.blob-viewer
'
).
length
)
new
BlobViewer
();
if
(
$
(
'
.blob-viewer
'
).
length
)
new
BlobViewer
();
if
(
$
(
'
.project-show-activity
'
).
length
)
new
gl
.
Activities
();
if
(
$
(
'
.project-show-activity
'
).
length
)
new
Activities
();
$
(
'
#tree-slider
'
).
waitForImages
(
function
()
{
$
(
'
#tree-slider
'
).
waitForImages
(
function
()
{
ajaxGet
(
document
.
querySelector
(
'
.js-tree-content
'
).
dataset
.
logsPath
);
ajaxGet
(
document
.
querySelector
(
'
.js-tree-content
'
).
dataset
.
logsPath
);
});
});
...
@@ -407,7 +408,7 @@ import SearchAutocomplete from './search_autocomplete';
...
@@ -407,7 +408,7 @@ import SearchAutocomplete from './search_autocomplete';
});
});
break
;
break
;
case
'
groups:activity
'
:
case
'
groups:activity
'
:
new
gl
.
Activities
();
new
Activities
();
break
;
break
;
case
'
groups:show
'
:
case
'
groups:show
'
:
const
newGroupChildWrapper
=
document
.
querySelector
(
'
.js-new-project-subgroup
'
);
const
newGroupChildWrapper
=
document
.
querySelector
(
'
.js-new-project-subgroup
'
);
...
@@ -584,7 +585,7 @@ import SearchAutocomplete from './search_autocomplete';
...
@@ -584,7 +585,7 @@ import SearchAutocomplete from './search_autocomplete';
// needed in rspec
// needed in rspec
gl
.
u2fAuthenticate
=
u2fAuthenticate
;
gl
.
u2fAuthenticate
=
u2fAuthenticate
;
case
'
admin
'
:
case
'
admin
'
:
new
Admin
();
init
Admin
();
switch
(
path
[
1
])
{
switch
(
path
[
1
])
{
case
'
broadcast_messages
'
:
case
'
broadcast_messages
'
:
initBroadcastMessagesForm
();
initBroadcastMessagesForm
();
...
...
app/assets/javascripts/main.js
View file @
adb84833
/* eslint-disable func-names, space-before-function-paren, no-var, quotes, consistent-return, prefer-arrow-callback, comma-dangle, object-shorthand, no-new, max-len, no-multi-spaces, import/newline-after-import, import/first */
/* eslint-disable func-names, space-before-function-paren, no-var, quotes, consistent-return, prefer-arrow-callback, comma-dangle, object-shorthand, no-new, max-len, no-multi-spaces, import/newline-after-import, import/first */
/* global ConfirmDangerModal */
/* global ConfirmDangerModal */
/* global Aside */
import
jQuery
from
'
jquery
'
;
import
jQuery
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
...
@@ -37,7 +36,6 @@ import './behaviors/';
...
@@ -37,7 +36,6 @@ import './behaviors/';
// everything else
// everything else
import
'
./activities
'
;
import
'
./activities
'
;
import
'
./admin
'
;
import
'
./admin
'
;
import
'
./aside
'
;
import
loadAwardsHandler
from
'
./awards_handler
'
;
import
loadAwardsHandler
from
'
./awards_handler
'
;
import
bp
from
'
./breakpoints
'
;
import
bp
from
'
./breakpoints
'
;
import
'
./confirm_danger_modal
'
;
import
'
./confirm_danger_modal
'
;
...
@@ -273,7 +271,6 @@ $(function () {
...
@@ -273,7 +271,6 @@ $(function () {
return
fitSidebarForSize
();
return
fitSidebarForSize
();
});
});
loadAwardsHandler
();
loadAwardsHandler
();
new
Aside
();
renderTimeago
();
renderTimeago
();
...
...
app/assets/javascripts/users/user_tabs.js
View file @
adb84833
import
Activities
from
'
../activities
'
;
import
ActivityCalendar
from
'
./activity_calendar
'
;
import
ActivityCalendar
from
'
./activity_calendar
'
;
import
{
localTimeAgo
}
from
'
../lib/utils/datetime_utility
'
;
import
{
localTimeAgo
}
from
'
../lib/utils/datetime_utility
'
;
...
@@ -170,7 +171,7 @@ export default class UserTabs {
...
@@ -170,7 +171,7 @@ export default class UserTabs {
});
});
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
gl
.
Activities
();
new
Activities
();
this
.
loaded
.
activity
=
true
;
this
.
loaded
.
activity
=
true
;
}
}
...
...
app/assets/stylesheets/framework/mobile.scss
View file @
adb84833
...
@@ -111,21 +111,4 @@
...
@@ -111,21 +111,4 @@
aside
:not
(
.right-sidebar
)
{
aside
:not
(
.right-sidebar
)
{
display
:
none
;
display
:
none
;
}
}
.show-aside
{
display
:
block
!
important
;
}
}
.show-aside
{
display
:
none
;
position
:
fixed
;
right
:
0
;
top
:
30%
;
padding
:
5px
15px
;
background
:
$show-aside-bg
;
font-size
:
20px
;
color
:
$show-aside-color
;
z-index
:
100
;
box-shadow
:
0
1px
2px
$show-aside-shadow
;
}
}
app/assets/stylesheets/framework/variables.scss
View file @
adb84833
...
@@ -245,9 +245,6 @@ $btn-sm-side-margin: 7px;
...
@@ -245,9 +245,6 @@ $btn-sm-side-margin: 7px;
$btn-xs-side-margin
:
5px
;
$btn-xs-side-margin
:
5px
;
$issue-status-expired
:
$orange-500
;
$issue-status-expired
:
$orange-500
;
$issuable-sidebar-color
:
$gl-text-color-secondary
;
$issuable-sidebar-color
:
$gl-text-color-secondary
;
$show-aside-bg
:
#eee
;
$show-aside-color
:
#777
;
$show-aside-shadow
:
#ddd
;
$group-path-color
:
#999
;
$group-path-color
:
#999
;
$namespace-kind-color
:
#aaa
;
$namespace-kind-color
:
#aaa
;
$panel-heading-link-color
:
#777
;
$panel-heading-link-color
:
#777
;
...
...
app/views/shared/_show_aside.html.haml
deleted
100644 → 0
View file @
1fbda39c
=
link_to
'#aside'
,
class:
'show-aside'
do
%i
.fa.fa-angle-left
spec/javascripts/activities_spec.js
View file @
adb84833
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
'
vendor/jquery.endless-scroll
'
;
import
'
vendor/jquery.endless-scroll
'
;
import
'
~/pager
'
;
import
'
~/pager
'
;
import
'
~/activities
'
;
import
Activities
from
'
~/activities
'
;
(()
=>
{
(()
=>
{
window
.
gon
||
(
window
.
gon
=
{});
window
.
gon
||
(
window
.
gon
=
{});
...
@@ -35,7 +35,7 @@ import '~/activities';
...
@@ -35,7 +35,7 @@ import '~/activities';
describe
(
'
Activities
'
,
()
=>
{
describe
(
'
Activities
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
loadFixtures
(
fixtureTemplate
);
loadFixtures
(
fixtureTemplate
);
new
gl
.
Activities
();
new
Activities
();
});
});
for
(
let
i
=
0
;
i
<
filters
.
length
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
filters
.
length
;
i
+=
1
)
{
...
...
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