This commit is contained in:
Van
2018-12-07 22:37:10 +08:00
parent ccb20d81c5
commit a6be574a8a
13 changed files with 550 additions and 301 deletions

View File

@@ -18,85 +18,78 @@
-->
<#macro comments commentList article>
<div class="comments__item">
<div class="comments__meta comments__meta--only">${commentLabel}</div>
<div class="comments__title">
${commentLabel}
</div>
<ul class="comments" id="comments">
<ul id="comments">
<#list commentList as comment>
<#include 'common-comment.ftl'/>
</#list>
</ul>
<#if article.commentable>
<div class="comments__item">
<div class="comments__meta">
${postCommentsLabel}
</div>
<div class="comments__content">
<table id="commentForm" class="form">
<tbody>
<#if !isLoggedIn>
<tr>
<td>
<input placeholder="${commentNameLabel}" type="text" id="commentName"/>
</td>
</tr>
<tr>
<td>
<input placeholder="${commentEmailLabel}" type="email" id="commentEmail"/>
</td>
</tr>
<tr>
<td>
<input placeholder="${commentURLLabel}" type="url" id="commentURL"/>
</td>
</tr>
</#if>
<tr>
<td id="emotions" class="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>
<td>
<textarea rows="5" cols="96" id="comment"></textarea>
</td>
</tr>
<#if !isLoggedIn>
<tr>
<td>
<input style="width:50%" placeholder="${captchaLabel}" type="text"
id="commentValidate"/>
<img class="comments__captcha" id="captcha" alt="validate" src="${servePath}/captcha"/>
</td>
</tr>
</#if>
<tr>
<td colspan="2" align="right">
<span class="ft__red" id="commentErrorTip"></span>
<span class="breadcrumb fn__pointer fn__none" id="cancelCommentButton" onclick="$('#replyForm').remove();page.currentCommentId = ''">${cancelLabel}</span>
<button class="btn tag" id="submitCommentButton" onclick="page.submitComment();">${submmitCommentLabel}</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<table id="commentForm" class="form">
<tbody>
<#if !isLoggedIn>
<tr>
<td>
<input placeholder="${commentNameLabel}" type="text" id="commentName"/>
</td>
</tr>
<tr>
<td>
<input placeholder="${commentEmailLabel}" type="email" id="commentEmail"/>
</td>
</tr>
<tr>
<td>
<input placeholder="${commentURLLabel}" type="url" id="commentURL"/>
</td>
</tr>
</#if>
<tr>
<td id="emotions" class="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>
<td>
<textarea rows="5" cols="96" id="comment"></textarea>
</td>
</tr>
<#if !isLoggedIn>
<tr>
<td>
<input style="width:50%" placeholder="${captchaLabel}" type="text"
id="commentValidate"/>
<img class="comments__captcha" id="captcha" alt="validate" src="${servePath}/captcha"/>
</td>
</tr>
</#if>
<tr>
<td colspan="2" align="right">
<span class="ft__red" id="commentErrorTip"></span>
<button class="fn__none" id="cancelCommentButton" onclick="$('#replyForm').remove();page.currentCommentId = ''">${cancelLabel}</button>
<button id="submitCommentButton" onclick="page.submitComment();">${submmitCommentLabel}</button>
</td>
</tr>
</tbody>
</table>
</#if>
</#macro>
@@ -122,8 +115,11 @@
page.addReplyForm(id, commentFormHTML)
};
(function () {
page.load()
Skin.initArticle()
page.load({
language: {
theme: 'tomorrow-night-eighties'
}
})
// emotions
page.replaceCommentsEm('#comments .content-reset')
<#nested>