Commit c7834cd7 authored by Van's avatar Van

#12787

parent 91a55753
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
}); });
$(document).ready(function () { $(document).ready(function () {
page.load(); page.load();
// emotions
page.replaceCommentsEm("#comments .vditor-reset");
<#nested> <#nested>
}); });
</script> </script>
......
This diff is collapsed.
...@@ -67,7 +67,7 @@ admin.comment = { ...@@ -67,7 +67,7 @@ admin.comment = {
var hrefHTML = '<a target=\'_blank\' href=\'' + comments[i].commentURL + var hrefHTML = '<a target=\'_blank\' href=\'' + comments[i].commentURL +
'\'>', '\'>',
content = comments[i].commentContent, content = comments[i].commentContent,
contentHTML = Util.replaceEmString(content) contentHTML = content
if (comments[i].commentURL === 'http://') { if (comments[i].commentURL === 'http://') {
hrefHTML = '<a target=\'_blank\'>' hrefHTML = '<a target=\'_blank\'>'
......
...@@ -82,7 +82,7 @@ admin.commentList = { ...@@ -82,7 +82,7 @@ admin.commentList = {
var type = 'Article' var type = 'Article'
commentsData[i] = {} commentsData[i] = {}
commentsData[i].content = '<div class="vditor-reset">' + 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=\'' + '</div><span class=\'table-tag\'> on &nbsp;&nbsp;</span><a href=\'' +
Label.servePath + comments[i].commentSharpURL + Label.servePath + comments[i].commentSharpURL +
'\' target=\'_blank\'>' + comments[i].commentTitle + '\' target=\'_blank\'>' + comments[i].commentTitle +
......
...@@ -225,27 +225,6 @@ var Util = { ...@@ -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 切换到手机版 * @description 切换到手机版
* @param {String} skin 切换前的皮肤名称 * @param {String} skin 切换前的皮肤名称
...@@ -325,7 +304,7 @@ var Util = { ...@@ -325,7 +304,7 @@ var Util = {
replaceSideEm: function (comments) { replaceSideEm: function (comments) {
for (var i = 0; i < comments.length; i++) { for (var i = 0; i < comments.length; i++) {
var $comment = $(comments[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, { ...@@ -76,17 +76,6 @@ $.extend(Page.prototype, {
window.open(urls[key], '_blank', 'top=100,left=200,width=648,height=618') 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 文章加载 * @description 文章加载
*/ */
...@@ -349,7 +338,7 @@ $.extend(Page.prototype, { ...@@ -349,7 +338,7 @@ $.extend(Page.prototype, {
} }
that.toggleEditor() that.toggleEditor()
vditor.setValue('') vditor.setValue('')
that.addCommentAjax(Util.replaceEmString(result.cmtTpl)) that.addCommentAjax(result.cmtTpl)
}, },
}) })
} else { } else {
......
This diff is collapsed.
This diff is collapsed.
...@@ -331,77 +331,6 @@ button:hover,.button:hover { ...@@ -331,77 +331,6 @@ button:hover,.button:hover {
} }
/* end icon */ /* 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 */ /* start tags */
#tags { #tags {
list-style: none; 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