File tree 2 files changed +13
-4
lines changed 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 28
28
{{else}}
29
29
< span > {{.article.AuthorTxt}}</ span >
30
30
{{end}}
31
- · < span title ="{{.article.Ctime}} " class ="timeago "> </ span > · {{.article.Viewnum}} 次点击
31
+ · < span title ="{{.article.Ctime}} " class ="timeago "> </ span > · {{.article.Viewnum}} 次点击 ·
32
+ < span class ="read-time "> </ span > ·
33
+ < span class ="timeago " title ="{{.cur_time}} "> </ span > 开始浏览
32
34
{{if canEdit .me .article}}
33
35
< a id ="edit " class ="op " href ="javascript: " title ="编辑 "> 编辑</ a >
34
36
{{end}}
35
37
</ small >
36
- < small class ="gray " style ="margin-left: 20px; "> < span class ="timeago " title ="{{.cur_time}} "> </ span > 开始浏览</ small >
37
38
</ div >
38
39
{{if gt (distanceDay .article.Ctime) 100 }}
39
40
< div class ="outdated "> 这是一个创建于 < span title ="{{.article.Ctime}} " class ="timeago "> </ span > 的文章,其中的信息可能已经有所发展或是发生改变。</ div >
@@ -195,6 +196,14 @@ <h1>
195
196
$ ( this ) . attr ( 'href' , url ) ;
196
197
$ ( this ) . attr ( 'target' , '_blank' ) ;
197
198
} ) ;
199
+
200
+ var len = '{{.article.Txt}}' . length ;
201
+ var readTime = Math . round ( len / 1200 ) ;
202
+ if ( readTime >= 1 ) {
203
+ $ ( '.read-time' ) . text ( '预计阅读时间 ' + readTime + ' 分钟' ) ;
204
+ } else {
205
+ $ ( '.read-time' ) . text ( '预计阅读时间不到 1 分钟' ) ;
206
+ }
198
207
} ) ;
199
208
</ script >
200
209
< script type ="text/javascript " src ="/static/ckeditor/config.js "> </ script >
Original file line number Diff line number Diff line change 23
23
{{.topic.title}}
24
24
</ h1 >
25
25
< small class ="gray ">
26
- < a href ="/user/{{.topic.user.Username}} "> {{.topic.user.Username}}</ a > · < span title ="{{.topic.ctime}} " class ="timeago "> </ span > · {{add .topic.view 1}} 次点击
26
+ < a href ="/user/{{.topic.user.Username}} "> {{.topic.user.Username}}</ a > · < span title ="{{.topic.ctime}} " class ="timeago "> </ span > · {{add .topic.view 1}} 次点击 ·
27
+ < span class ="timeago " title ="{{.cur_time}} "> </ span > 开始浏览
27
28
{{if canEdit .me .topic}}
28
29
< a class ="op " href ="/topics/modify?tid={{.topic.tid}} " title ="编辑 "> 编辑</ a >
29
30
{{end}}
30
31
</ small >
31
- < small class ="gray " style ="margin-left: 20px; "> < span class ="timeago " title ="{{.cur_time}} "> </ span > 开始浏览</ small >
32
32
</ div >
33
33
{{if gt (distanceDay .topic.ctime) 100 }}
34
34
< div class ="outdated "> 这是一个创建于 < span title ="{{.topic.ctime}} " class ="timeago "> </ span > 的主题,其中的信息可能已经有所发展或是发生改变。</ div >
You can’t perform that action at this time.
0 commit comments