登录用户评论获取用户名方式修改
This commit is contained in:
parent
14523d121d
commit
a9c4398824
@ -144,7 +144,7 @@
|
|||||||
|
|
||||||
var commentHTML = '<div id="' + result.oId
|
var commentHTML = '<div id="' + result.oId
|
||||||
+ '" class="comment-body ' + oddEven + '"><div class="comment-panel"><div class="left comment-author">'
|
+ '" class="comment-body ' + oddEven + '"><div class="comment-panel"><div class="left comment-author">'
|
||||||
+ '<img alt="' + $("#commentName" + state).val() + '" src="' + result.commentThumbnailURL
|
+ '<img alt="' + result.userName + '" src="' + result.commentThumbnailURL
|
||||||
+ '"/></div><div class="left comment-info">' + result.replyNameHTML;
|
+ '"/></div><div class="left comment-info">' + result.replyNameHTML;
|
||||||
|
|
||||||
if (state !== "") {
|
if (state !== "") {
|
||||||
|
@ -159,7 +159,7 @@
|
|||||||
commentHTML += '<div class="right">' + result.commentDate
|
commentHTML += '<div class="right">' + result.commentDate
|
||||||
+ ' <a class="no-underline" href="javascript:replyTo(\'' + result.oId + '\');">${replyLabel}</a>'
|
+ ' <a class="no-underline" href="javascript:replyTo(\'' + result.oId + '\');">${replyLabel}</a>'
|
||||||
+ '</div><div class="clear"></div></div><div class="comment-body">'
|
+ '</div><div class="clear"></div></div><div class="comment-body">'
|
||||||
+ '<div class="left comment-picture"><img alt="' + $("#commentName" + state).val()
|
+ '<div class="left comment-picture"><img alt="' + result.userName
|
||||||
+ '" src="' + result.commentThumbnailURL + '"/>'
|
+ '" src="' + result.commentThumbnailURL + '"/>'
|
||||||
+ '</div><div class="comment-content">' +
|
+ '</div><div class="comment-content">' +
|
||||||
Util.replaceEmString($("#comment" + state).val().replace(/</g, "<").replace(/>/g, ">").replace(/\n/g,"<br/>"))
|
Util.replaceEmString($("#comment" + state).val().replace(/</g, "<").replace(/>/g, ">").replace(/\n/g,"<br/>"))
|
||||||
|
@ -155,7 +155,7 @@
|
|||||||
|
|
||||||
var addComment = function (result, state) {
|
var addComment = function (result, state) {
|
||||||
var commentHTML = '<div id="' + result.oId + '">'
|
var commentHTML = '<div id="' + result.oId + '">'
|
||||||
+ '<img class="left" alt="' + $("#commentName" + state).val() + '" src="' + result.commentThumbnailURL
|
+ '<img class="left" alt="' + result.userName + '" src="' + result.commentThumbnailURL
|
||||||
+ '"/><div class="comment-panel left"><div class="comment-top">' + result.replyNameHTML;
|
+ '"/><div class="comment-panel left"><div class="comment-top">' + result.replyNameHTML;
|
||||||
|
|
||||||
if (state !== "") {
|
if (state !== "") {
|
||||||
|
15
ease/css/ease.min.css
vendored
15
ease/css/ease.min.css
vendored
@ -1,3 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
html,body,div,ul,li{margin:0;padding:0}
|
html,body,div,ul,li{margin:0;padding:0}
|
||||||
body{font-family:Verdana,arial,'\5fae\8f6f\96c5\9ed1';font-size:12px;background-color:#fcfcfc}
|
body{font-family:Verdana,arial,'\5fae\8f6f\96c5\9ed1';font-size:12px;background-color:#fcfcfc}
|
||||||
::selection{background-color:#d5d5d5;color:#fcfcfc}
|
::selection{background-color:#d5d5d5;color:#fcfcfc}
|
||||||
|
15
ease/js/ease.min.js
vendored
15
ease/js/ease.min.js
vendored
File diff suppressed because one or more lines are too long
@ -124,14 +124,18 @@
|
|||||||
|
|
||||||
var addComment = function(result, state) {
|
var addComment = function(result, state) {
|
||||||
var commentHTML = '<div id="' + result.oId + '"><img class="comment-header" \
|
var commentHTML = '<div id="' + result.oId + '"><img class="comment-header" \
|
||||||
title="' + $("#commentName" + state).val() + '" alt="' + $("#commentName" + state).val() +
|
title="' + result.userName + '" alt="' + result.userName +
|
||||||
'" src="' + result.commentThumbnailURL + '"/><div class="comment-panel"><div class="left">' + result.replyNameHTML;
|
'" src="' + result.commentThumbnailURL
|
||||||
|
+ '"/><div class="comment-panel"><div class="left">' + result.replyNameHTML;
|
||||||
|
|
||||||
if (state !== "") {
|
if (state !== "") {
|
||||||
var commentOriginalCommentName = $("#" + page.currentCommentId + " .comment-panel>.left a").first().text();
|
var commentOriginalCommentName = $("#" + page.currentCommentId
|
||||||
commentHTML += ' @ <a href="${servePath}' + result.commentSharpURL.split("#")[0] + '#' + page.currentCommentId + '"'
|
+ " .comment-panel>.left a").first().text();
|
||||||
|
commentHTML += ' @ <a href="${servePath}'
|
||||||
|
+ result.commentSharpURL.split("#")[0] + '#' + page.currentCommentId + '"'
|
||||||
+ 'onmouseover="page.showComment(this, \'' + page.currentCommentId + '\', 20);"'
|
+ 'onmouseover="page.showComment(this, \'' + page.currentCommentId + '\', 20);"'
|
||||||
+ 'onmouseout="page.hideComment(\'' + page.currentCommentId + '\')">' + commentOriginalCommentName + '</a>';
|
+ 'onmouseout="page.hideComment(\'' + page.currentCommentId + '\')">'
|
||||||
|
+ commentOriginalCommentName + '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
commentHTML += '</div><div class="right ft-gray">' + result.commentDate.substring(2, 16)
|
commentHTML += '</div><div class="right ft-gray">' + result.commentDate.substring(2, 16)
|
||||||
@ -141,7 +145,7 @@
|
|||||||
+ '</div></div><span class="clear"></span></div>';
|
+ '</div></div><span class="clear"></span></div>';
|
||||||
|
|
||||||
return commentHTML;
|
return commentHTML;
|
||||||
}
|
};
|
||||||
|
|
||||||
var replyTo = function(id) {
|
var replyTo = function(id) {
|
||||||
var commentFormHTML = "<table class='form' id='replyForm'>";
|
var commentFormHTML = "<table class='form' id='replyForm'>";
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
var addComment = function (result, state) {
|
var addComment = function (result, state) {
|
||||||
var commentHTML = '<div id="' + result.oId
|
var commentHTML = '<div id="' + result.oId
|
||||||
+ '" class="comment-body"><div class="comment-panel"><div class="left comment-author">'
|
+ '" class="comment-body"><div class="comment-panel"><div class="left comment-author">'
|
||||||
+ '<div><img alt="' + $("#commentName" + state).val() +
|
+ '<div><img alt="' + result.userName +
|
||||||
'" src="' + result.commentThumbnailURL + '"/></div>' + result.replyNameHTML;
|
'" src="' + result.commentThumbnailURL + '"/></div>' + result.replyNameHTML;
|
||||||
|
|
||||||
commentHTML += '</div><div class="left comment-info"><div class="left">' + result.commentDate;
|
commentHTML += '</div><div class="left comment-info"><div class="left">' + result.commentDate;
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
var addComment = function (result, state) {
|
var addComment = function (result, state) {
|
||||||
var commentHTML = '<div id="' + result.oId
|
var commentHTML = '<div id="' + result.oId
|
||||||
+ '" class="comment-body"><div class="comment-panel"><div class="left comment-author">'
|
+ '" class="comment-body"><div class="comment-panel"><div class="left comment-author">'
|
||||||
+ '<div><img alt="' + $("#commentName" + state).val() + '" src="' +
|
+ '<div><img alt="' + result.userName + '" src="' +
|
||||||
result.commentThumbnailURL + '"/></div>' + result.replyNameHTML;
|
result.commentThumbnailURL + '"/></div>' + result.replyNameHTML;
|
||||||
|
|
||||||
commentHTML += '</div><div class="left comment-info"><div class="left">' + result.commentDate;
|
commentHTML += '</div><div class="left comment-info"><div class="left">' + result.commentDate;
|
||||||
|
@ -143,7 +143,7 @@
|
|||||||
var addComment = function(result, state) {
|
var addComment = function(result, state) {
|
||||||
$("#comments").prev().html("<h3>${commentLabel}</h3>");
|
$("#comments").prev().html("<h3>${commentLabel}</h3>");
|
||||||
var commentHTML = '<div id="' + result.oId + '" class="fn-clear"><img ' +
|
var commentHTML = '<div id="' + result.oId + '" class="fn-clear"><img ' +
|
||||||
'title="' + $("#commentName" + state).val() + '" alt="' + $("#commentName" + state).val() +
|
'alt="' + result.userName +
|
||||||
'" src="' + result.commentThumbnailURL + '"/>' +
|
'" src="' + result.commentThumbnailURL + '"/>' +
|
||||||
'<div class="comment-main"><div class="fn-clear">' + result.replyNameHTML;
|
'<div class="comment-main"><div class="fn-clear">' + result.replyNameHTML;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul id="head-pages">
|
<ul id="head-pages">
|
||||||
<li><a href="${servePath}/admin-index.do#main"><img src="${staticServePath}/skins/${skinDirName}/images/icon-pool/Home.png" alt=""/>Admin</a></li>
|
<li id="admin" data-login="${isLoggedIn?string}"><a href="${servePath}/admin-index.do#main"><img src="${staticServePath}/skins/${skinDirName}/images/icon-pool/Home.png" alt=""/>Admin</a></li>
|
||||||
<#list pageNavigations as page>
|
<#list pageNavigations as page>
|
||||||
<li><a href="${page.pagePermalink}" target="${page.pageOpenTarget}"><img src="${staticServePath}/skins/${skinDirName}/images/icon-pool/Apps.png" alt=""/>${page.pageTitle}</a></li>
|
<li><a href="${page.pagePermalink}" target="${page.pageOpenTarget}"><img src="${staticServePath}/skins/${skinDirName}/images/icon-pool/Apps.png" alt=""/>${page.pageTitle}</a></li>
|
||||||
</#list>
|
</#list>
|
||||||
|
@ -90,94 +90,97 @@
|
|||||||
<#macro comment_script oId>
|
<#macro comment_script oId>
|
||||||
<script type="text/javascript" src="${staticServePath}/js/page${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
|
<script type="text/javascript" src="${staticServePath}/js/page${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
Page.prototype.submitComment = function (commentId, state) {
|
Page.prototype.submitComment = function(commentId, state) {
|
||||||
if (!state) {
|
if (!state) {
|
||||||
state = '';
|
state = '';
|
||||||
}
|
}
|
||||||
var tips = this.tips,
|
var tips = this.tips,
|
||||||
type = "article";
|
type = "article";
|
||||||
if (tips.externalRelevantArticlesDisplayCount === undefined) {
|
if (tips.externalRelevantArticlesDisplayCount === undefined) {
|
||||||
type = "page";
|
type = "page";
|
||||||
}
|
|
||||||
|
|
||||||
if (this.validateComment(state)) {
|
|
||||||
$("#submitCommentButton" + state).attr("disabled", "disabled");
|
|
||||||
$("#commentErrorTip" + state).html(this.tips.loadingLabel);
|
|
||||||
|
|
||||||
var 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()
|
|
||||||
};
|
|
||||||
|
|
||||||
if (state === "Reply") {
|
|
||||||
requestJSONObject.commentOriginalCommentId = commentId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$wpt("#loading").fadeIn(400);
|
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, "")
|
||||||
|
};
|
||||||
|
|
||||||
$.ajax({
|
if (!$("#admin").data("login")) {
|
||||||
type: "POST",
|
requestJSONObject = {
|
||||||
url: "/add-" + type + "-comment.do",
|
"oId": tips.oId,
|
||||||
contentType: "application/json",
|
"commentContent": $("#comment" + state).val().replace(/(^\s*)|(\s*$)/g, ""),
|
||||||
data: JSON.stringify(requestJSONObject),
|
"commentEmail": $("#commentEmail" + state).val(),
|
||||||
success: function(result){
|
"commentURL": Util.proessURL($("#commentURL" + state).val().replace(/(^\s*)|(\s*$)/g, "")),
|
||||||
$("#submitCommentButton" + state).removeAttr("disabled");
|
"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 (!result.sc) {
|
if (state === "Reply") {
|
||||||
$("#commentValidate" + state).val("").focus();
|
requestJSONObject.commentOriginalCommentId = commentId;
|
||||||
$("#commentErrorTip" + state).html(result.msg);
|
}
|
||||||
$("#captcha" + state).attr("src", "/captcha.do?code=" + Math.random());
|
$.ajax({
|
||||||
$wpt('#commentErrorTip' + state).show();
|
type: "POST",
|
||||||
|
url: latkeConfig.servePath + "/add-" + type + "-comment.do",
|
||||||
|
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.do?code=" + Math.random());
|
||||||
|
$wpt('#commentErrorTip' + state).show();
|
||||||
|
$wpt("#loading").fadeOut(400);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$wpt("#commentForm").hide();
|
||||||
$wpt("#loading").fadeOut(400);
|
$wpt("#loading").fadeOut(400);
|
||||||
return;
|
$wpt("#refresher").fadeIn(400);
|
||||||
}
|
$("#comment" + state).val("");
|
||||||
|
$("#commentValidate" + state).val("");
|
||||||
|
$("#replyForm").remove();
|
||||||
|
|
||||||
$wpt("#commentForm").hide();
|
}, // end success
|
||||||
$wpt("#loading").fadeOut(400);
|
error: function() {
|
||||||
$wpt("#refresher").fadeIn(400);
|
} //end error
|
||||||
$("#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>");
|
||||||
|
};
|
||||||
|
|
||||||
Cookie.createCookie("commentName", requestJSONObject.commentName, 365);
|
var page = new Page({
|
||||||
Cookie.createCookie("commentEmail", requestJSONObject.commentEmail, 365);
|
"nameTooLongLabel": "${nameTooLongLabel}",
|
||||||
Cookie.createCookie("commentURL", $("#commentURL" + state).val().replace(/(^\s*)|(\s*$)/g, ""), 365);
|
"mailCannotEmptyLabel": "${mailCannotEmptyLabel}",
|
||||||
}
|
"mailInvalidLabel": "${mailInvalidLabel}",
|
||||||
};
|
"commentContentCannotEmptyLabel": "${commentContentCannotEmptyLabel}",
|
||||||
|
"captchaCannotEmptyLabel": "${captchaCannotEmptyLabel}",
|
||||||
|
"loadingLabel": "${loadingLabel}",
|
||||||
|
"oId": "${oId}",
|
||||||
|
"skinDirName": "${skinDirName}",
|
||||||
|
"blogHost": "${blogHost}",
|
||||||
|
"randomArticles1Label": "${randomArticles1Label}",
|
||||||
|
"externalRelevantArticles1Label": "${externalRelevantArticles1Label}"
|
||||||
|
});
|
||||||
|
|
||||||
var replyTo = function (id) {
|
(function() {
|
||||||
var commentFormHTML = "<div id='replyForm'>";
|
page.load();
|
||||||
page.addReplyForm(id, commentFormHTML, "</div>");
|
// emotions
|
||||||
};
|
page.replaceCommentsEm("#commentlist .combody");
|
||||||
|
|
||||||
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>
|
<#nested>
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
@ -132,7 +132,7 @@
|
|||||||
oddEven = "comment-even";
|
oddEven = "comment-even";
|
||||||
}
|
}
|
||||||
var commentHTML = '<div id="' + result.oId + '" class="oddEven"><img class="comment-header" \
|
var commentHTML = '<div id="' + result.oId + '" class="oddEven"><img class="comment-header" \
|
||||||
title="' + $("#commentName" + state).val() + '" alt="' + $("#commentName" + state).val() +
|
alt="' + result.userName +
|
||||||
'" src="' + result.commentThumbnailURL + '"/><div class="comment-panel"><div class="left">' + result.replyNameHTML;
|
'" src="' + result.commentThumbnailURL + '"/><div class="comment-panel"><div class="left">' + result.replyNameHTML;
|
||||||
|
|
||||||
if (state !== "") {
|
if (state !== "") {
|
||||||
|
@ -136,7 +136,7 @@
|
|||||||
var addComment = function (result, state) {
|
var addComment = function (result, state) {
|
||||||
var commentHTML = '<div id="' + result.oId
|
var commentHTML = '<div id="' + result.oId
|
||||||
+ '" class="comment-body"><div class="comment-panel"><div class="left comment-author">'
|
+ '" class="comment-body"><div class="comment-panel"><div class="left comment-author">'
|
||||||
+ '<div><img alt="' + $("#commentName" + state).val() +
|
+ '<div><img alt="' + result.userName +
|
||||||
'" src="' + result.commentThumbnailURL + '"/></div>' + result.replyNameHTML;
|
'" src="' + result.commentThumbnailURL + '"/></div>' + result.replyNameHTML;
|
||||||
|
|
||||||
commentHTML += '</div><div class="left comment-info"><div class="left">' + result.commentDate;
|
commentHTML += '</div><div class="left comment-info"><div class="left">' + result.commentDate;
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
|
|
||||||
var addComment = function(result, state) {
|
var addComment = function(result, state) {
|
||||||
var commentHTML = '<li id="' + result.oId + '"><img \
|
var commentHTML = '<li id="' + result.oId + '"><img \
|
||||||
title="' + $("#commentName" + state).val() + '" alt="' + $("#commentName" + state).val() +
|
alt="' + result.userName +
|
||||||
'" src="' + result.commentThumbnailURL + '"/><div><span class="author">' + result.replyNameHTML;
|
'" src="' + result.commentThumbnailURL + '"/><div><span class="author">' + result.replyNameHTML;
|
||||||
|
|
||||||
if (state !== "") {
|
if (state !== "") {
|
||||||
|
@ -159,7 +159,7 @@
|
|||||||
|
|
||||||
commentHTML += '<div class="right">' + result.commentDate
|
commentHTML += '<div class="right">' + result.commentDate
|
||||||
+ ' <a rel="nofollow" class="no-underline" href="javascript:replyTo(\'' + result.oId + '\');">${replyLabel}</a>'
|
+ ' <a rel="nofollow" class="no-underline" href="javascript:replyTo(\'' + result.oId + '\');">${replyLabel}</a>'
|
||||||
+ '</div><div class="clear"></div></div><div><img alt="' + $("#commentName" + state).val()
|
+ '</div><div class="clear"></div></div><div><img alt="' + result.userName
|
||||||
+ '" src="' + result.commentThumbnailURL + '" class="comment-picture left"/>'
|
+ '" src="' + result.commentThumbnailURL + '" class="comment-picture left"/>'
|
||||||
+ '<div class="comment-content">'
|
+ '<div class="comment-content">'
|
||||||
+ Util.replaceEmString($("#comment" + state).val().replace(/</g, "<").replace(/>/g, ">").replace(/\n/g,"<br/>"))
|
+ Util.replaceEmString($("#comment" + state).val().replace(/</g, "<").replace(/>/g, ">").replace(/\n/g,"<br/>"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user