Commit 2e3b59bf authored by Van's avatar Van

fix #17

parent 212dd23a
......@@ -17,7 +17,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<script src="https://cdn.jsdelivr.net/npm/uvstat@v1.0.1/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uvstat@v1.0.2/dist/index.min.js"></script>
<script>
var Label = {
servePath: "${servePath}",
......
......@@ -106,5 +106,8 @@ No Result, Return to <a href="${servePath}">Index</a> or <a href="https://hacpai
Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> • Solo ${version}
</div>
</div>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
<#include 'label.ftl'/>
</body>
</html>
......@@ -142,6 +142,8 @@ admin.articleList = {
that.tablePagination.updateTablePagination(articleData, pageNum,
result.pagination)
Util.uvstat.renderStat()
$('#loadMsg').text('')
},
})
......
......@@ -26,9 +26,9 @@
/* draft-list 相关操作 */
admin.draftList = {
tablePagination: new TablePaginate("draft"),
/*
* 初始化 table, pagination, comments dialog
/*
* 初始化 table, pagination, comments dialog
*/
init: function (page) {
this.tablePagination.buildTable([{
......@@ -62,14 +62,14 @@ admin.draftList = {
this.getList(page);
},
/*
/*
* 根据当前页码获取列表
* @pagNum 当前页码
*/
getList: function (pageNum) {
$("#loadMsg").text(Label.loadingLabel);
var that = this;
$.ajax({
url: Label.servePath + "/console/articles/status/unpublished/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
type: "GET",
......@@ -80,7 +80,7 @@ admin.draftList = {
$("#loadMsg").text("");
return;
}
var articles = result.articles,
articleData = [];
for (var i = 0; i < articles.length; i++) {
......@@ -91,15 +91,15 @@ admin.draftList = {
articleData[i].articleViewCount = '<span data-uvstaturl="' + Label.servePath + articles[i].articlePermalink + '">0</span>';
articleData[i].author = articles[i].authorName;
articleData[i].title = "<a class='no-underline' href='" + Label.servePath +
articles[i].articlePermalink + "' target='_blank'>" +
articles[i].articlePermalink + "' target='_blank'>" +
articles[i].articleTitle + "</a><span class='table-tag'>" + articles[i].articleTags + "</span>";
articleData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.article.get('" + articles[i].oId + "', false);\">" + Label.updateLabel + "</a> \
<a href='javascript:void(0)' onclick=\"admin.article.del('" + articles[i].oId + "', 'draft', '" + encodeURIComponent(articles[i].articleTitle) + "')\">" + Label.removeLabel + "</a> \
<a href='javascript:void(0)' onclick=\"admin.comment.open('" + articles[i].oId + "', 'draft')\">" + Label.commentLabel + "</a>";
}
that.tablePagination.updateTablePagination(articleData, pageNum, result.pagination);
Util.uvstat.renderStat()
$("#loadMsg").text("");
}
});
......@@ -107,10 +107,10 @@ admin.draftList = {
};
/*
* 注册到 admin 进行管理
* 注册到 admin 进行管理
*/
admin.register["draft-list"] = {
"obj": admin.draftList,
"init": admin.draftList.init,
"refresh": admin.draftList.getList
};
\ No newline at end of file
};
......@@ -28,13 +28,14 @@
* @static
*/
var Util = {
uvstat: undefined,
/**
* 初始化浏览数
*/
initViewCnt: function () {
const uvstat = new Uvstat({loading:'<span>0</span>'})
uvstat.setStat()
uvstat.renderStat()
Util.uvstat = new Uvstat({loading:'<span>0</span>'})
Util.uvstat.setStat()
Util.uvstat.renderStat()
},
/**
* 是否为文章页面
......@@ -106,6 +107,7 @@ var Util = {
callback: function () {
Util.parseMarkdown()
Util.parseLanguage()
Util.uvstat.renderStat()
cb && cb()
},
})
......
......@@ -325,6 +325,8 @@ var timeline = {
$(".module img").imagesLoaded(function() {
$(window).resize();
});
Util.uvstat.renderStat()
}
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment