Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3440c0e6
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3440c0e6
编写于
4月 07, 2016
作者:
A
Alfredo Sumaran
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update datetime in .timeago elements
This should be done before .timeago() is called on the element
上级
b19ccdee
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
28 addition
and
6 deletion
+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
未找到文件。
app/assets/javascripts/application.js.coffee
浏览文件 @
3440c0e6
...
...
@@ -41,6 +41,7 @@
#= require shortcuts_issuable
#= require shortcuts_network
#= require jquery.nicescroll
#= require date.format
#= require_tree .
#= require fuzzaldrin-plus
#= require cropper
...
...
@@ -163,7 +164,9 @@ $ ->
$
(
'.trigger-submit'
).
on
'change'
,
->
$
(
@
).
parents
(
'form'
).
submit
()
$
(
'abbr.timeago, .js-timeago'
).
timeago
()
$timeago
=
$
(
'abbr.timeago, .js-timeago'
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
# Flash
if
(
flash
=
$
(
".flash-container"
)).
length
>
0
...
...
app/assets/javascripts/merge_request_tabs.js.coffee
浏览文件 @
3440c0e6
...
...
@@ -141,7 +141,9 @@ class @MergeRequestTabs
url
:
"
#{
source
}
.json"
success
:
(
data
)
=>
document
.
querySelector
(
"div#commits"
).
innerHTML
=
data
.
html
$
(
'.js-timeago'
).
timeago
()
$timeago
=
$
(
'.js-timeago'
,
'div#commits'
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
@
commitsLoaded
=
true
@
scrollToElement
(
"#commits"
)
...
...
@@ -152,7 +154,9 @@ class @MergeRequestTabs
url
:
"
#{
source
}
.json"
+
@
_location
.
search
success
:
(
data
)
=>
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
()
@
expandViewContainer
()
if
@
diffViewType
()
is
'parallel'
@
diffsLoaded
=
true
...
...
@@ -165,7 +169,9 @@ class @MergeRequestTabs
url
:
"
#{
source
}
.json"
success
:
(
data
)
=>
document
.
querySelector
(
"div#builds"
).
innerHTML
=
data
.
html
$
(
'.js-timeago'
).
timeago
()
$timeago
=
$
(
'.js-timeago'
,
'div#builds'
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
@
buildsLoaded
=
true
@
scrollToElement
(
"#builds"
)
...
...
app/assets/javascripts/notes.js.coffee
浏览文件 @
3440c0e6
...
...
@@ -163,9 +163,16 @@ class @Notes
else
if
@
isNewNote
(
note
)
@
note_ids
.
push
(
note
.
id
)
$
(
'ul.main-notes-list'
)
$notesList
=
$
(
'ul.main-notes-list'
)
$notesList
.
append
(
note
.
html
)
.
syntaxHighlight
()
# Update datetime format on the recent note
$timeago
=
$notesList
.
find
(
"#note_
#{
note
.
id
}
.js-timeago"
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
@
initTaskList
()
@
updateNotesCount
(
1
)
...
...
@@ -217,6 +224,8 @@ class @Notes
# append new note to all matching discussions
discussionContainer
.
append
note_html
gl
.
utils
.
updateFormatDate
(
$
(
'.js-timeago'
,
note_html
))
@
updateNotesCount
(
1
)
###
...
...
@@ -345,7 +354,11 @@ class @Notes
updateNote
:
(
_xhr
,
note
,
_status
)
=>
# Convert returned HTML to a jQuery object so we can modify it further
$html
=
$
(
note
.
html
)
$
(
'.js-timeago'
,
$html
).
timeago
()
$timeago
=
$
(
'.js-timeago'
,
$html
)
gl
.
utils
.
updateFormatDate
(
$timeago
)
$timeago
.
timeago
()
$html
.
syntaxHighlight
()
$html
.
find
(
'.js-task-list-container'
).
taskList
(
'enable'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录