Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ffc362

Browse files
committed
Merge branch 'develop' into revision
2 parents f45912b + 9eef17e commit 7ffc362

File tree

7 files changed

+61
-43
lines changed

7 files changed

+61
-43
lines changed

websites/code/studygolang/static/css/main.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ html, body { background: #F2F2F2; font-family: "Helvetica Neue", Helvetica, Aria
125125
.page .meta .p-author a {color: #272727;}
126126
.page .meta .p-author a:hover {color: #DB6D4C; text-decoration: none; }
127127
.page .meta .p-comment {float: right;padding-left: 10px;border-left: solid 1px #E0E0E0;height: 18px;margin-top: 5px;line-height: 18px;}
128-
.page .meta .p-comment .view,.page .meta .p-comment .like {font-family: "NSimSun";font-size: 12px;color: #888888;}
128+
.page .meta .p-comment .view,.page .meta .p-comment .like, .page .meta .p-comment .favorite {font-family: "NSimSun";font-size: 12px;color: #888888;}
129129
.page .meta .p-comment .like i { color: red; }
130+
.page .meta .p-comment .hadlike {color: red;}
130131
.page .meta .p-comment a {font-size: 12px;color: #ed5565; text-decoration: none;}
131132
.page .tags {padding: 20px 0; margin: 0 30px;}
132133
.page .tags .list-inline li {margin-right: 5px;margin-bottom: 6px;}

websites/code/studygolang/static/js/comment.js

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
}
1414
})
1515

16+
emojify.setConfig({
17+
// emojify_tag_type : 'span',
18+
only_crawl_id : null,
19+
img_dir : 'http://www.emoji-cheat-sheet.com/graphics/emojis',
20+
ignored_tags : { //忽略以下几种标签内的emoji识别
21+
'SCRIPT' : 1,
22+
'TEXTAREA': 1,
23+
'A' : 1,
24+
'PRE' : 1,
25+
'CODE' : 1
26+
}
27+
});
28+
1629
// 异步加载 评论
1730
window.loadComments = function() {
1831
var objid = $('.page-comment').data('objid'),
@@ -50,19 +63,9 @@
5063
$('.page-comment .words').removeClass('hide');
5164
}
5265

53-
emojify.setConfig({
54-
// emojify_tag_type : 'span',
55-
only_crawl_id : null,
56-
img_dir : 'http://www.emoji-cheat-sheet.com/graphics/emojis',
57-
ignored_tags : { //忽略以下几种标签内的emoji识别
58-
'SCRIPT' : 1,
59-
'TEXTAREA': 1,
60-
'A' : 1,
61-
'PRE' : 1,
62-
'CODE' : 1
63-
}
64-
});
6566
emojify.run($('.page-comment .words ul').get(0));
67+
68+
registerAtEvent();
6669
} else {
6770
comTip("评论加载失败");
6871
}
@@ -227,20 +230,11 @@
227230

228231
$('.page-comment .words ul').append(oneCmt);
229232
$('.page-comment .words').removeClass('hide');
230-
231-
emojify.setConfig({
232-
// emojify_tag_type : 'span',
233-
only_crawl_id : null,
234-
img_dir : 'http://www.emoji-cheat-sheet.com/graphics/emojis',
235-
ignored_tags : { //忽略以下几种标签内的emoji识别
236-
'SCRIPT' : 1,
237-
'TEXTAREA': 1,
238-
'A' : 1,
239-
'PRE' : 1,
240-
'CODE' : 1
241-
}
242-
});
233+
234+
// 解析表情
243235
emojify.run($('.page-comment .words ul li:last').get(0));
236+
// 注册@
237+
registerAtEvent();
244238

245239
var $cmtNumObj = $('.page-comment .words h3 .cmtnum'),
246240
cmtNum = parseInt($cmtNumObj.text(), 10) + 1;
@@ -265,16 +259,19 @@
265259
});
266260
}
267261

268-
if ($("#is_login_status").val() == 1) {
269-
// @ 本站其他人
270-
$('.page-comment #commentForm textarea').atwho({
271-
at: "@",
272-
data: "/at/users.json"
273-
}).atwho({
274-
at: ":",
275-
data: window.emojis,
276-
tpl:"<li data-value='${key}'><img src='http://www.emoji-cheat-sheet.com/graphics/emojis/${name}.png' height='20' width='20' /> ${name}</li>"
277-
});
262+
// 注册 @ 和 表情
263+
var registerAtEvent = function() {
264+
if ($("#is_login_status").val() == 1) {
265+
// @ 本站其他人
266+
$('.page-comment textarea').atwho({
267+
at: "@",
268+
data: "/at/users.json"
269+
}).atwho({
270+
at: ":",
271+
data: window.emojis,
272+
tpl:"<li data-value='${key}'><img src='http://www.emoji-cheat-sheet.com/graphics/emojis/${name}.png' height='20' width='20' /> ${name}</li>"
273+
});
274+
}
278275
}
279276

280277
// 分析 @ 的用户

websites/code/studygolang/static/js/common.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ jQuery(document).ready(function($) {
214214

215215
var that = this;
216216
postFavorite(that, function(hadCollect){
217-
$(that).data('collect', hadCollect);
217+
$('.page .collect').data('collect', hadCollect);
218218

219219
if (hadCollect) {
220220
comTip("感谢收藏!");
221-
$(that).addClass('hadlike').attr('title', '取消收藏');
221+
$('.page .collect').addClass('hadlike').attr('title', '取消收藏');
222222
} else {
223-
$(that).removeClass('hadlike').attr('title', '稍后再读');
223+
$('.page .collect').removeClass('hadlike').attr('title', '稍后再读');
224224
comTip("已取消收藏!");
225225
}
226226
});

websites/code/studygolang/static/js/sidebar.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ $(function(){
106106
}
107107
}
108108

109+
emojify.setConfig({
110+
// emojify_tag_type : 'span',
111+
only_crawl_id : null,
112+
img_dir : 'http://www.emoji-cheat-sheet.com/graphics/emojis',
113+
ignored_tags : { //忽略以下几种标签内的emoji识别
114+
'SCRIPT' : 1,
115+
'TEXTAREA': 1,
116+
'A' : 1,
117+
'PRE' : 1,
118+
'CODE' : 1
119+
}
120+
});
121+
109122
// 侧边栏——最新评论
110123
var commentRecent = function(data){
111124
if (data.ok) {
@@ -165,6 +178,7 @@ $(function(){
165178
'</li>';
166179
}
167180
$('.sb-content .cmt-list ul').html(content);
181+
emojify.run($('.sb-content .cmt-list ul').get(0));
168182
}
169183
}
170184

websites/code/studygolang/template/articles/detail.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{define "title"}}{{.article.Title}} {{end}}
2-
{{define "seo"}}<meta name="keywords" content="{{.article.Title}} Go语言博客文章, Go语言博文, Go语言, Golang, Go中文社区,Golang中文社区, Go语言社区, Go语言学习园地">
2+
{{define "seo"}}<meta name="keywords" content="{{.article.Title}}, Go语言博客文章, Go语言博文, Go语言, Golang, Go中文社区,Golang中文社区, Go语言社区, Go语言学习园地">
33
<meta name="description" content="{{substring .article.Txt 200 ""}}">{{end}}
44
{{define "content"}}
55
<div class="row banner">
@@ -33,7 +33,10 @@ <h1>{{.article.Title}}</h1>
3333
<i class="glyphicon glyphicon-heart"></i>
3434
<span class="likenum">{{.article.Likenum}}</span> 人喜欢&nbsp;
3535
</span>
36-
<a href="/articles/{{.article.Id}}#commentForm" title="我要评论"><i class="glyphicon glyphicon-comment"></i> <span class="cmtnum">{{.article.Cmtnum}}</span> 条评论</a>
36+
<a href="/articles/{{.article.Id}}#commentForm" title="我要评论"><i class="glyphicon glyphicon-comment"></i> <span class="cmtnum">{{.article.Cmtnum}}</span> 条评论</a>&nbsp;
37+
<a class="favorite collect {{if .hadcollect}}hadlike{{end}}" href="#" title="{{if .hadcollect}}取消收藏{{else}}稍后再读{{end}}" data-objid="{{.article.Id}}" data-objtype="1" data-collect="{{.hadcollect}}">
38+
<i class="glyphicon glyphicon-star{{if eq .hadcollect 0}}-empty{{end}}"></i> 收藏
39+
</a>
3740
</div>
3841
<!-- p-comment END -->
3942
</div>
@@ -54,6 +57,7 @@ <h1>{{.article.Title}}</h1>
5457
<!-- content END -->
5558
<div class="row orig-info">
5659
<p>本文来自:<a href="/wr?u=http://{{.article.Domain}}" target="_blank" title="{{.article.Name}}">{{.article.Name}}</a></p>
60+
<p>感谢作者:{{noescape .article.Author}}</p>
5761
<p>查看原文:<a href="/wr?u={{.article.Url}}" target="_blank" title="{{.article.Title}}">{{.article.Title}}</a></p>
5862
</div>
5963
<div class="active row">

websites/code/studygolang/template/common/layout.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<ul class="dropdown-menu" aria-labelledby="articles">
3838
<li><a href="/articles">网友博文</a></li>
3939
<li><a href="http://blog.studygolang.com" target="_blank">本站博客</a></li>
40-
<li><a href="http://blog.studygolang.com" target="_blank">官方博客</a></li>
4140
</ul>
4241
</li>
4342
<li class="{{.activeProjects}}">
@@ -58,6 +57,8 @@
5857
<ul class="dropdown-menu" aria-labelledby="docs">
5958
<li><a href="http://docs.studygolang.com" target="_blank">英文文档</a></li>
6059
<li><a href="http://docscn.studygolang.com" target="_blank">中文文档</a></li>
60+
<li role="presentation" class="divider"></li>
61+
<li><a href="http://tour.studygolang.com" target="_blank">Go指南</a></li>
6162
</ul>
6263
</li>
6364
</ul>
@@ -191,5 +192,6 @@ <h5>第三方账号登录</h5>
191192
</script>
192193
<script src="/static/js/common.js"></script>
193194
{{template "js" .}}
195+
<script type="text/javascript" src="/static/js/libs/emojify.min.js"></script>
194196
<script src="/static/js/sidebar.js"></script>
195197
</html>

websites/code/studygolang/template/search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h2>
5656
<div class="row">
5757
<div class="col-md-8 metatag">
5858
<i class="glyphicon glyphicon-tasks"></i>
59-
<span class="source" title="类别">{{if eq .Objtype 0}}话题{{else if eq .Objtype 1}}博文{{else}}帖子{{end}}</span>
59+
<span class="source" title="类别">{{if eq .Objtype 0}}主题{{else if eq .Objtype 1}}博文{{else}}帖子{{end}}</span>
6060
<i class="glyphicon glyphicon-calendar"></i>
6161
<span class="date" title="发布日期">{{.PubTime}}</span>
6262
<i class="glyphicon glyphicon-user"></i>

0 commit comments

Comments
 (0)