Commit c7834cd7 authored by Van's avatar Van

#12787

parent 91a55753
......@@ -47,8 +47,6 @@
});
$(document).ready(function () {
page.load();
// emotions
page.replaceCommentsEm("#comments .vditor-reset");
<#nested>
});
</script>
......
This diff is collapsed.
......@@ -67,7 +67,7 @@ admin.comment = {
var hrefHTML = '<a target=\'_blank\' href=\'' + comments[i].commentURL +
'\'>',
content = comments[i].commentContent,
contentHTML = Util.replaceEmString(content)
contentHTML = content
if (comments[i].commentURL === 'http://') {
hrefHTML = '<a target=\'_blank\'>'
......
......@@ -82,7 +82,7 @@ admin.commentList = {
var type = 'Article'
commentsData[i] = {}
commentsData[i].content = '<div class="vditor-reset">' +
Util.replaceEmString(comments[i].commentContent) +
comments[i].commentContent +
'</div><span class=\'table-tag\'> on &nbsp;&nbsp;</span><a href=\'' +
Label.servePath + comments[i].commentSharpURL +
'\' target=\'_blank\'>' + comments[i].commentTitle +
......
......@@ -225,27 +225,6 @@ var Util = {
}
}
},
/**
* @description 替换[emXX] 为图片
* @param {String} str 替换字符串
* @returns {String} 替换后的字符
*/
replaceEmString: function (str) {
var commentSplited = str.split('[em')
if (commentSplited.length === 1) {
return str
}
str = commentSplited[0]
for (var j = 1; j < commentSplited.length; j++) {
var key = commentSplited[j].substr(0, 2)
str += '<img width=\'20\' src=\'' + Label.staticServePath +
'/images/emotions/em' + key + '.png\' alt=\'' +
Label['em' + key + 'Label'] + '\' title=\'' +
Label['em' + key + 'Label'] + '\'/> ' + commentSplited[j].substr(3)
}
return str
},
/**
* @description 切换到手机版
* @param {String} skin 切换前的皮肤名称
......@@ -325,7 +304,7 @@ var Util = {
replaceSideEm: function (comments) {
for (var i = 0; i < comments.length; i++) {
var $comment = $(comments[i])
$comment.html(Util.replaceEmString($comment.html()))
$comment.html($comment.html())
}
},
/**
......
This diff is collapsed.
......@@ -76,17 +76,6 @@ $.extend(Page.prototype, {
window.open(urls[key], '_blank', 'top=100,left=200,width=648,height=618')
})
},
/*
* @description 把评论中的标识替换为图片
* @param {Dom} selector
*/
replaceCommentsEm: function (selector) {
var $commentContents = $(selector)
for (var i = 0; i < $commentContents.length; i++) {
var str = $commentContents[i].innerHTML
$commentContents[i].innerHTML = Util.replaceEmString(str)
}
},
/*
* @description 文章加载
*/
......@@ -349,7 +338,7 @@ $.extend(Page.prototype, {
}
that.toggleEditor()
vditor.setValue('')
that.addCommentAjax(Util.replaceEmString(result.cmtTpl))
that.addCommentAjax(result.cmtTpl)
},
})
} else {
......
This diff is collapsed.
This diff is collapsed.
......@@ -331,77 +331,6 @@ button:hover,.button:hover {
}
/* end icon */
/* start emotions */
.em00, .em01, .em02, .em03, .em04, .em05, .em06, .em07, .em08, .em09,
.em10, .em11, .em12, .em13, .em14 {
background-image: url("../images/emotions/emotions.png");
background-size: 120px;
float: left;
height: 24px;
margin-right: 5px;
width: 24px;
}
#emotions span {
cursor: pointer;
}
.em01 {
background-position: -24px 0;
}
.em02 {
background-position: -48px 0;
}
.em03 {
background-position: -72px 0;
}
.em04 {
background-position: -96px 0;
}
.em05 {
background-position: 0px -24px;
}
.em06 {
background-position: -24px -24px;
}
.em07 {
background-position: -48px -24px;
}
.em08 {
background-position: -72px -24px;
}
.em09 {
background-position: -96px -24px;
}
.em10 {
background-position: 0 -48px;
}
.em11 {
background-position: -24px -48px ;
}
.em12 {
background-position: -48px -48px;
}
.em13 {
background-position: -72px -48px;
}
.em14 {
background-position: -96px -48px;
}
/* end emotions */
/* start tags */
#tags {
list-style: none;
......
Subproject commit 895d3cfa4c522932070377f8d19f4eae559d2de1
Subproject commit 7332ca1d7e2e39d76a7eaffbc6bf6c4c710fb06b
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment