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
38a4f5ce
Commit
38a4f5ce
authored
Apr 11, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method and initialize .timeago inside
parent
3440c0e6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
19 deletions
+10
-19
app/assets/javascripts/application.js.coffee
app/assets/javascripts/application.js.coffee
+1
-3
app/assets/javascripts/lib/datetime_utility.js.coffee
app/assets/javascripts/lib/datetime_utility.js.coffee
+3
-1
app/assets/javascripts/merge_request_tabs.js.coffee
app/assets/javascripts/merge_request_tabs.js.coffee
+3
-9
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+3
-6
No files found.
app/assets/javascripts/application.js.coffee
View file @
38a4f5ce
...
@@ -164,9 +164,7 @@ $ ->
...
@@ -164,9 +164,7 @@ $ ->
$
(
'.trigger-submit'
).
on
'change'
,
->
$
(
'.trigger-submit'
).
on
'change'
,
->
$
(
@
).
parents
(
'form'
).
submit
()
$
(
@
).
parents
(
'form'
).
submit
()
$timeago
=
$
(
'abbr.timeago, .js-timeago'
)
gl
.
utils
.
localTimeAgo
(
$
(
'abbr.timeago, .js-timeago'
),
false
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
# Flash
# Flash
if
(
flash
=
$
(
".flash-container"
)).
length
>
0
if
(
flash
=
$
(
".flash-container"
)).
length
>
0
...
...
app/assets/javascripts/lib/datetime_utility.js.coffee
View file @
38a4f5ce
...
@@ -6,10 +6,12 @@
...
@@ -6,10 +6,12 @@
w
.
gl
.
utils
.
formatDate
=
(
datetime
)
->
w
.
gl
.
utils
.
formatDate
=
(
datetime
)
->
dateFormat
(
datetime
,
'mmm d, yyyy h:MMtt Z'
)
dateFormat
(
datetime
,
'mmm d, yyyy h:MMtt Z'
)
w
.
gl
.
utils
.
updateFormatDate
=
(
$timeagoEls
)
->
w
.
gl
.
utils
.
localTimeAgo
=
(
$timeagoEls
,
setTimeago
=
true
)
->
$timeagoEls
.
each
(
->
$timeagoEls
.
each
(
->
$el
=
$
(
@
)
$el
=
$
(
@
)
$el
.
attr
(
'title'
,
gl
.
utils
.
formatDate
(
$el
.
attr
(
'datetime'
)))
$el
.
attr
(
'title'
,
gl
.
utils
.
formatDate
(
$el
.
attr
(
'datetime'
)))
)
)
$timeagoEls
.
timeago
()
if
setTimeago
)
window
)
window
app/assets/javascripts/merge_request_tabs.js.coffee
View file @
38a4f5ce
...
@@ -141,9 +141,7 @@ class @MergeRequestTabs
...
@@ -141,9 +141,7 @@ class @MergeRequestTabs
url
:
"
#{
source
}
.json"
url
:
"
#{
source
}
.json"
success
:
(
data
)
=>
success
:
(
data
)
=>
document
.
querySelector
(
"div#commits"
).
innerHTML
=
data
.
html
document
.
querySelector
(
"div#commits"
).
innerHTML
=
data
.
html
$timeago
=
$
(
'.js-timeago'
,
'div#commits'
)
gl
.
utils
.
localTimeAgo
(
$
(
'.js-timeago'
,
'div#commits'
))
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
@
commitsLoaded
=
true
@
commitsLoaded
=
true
@
scrollToElement
(
"#commits"
)
@
scrollToElement
(
"#commits"
)
...
@@ -154,9 +152,7 @@ class @MergeRequestTabs
...
@@ -154,9 +152,7 @@ class @MergeRequestTabs
url
:
"
#{
source
}
.json"
+
@
_location
.
search
url
:
"
#{
source
}
.json"
+
@
_location
.
search
success
:
(
data
)
=>
success
:
(
data
)
=>
document
.
querySelector
(
"div#diffs"
).
innerHTML
=
data
.
html
document
.
querySelector
(
"div#diffs"
).
innerHTML
=
data
.
html
$timeago
=
$
(
'.js-timeago'
,
'div#diffs'
)
gl
.
utils
.
localTimeAgo
(
$
(
'.js-timeago'
,
'div#diffs'
))
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
$
(
'div#diffs .js-syntax-highlight'
).
syntaxHighlight
()
$
(
'div#diffs .js-syntax-highlight'
).
syntaxHighlight
()
@
expandViewContainer
()
if
@
diffViewType
()
is
'parallel'
@
expandViewContainer
()
if
@
diffViewType
()
is
'parallel'
@
diffsLoaded
=
true
@
diffsLoaded
=
true
...
@@ -169,9 +165,7 @@ class @MergeRequestTabs
...
@@ -169,9 +165,7 @@ class @MergeRequestTabs
url
:
"
#{
source
}
.json"
url
:
"
#{
source
}
.json"
success
:
(
data
)
=>
success
:
(
data
)
=>
document
.
querySelector
(
"div#builds"
).
innerHTML
=
data
.
html
document
.
querySelector
(
"div#builds"
).
innerHTML
=
data
.
html
$timeago
=
$
(
'.js-timeago'
,
'div#builds'
)
gl
.
utils
.
localTimeAgo
(
$
(
'.js-timeago'
,
'div#builds'
))
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
@
buildsLoaded
=
true
@
buildsLoaded
=
true
@
scrollToElement
(
"#builds"
)
@
scrollToElement
(
"#builds"
)
...
...
app/assets/javascripts/notes.js.coffee
View file @
38a4f5ce
...
@@ -170,8 +170,7 @@ class @Notes
...
@@ -170,8 +170,7 @@ class @Notes
.
syntaxHighlight
()
.
syntaxHighlight
()
# Update datetime format on the recent note
# Update datetime format on the recent note
$timeago
=
$notesList
.
find
(
"#note_
#{
note
.
id
}
.js-timeago"
)
gl
.
utils
.
localTimeAgo
(
$notesList
.
find
(
"#note_
#{
note
.
id
}
.js-timeago"
),
false
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
@
initTaskList
()
@
initTaskList
()
@
updateNotesCount
(
1
)
@
updateNotesCount
(
1
)
...
@@ -224,7 +223,7 @@ class @Notes
...
@@ -224,7 +223,7 @@ class @Notes
# append new note to all matching discussions
# append new note to all matching discussions
discussionContainer
.
append
note_html
discussionContainer
.
append
note_html
gl
.
utils
.
updateFormatDate
(
$
(
'.js-timeago'
,
note_html
)
)
gl
.
utils
.
localTimeAgo
(
$
(
'.js-timeago'
,
note_html
),
false
)
@
updateNotesCount
(
1
)
@
updateNotesCount
(
1
)
...
@@ -355,9 +354,7 @@ class @Notes
...
@@ -355,9 +354,7 @@ class @Notes
# Convert returned HTML to a jQuery object so we can modify it further
# Convert returned HTML to a jQuery object so we can modify it further
$html
=
$
(
note
.
html
)
$html
=
$
(
note
.
html
)
$timeago
=
$
(
'.js-timeago'
,
$html
)
gl
.
utils
.
localTimeAgo
(
$
(
'.js-timeago'
,
$html
))
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
$html
.
syntaxHighlight
()
$html
.
syntaxHighlight
()
$html
.
find
(
'.js-task-list-container'
).
taskList
(
'enable'
)
$html
.
find
(
'.js-task-list-container'
).
taskList
(
'enable'
)
...
...
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