diff --git a/src/disqus.js b/src/disqus.js
index cc9c477..a1dd666 100644
--- a/src/disqus.js
+++ b/src/disqus.js
@@ -116,9 +116,7 @@ function DisqusJS(config) {
h = h < 10 ? (`0${h}`) : h;
let minute = date.getMinutes();
minute = minute < 10 ? (`0${minute}`) : minute;
- let second = date.getSeconds();
- second = minute < 10 ? (`0${second}`) : second;
- return `${y}-${m}-${d} ${h}:${minute}:${second}`;
+ return `${y}-${m}-${d} ${h}:${minute}`;
}
/*
@@ -231,6 +229,11 @@ function DisqusJS(config) {
if (res.code === 0 && res.response.length > 0) {
// 已获得评论列表
renderComment(res.response)
+ if (res.cursor.hasNext) {
+ // 显示 加载更多评论 按钮
+ } else {
+ // 没有更多评论了,注意确保按钮隐藏
+ }
} else if (res.code === 0 && res.response.length === 0) {
// 当前没有评论
} else {
@@ -280,7 +283,7 @@ function DisqusJS(config) {
(comment.parent ? childComments : topLevelComments)['push'](comment);
});
- var commentLists = topLevelComments.map((comment) => {
+ let commentLists = topLevelComments.map((comment) => {
return {
comment,
author: comment.author.name,
@@ -293,15 +296,88 @@ function DisqusJS(config) {
}
/*
- * parseCommentData(data) - 渲染评论列表
+ * processData(data) - 处理评论列表
+ *
+ * @param {Object} data - 解析后的评论列表 JSON
+ */
+ let processData = (data) => {
+ // 处理 Disqus Profile
+ if (data.comment.author.profileUrl) {
+ /*
+ Avatar Element
+
+
+
+
+ Author Element
+
+ */
+ data.comment.avatarEl = `
`
+ data.comment.authorEl = ` `
+ } else {
+ data.comment.avatarEl = `
`
+ data.comment.authorEl = ` `
+ }
+
+ // 处理 Admin Label
+ if (data.isPrimary) {
+ data.comment.authorEl += `${disqusjs.config.adminLabel}`;
+ }
+
+ // 处理评论嵌套级数
+ if (data.children) {
+ // 如果有子评论,设置当前评论前套数为 1
+ data.nesting = 1;
+ }
+
+ return data;
+ }
+
+ let renderPostItem = (s) => {
+ /*
+