This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
-->
|
||||
<#include "macro-head.ftl">
|
||||
<#include "macro-comments.ftl">
|
||||
<#include "../../common-template/macro-comment_script.ftl">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -107,7 +108,7 @@
|
||||
<@comments commentList=articleComments article=article></@comments>
|
||||
</div>
|
||||
<#include "footer.ftl">
|
||||
<@comment_script oId=article.oId>
|
||||
<@comment_script oId=article.oId commentable=article.commentable>
|
||||
page.tips.externalRelevantArticlesDisplayCount = "${externalRelevantArticlesDisplayCount}";
|
||||
<#if 0 != randomArticlesDisplayCount>
|
||||
page.loadRandomArticles();
|
||||
|
@@ -36,7 +36,7 @@
|
||||
<div class="comdater">
|
||||
<!--<span>TODO wptouch_moderate_comment_link(get_comment_ID())</span>-->
|
||||
${comment.commentDate2?string("yyyy-MM-dd HH:mm:ss")}
|
||||
<a rel="nofollow" href="javascript:replyTo('${comment.oId}');">${replyLabel}</a>
|
||||
<a rel="nofollow" href="javascript:page.toggleEditor('${comment.oId}', '${comment.commentName}');">${replyLabel}</a>
|
||||
</div>
|
||||
</#if>
|
||||
</div><!--end comtop-->
|
||||
|
17
mobile/js/l10n.min.js
vendored
17
mobile/js/l10n.min.js
vendored
@@ -1,18 +1 @@
|
||||
/*
|
||||
* Solo - A small and beautiful blogging system written in Java.
|
||||
* Copyright (c) 2010-2019, b3log.org & hacpai.com
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
function convertEntities(t){var e,n;if(e=function(t){if(/&[^;]+;/.test(t)){var e=document.createElement("div");return e.innerHTML=t,e.firstChild?e.firstChild.nodeValue:t}return t},"string"==typeof t)return e(t);if("object"==typeof t)for(n in t)"string"==typeof t[n]&&(t[n]=e(t[n]));return t}
|
@@ -32,148 +32,14 @@
|
||||
</#list>
|
||||
</ol>
|
||||
<#if article.commentable>
|
||||
<div id="textinputwrap">
|
||||
<div id="textinputwrap" style="margin-left: 10px">
|
||||
<div id="refresher" style="display:none;">
|
||||
<img src="${staticServePath}/skins/${skinDirName}/images/good.png" alt="checkmark" />
|
||||
<h3>${commentSuccess}</h3>
|
||||
<a href="javascript:this.location.reload();">${refresh2CComment}</a>
|
||||
</div>
|
||||
<div id="commentForm">
|
||||
<h3 id="respond">${postCommentsLabel}</h3>
|
||||
<#if !isLoggedIn>
|
||||
<p>
|
||||
<input type="text" id="commentName" size="22" tabindex="1"/>
|
||||
<label for="author">${commentNameLabel} *</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="text" id="commentEmail" size="22" tabindex="2" />
|
||||
<label for="email">${commentEmailLabel} *</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="text" id="commentURL" size="22" tabindex="3" />
|
||||
<label for="url">${commentURLLabel}</label>
|
||||
</p>
|
||||
</#if>
|
||||
<p>
|
||||
<span id="commentErrorTip" style="display:none;"></span>
|
||||
</p>
|
||||
<p><textarea id="comment" tabindex="4"></textarea></p>
|
||||
<#if !isLoggedIn>
|
||||
<p>
|
||||
<input type="text" id="commentValidate" tabindex="5" />
|
||||
<label for="url">${captchaLabel}</label>
|
||||
<img id="captcha" alt="validate" src="${servePath}/captcha" />
|
||||
</p>
|
||||
</#if>
|
||||
<p>
|
||||
<input class="reply-button" id="submitCommentButton" type="submit" onclick="page.submitComment();" value="${submmitCommentLabel}" tabindex="6" />
|
||||
<div id="loading" style="display:none">
|
||||
<img src="${staticServePath}/skins/${skinDirName}/themes/core/core-images/comment-ajax-loader.gif" alt="" /> <p>${publishing}</p>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
<textarea id="comment" rows="3" placeholder="${postCommentsLabel}" tabindex="4"></textarea>
|
||||
</div>
|
||||
</#if><!--textinputwrap div-->
|
||||
</div>
|
||||
</#macro>
|
||||
|
||||
<#macro comment_script oId>
|
||||
<script type="text/javascript" src="${staticServePath}/js/page${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
Page.prototype.submitComment = function(commentId, state) {
|
||||
if (!state) {
|
||||
state = '';
|
||||
}
|
||||
var tips = this.tips,
|
||||
type = "article";
|
||||
if (tips.externalRelevantArticlesDisplayCount === undefined) {
|
||||
type = "page";
|
||||
}
|
||||
|
||||
if (this.validateComment(state)) {
|
||||
$("#submitCommentButton" + state).attr("disabled", "disabled");
|
||||
$("#commentErrorTip" + state).show().html(this.tips.loadingLabel);
|
||||
var requestJSONObject = {
|
||||
"oId": tips.oId,
|
||||
"commentContent": $("#comment" + state).val().replace(/(^\s*)|(\s*$)/g, "")
|
||||
};
|
||||
|
||||
if (!$("#admin").data("login")) {
|
||||
requestJSONObject = {
|
||||
"oId": tips.oId,
|
||||
"commentContent": $("#comment" + state).val().replace(/(^\s*)|(\s*$)/g, ""),
|
||||
"commentEmail": $("#commentEmail" + state).val(),
|
||||
"commentURL": Util.proessURL($("#commentURL" + state).val().replace(/(^\s*)|(\s*$)/g, "")),
|
||||
"commentName": $("#commentName" + state).val().replace(/(^\s*)|(\s*$)/g, ""),
|
||||
"captcha": $("#commentValidate" + state).val()
|
||||
};
|
||||
Cookie.createCookie("commentName", requestJSONObject.commentName, 365);
|
||||
Cookie.createCookie("commentEmail", requestJSONObject.commentEmail, 365);
|
||||
Cookie.createCookie("commentURL", $("#commentURL" + state).val().replace(/(^\s*)|(\s*$)/g, ""), 365);
|
||||
}
|
||||
|
||||
if (state === "Reply") {
|
||||
requestJSONObject.commentOriginalCommentId = commentId;
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: latkeConfig.servePath + "/" + type + "/comments",
|
||||
cache: false,
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(requestJSONObject),
|
||||
success: function(result) {
|
||||
$("#submitCommentButton" + state).removeAttr("disabled");
|
||||
|
||||
if (!result.sc) {
|
||||
$("#commentValidate" + state).val("").focus();
|
||||
$("#commentErrorTip" + state).html(result.msg);
|
||||
$("#captcha" + state).attr("src", "/captcha?code=" + Math.random());
|
||||
$wpt('#commentErrorTip' + state).show();
|
||||
$wpt("#loading").fadeOut(400);
|
||||
return;
|
||||
}
|
||||
|
||||
$wpt("#commentForm").hide();
|
||||
$wpt("#loading").fadeOut(400);
|
||||
$wpt("#refresher").fadeIn(400);
|
||||
$("#comment" + state).val("");
|
||||
$("#commentValidate" + state).val("");
|
||||
$("#replyForm").remove();
|
||||
|
||||
}, // end success
|
||||
error: function() {
|
||||
} //end error
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var replyTo = function(id) {
|
||||
var commentFormHTML = "<div id='replyForm'>";
|
||||
page.addReplyForm(id, commentFormHTML, "</div>");
|
||||
};
|
||||
|
||||
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}"
|
||||
});
|
||||
|
||||
(function() {
|
||||
page.load();
|
||||
// emotions
|
||||
page.replaceCommentsEm("#commentlist .combody");
|
||||
<#nested>
|
||||
})();
|
||||
</script>
|
||||
</#macro>
|
@@ -19,6 +19,7 @@
|
||||
-->
|
||||
<#include "macro-head.ftl">
|
||||
<#include "macro-comments.ftl">
|
||||
<#include "../../common-template/macro-comment_script.ftl">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -36,6 +37,6 @@
|
||||
<@comments commentList=pageComments article=page></@comments>
|
||||
</div>
|
||||
<#include "footer.ftl">
|
||||
<@comment_script oId=page.oId></@comment_script>
|
||||
<@comment_script oId=page.oId commentable=page.commentable></@comment_script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user