2012-06-11 15:52:11 +08:00
|
|
|
<#macro comments commentList article>
|
|
|
|
<h2 class="marginBottom12">${commentLabel}</h2>
|
|
|
|
<div class="comments" id="comments">
|
|
|
|
<#if 0 == commentList?size>
|
|
|
|
${noCommentLabel}
|
|
|
|
</#if>
|
|
|
|
<#list commentList as comment>
|
|
|
|
<div id="${comment.oId}">
|
|
|
|
<div class="comment-panel">
|
|
|
|
<div class="comment-title">
|
|
|
|
<#if "http://" == comment.commentURL>
|
|
|
|
<a>${comment.commentName}</a>
|
|
|
|
<#else>
|
|
|
|
<a href="${comment.commentURL}" target="_blank">${comment.commentName}</a>
|
|
|
|
</#if>
|
|
|
|
<#if comment.isReply>
|
|
|
|
@
|
|
|
|
<a href="${servePath}${article.permalink}#${comment.commentOriginalCommentId}"
|
|
|
|
onmouseover="page.showComment(this, '${comment.commentOriginalCommentId}', 23);"
|
|
|
|
onmouseout="page.hideComment('${comment.commentOriginalCommentId}')">${comment.commentOriginalCommentName}</a>
|
|
|
|
</#if>
|
|
|
|
<div class="right">
|
|
|
|
${comment.commentDate?string("yyyy-MM-dd HH:mm:ss")}
|
|
|
|
|
|
|
|
<#if article.commentable>
|
|
|
|
<a class="no-underline"
|
|
|
|
href="javascript:replyTo('${comment.oId}');">${replyLabel}</a>
|
|
|
|
</#if>
|
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
|
|
|
<div class="comment-body">
|
|
|
|
<div class="left comment-picture">
|
|
|
|
<img alt="${comment.commentName}" src="${comment.commentThumbnailURL}"/>
|
|
|
|
</div>
|
|
|
|
<div class="comment-content">
|
|
|
|
${comment.commentContent}
|
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</#list>
|
|
|
|
</div>
|
|
|
|
<#if article.commentable>
|
|
|
|
<div class="comment-title">
|
|
|
|
${postCommentsLabel}
|
|
|
|
</div>
|
|
|
|
<div class="comment-body">
|
|
|
|
<table id="commentForm" class="form">
|
|
|
|
<tbody>
|
2013-10-18 14:54:04 +08:00
|
|
|
<#if !isLoggedIn>
|
2012-06-11 15:52:11 +08:00
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
${commentName1Label}
|
|
|
|
</th>
|
2012-11-29 16:21:17 +08:00
|
|
|
<td>
|
2012-06-11 15:52:11 +08:00
|
|
|
<input type="text" class="normalInput" id="commentName"/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
${commentEmail1Label}
|
|
|
|
</th>
|
2012-11-29 16:21:17 +08:00
|
|
|
<td>
|
2012-06-11 15:52:11 +08:00
|
|
|
<input type="text" class="normalInput" id="commentEmail"/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
${commentURL1Label}
|
|
|
|
</th>
|
2012-11-29 16:21:17 +08:00
|
|
|
<td>
|
2012-06-11 15:52:11 +08:00
|
|
|
<input type="text" id="commentURL"/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2013-10-18 14:54:04 +08:00
|
|
|
</#if>
|
2012-06-11 15:52:11 +08:00
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
${commentEmotions1Label}
|
|
|
|
</th>
|
|
|
|
<td id="emotions">
|
|
|
|
<span class="em00" title="${em00Label}"></span>
|
|
|
|
<span class="em01" title="${em01Label}"></span>
|
|
|
|
<span class="em02" title="${em02Label}"></span>
|
|
|
|
<span class="em03" title="${em03Label}"></span>
|
|
|
|
<span class="em04" title="${em04Label}"></span>
|
|
|
|
<span class="em05" title="${em05Label}"></span>
|
|
|
|
<span class="em06" title="${em06Label}"></span>
|
|
|
|
<span class="em07" title="${em07Label}"></span>
|
|
|
|
<span class="em08" title="${em08Label}"></span>
|
|
|
|
<span class="em09" title="${em09Label}"></span>
|
|
|
|
<span class="em10" title="${em10Label}"></span>
|
|
|
|
<span class="em11" title="${em11Label}"></span>
|
|
|
|
<span class="em12" title="${em12Label}"></span>
|
|
|
|
<span class="em13" title="${em13Label}"></span>
|
|
|
|
<span class="em14" title="${em14Label}"></span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th valign="top">
|
|
|
|
${commentContent1Label}
|
|
|
|
</th>
|
2012-11-29 16:21:17 +08:00
|
|
|
<td>
|
2012-06-11 15:52:11 +08:00
|
|
|
<textarea rows="10" cols="96" id="comment"></textarea>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2013-10-18 14:54:04 +08:00
|
|
|
<#if !isLoggedIn>
|
2012-06-11 15:52:11 +08:00
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
${captcha1Label}
|
|
|
|
</th>
|
|
|
|
<td>
|
|
|
|
<input type="text" class="normalInput" id="commentValidate"/>
|
|
|
|
<img id="captcha" alt="validate" src="${servePath}/captcha.do" />
|
|
|
|
</td>
|
|
|
|
</tr>
|
2013-10-18 14:54:04 +08:00
|
|
|
</#if>
|
2012-06-11 15:52:11 +08:00
|
|
|
<tr>
|
2012-11-29 16:21:17 +08:00
|
|
|
<td colspan="2" align="right">
|
|
|
|
<span style="line-height: 28px;" class="error-msg" id="commentErrorTip"></span>
|
2012-06-11 15:52:11 +08:00
|
|
|
<button id="submitCommentButton" onclick="page.submitComment();">${submmitCommentLabel}</button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</#if>
|
|
|
|
</#macro>
|
|
|
|
|
|
|
|
<#macro comment_script oId>
|
|
|
|
<script type="text/javascript" src="${staticServePath}/js/page${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var page = new Page({
|
|
|
|
"nameTooLongLabel": "${nameTooLongLabel}",
|
|
|
|
"mailCannotEmptyLabel": "${mailCannotEmptyLabel}",
|
|
|
|
"mailInvalidLabel": "${mailInvalidLabel}",
|
|
|
|
"commentContentCannotEmptyLabel": "${commentContentCannotEmptyLabel}",
|
|
|
|
"captchaCannotEmptyLabel": "${captchaCannotEmptyLabel}",
|
|
|
|
"loadingLabel": "${loadingLabel}",
|
|
|
|
"oId": "${oId}",
|
|
|
|
"skinDirName": "${skinDirName}",
|
|
|
|
"blogHost": "${blogHost}",
|
|
|
|
"randomArticles1Label": "${randomArticles1Label}",
|
|
|
|
"externalRelevantArticles1Label": "${externalRelevantArticles1Label}"
|
|
|
|
});
|
|
|
|
|
|
|
|
var addComment = function (result, state) {
|
|
|
|
var commentHTML = '<div id="' + result.oId +
|
|
|
|
'"><div class="comment-panel"><div class="comment-title">' + result.replyNameHTML;
|
|
|
|
|
|
|
|
if (state !== "") {
|
|
|
|
var commentOriginalCommentName = $("#" + page.currentCommentId).find(".comment-title a").first().text();
|
|
|
|
commentHTML += ' @ <a href="${servePath}' + result.commentSharpURL.split("#")[0] + '#' + page.currentCommentId + '"'
|
|
|
|
+ 'onmouseover="page.showComment(this, \'' + page.currentCommentId + '\', 23);"'
|
|
|
|
+ 'onmouseout="page.hideComment(\'' + page.currentCommentId + '\')">' + commentOriginalCommentName + '</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
commentHTML += '<div class="right">' + result.commentDate
|
|
|
|
+ ' <a class="no-underline" href="javascript:replyTo(\'' + result.oId + '\');">${replyLabel}</a>'
|
|
|
|
+ '</div><div class="clear"></div></div><div class="comment-body">'
|
2013-10-26 16:02:25 +08:00
|
|
|
+ '<div class="left comment-picture"><img alt="' + result.userName
|
2012-06-11 15:52:11 +08:00
|
|
|
+ '" src="' + result.commentThumbnailURL + '"/>'
|
|
|
|
+ '</div><div class="comment-content">' +
|
2015-12-18 11:12:11 +08:00
|
|
|
Util.replaceEmString($("#comment" + state).val())
|
2012-06-11 15:52:11 +08:00
|
|
|
+ '</div><div class="clear"></div>'
|
|
|
|
+ '</div></div></div>';
|
|
|
|
return commentHTML;
|
|
|
|
}
|
|
|
|
|
|
|
|
var replyTo = function (id) {
|
|
|
|
var commentFormHTML = "<table class='form comment-reply' id='replyForm'>";
|
|
|
|
page.addReplyForm(id, commentFormHTML);
|
|
|
|
};
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
page.load();
|
|
|
|
// emotions
|
|
|
|
page.replaceCommentsEm("#comments .comment-content");
|
|
|
|
<#nested>
|
|
|
|
})();
|
|
|
|
</script>
|
2012-05-28 23:48:41 +08:00
|
|
|
</#macro>
|