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
3440c0e6
Commit
3440c0e6
authored
Apr 07, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update datetime in .timeago elements
This should be done before .timeago() is called on the element
parent
b19ccdee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
app/assets/javascripts/application.js.coffee
app/assets/javascripts/application.js.coffee
+4
-1
app/assets/javascripts/merge_request_tabs.js.coffee
app/assets/javascripts/merge_request_tabs.js.coffee
+9
-3
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+15
-2
No files found.
app/assets/javascripts/application.js.coffee
View file @
3440c0e6
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#= require shortcuts_issuable
#= require shortcuts_issuable
#= require shortcuts_network
#= require shortcuts_network
#= require jquery.nicescroll
#= require jquery.nicescroll
#= require date.format
#= require_tree .
#= require_tree .
#= require fuzzaldrin-plus
#= require fuzzaldrin-plus
#= require cropper
#= require cropper
...
@@ -163,7 +164,9 @@ $ ->
...
@@ -163,7 +164,9 @@ $ ->
$
(
'.trigger-submit'
).
on
'change'
,
->
$
(
'.trigger-submit'
).
on
'change'
,
->
$
(
@
).
parents
(
'form'
).
submit
()
$
(
@
).
parents
(
'form'
).
submit
()
$
(
'abbr.timeago, .js-timeago'
).
timeago
()
$timeago
=
$
(
'abbr.timeago, .js-timeago'
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
# Flash
# Flash
if
(
flash
=
$
(
".flash-container"
)).
length
>
0
if
(
flash
=
$
(
".flash-container"
)).
length
>
0
...
...
app/assets/javascripts/merge_request_tabs.js.coffee
View file @
3440c0e6
...
@@ -141,7 +141,9 @@ class @MergeRequestTabs
...
@@ -141,7 +141,9 @@ 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
$
(
'.js-timeago'
).
timeago
()
$timeago
=
$
(
'.js-timeago'
,
'div#commits'
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
@
commitsLoaded
=
true
@
commitsLoaded
=
true
@
scrollToElement
(
"#commits"
)
@
scrollToElement
(
"#commits"
)
...
@@ -152,7 +154,9 @@ class @MergeRequestTabs
...
@@ -152,7 +154,9 @@ 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
$
(
'.js-timeago'
).
timeago
()
$timeago
=
$
(
'.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
...
@@ -165,7 +169,9 @@ class @MergeRequestTabs
...
@@ -165,7 +169,9 @@ 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
$
(
'.js-timeago'
).
timeago
()
$timeago
=
$
(
'.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 @
3440c0e6
...
@@ -163,9 +163,16 @@ class @Notes
...
@@ -163,9 +163,16 @@ class @Notes
else
if
@
isNewNote
(
note
)
else
if
@
isNewNote
(
note
)
@
note_ids
.
push
(
note
.
id
)
@
note_ids
.
push
(
note
.
id
)
$
(
'ul.main-notes-list'
)
$notesList
=
$
(
'ul.main-notes-list'
)
$notesList
.
append
(
note
.
html
)
.
append
(
note
.
html
)
.
syntaxHighlight
()
.
syntaxHighlight
()
# Update datetime format on the recent note
$timeago
=
$notesList
.
find
(
"#note_
#{
note
.
id
}
.js-timeago"
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
@
initTaskList
()
@
initTaskList
()
@
updateNotesCount
(
1
)
@
updateNotesCount
(
1
)
...
@@ -217,6 +224,8 @@ class @Notes
...
@@ -217,6 +224,8 @@ 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
))
@
updateNotesCount
(
1
)
@
updateNotesCount
(
1
)
###
###
...
@@ -345,7 +354,11 @@ class @Notes
...
@@ -345,7 +354,11 @@ class @Notes
updateNote
:
(
_xhr
,
note
,
_status
)
=>
updateNote
:
(
_xhr
,
note
,
_status
)
=>
# 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
)
$
(
'.js-timeago'
,
$html
).
timeago
()
$timeago
=
$
(
'.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