Skip to content

Commit

Permalink
#18
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 16, 2020
1 parent 24401df commit 2498205
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/common-template/label.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.4/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uvstat@v1.0.5/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@v1.0.4/dist/index.min.js"></script>
<script>
var Label = {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/common-template/search.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
${article.articleCreateDate?string("yyyy-MM-dd")}
</time>
&nbsp;
${article.articleCommentCount} ${commentLabel}
<span data-uvstatcmt="${article.oId}">${article.articleCommentCount}</span> ${commentLabel}
&nbsp;
<span data-uvstaturl="${servePath}${article.articlePermalink}">${article.articleViewCount}</span> ${viewLabel}
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/js/admin/articleList.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ admin.articleList = {
+ articles[i].articleTitle + '</a><span class=\'table-tag\'>' +
articles[i].articleTags + '</span>'
articleData[i].date = $.bowknot.getDate(articles[i].articleCreateTime)
articleData[i].comments = articles[i].articleCommentCount
articleData[i].comments = `<span data-uvstatcmt="${articles[i].oId}">${articles[i].articleCommentCount}</span>`
articleData[i].articleViewCount = '<span data-uvstaturl="' +
Label.servePath + articles[i].articlePermalink + '">' +
articles[i].articleViewCount + '</span>'
Expand All @@ -145,6 +145,7 @@ admin.articleList = {
result.pagination)

Util.uvstat.renderStat()
Util.uvstat.renderCmtStat()

$('#loadMsg').text('')
},
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/js/admin/draftList.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ admin.draftList = {
articleData[i].tags = articles[i].articleTags
articleData[i].date = $.bowknot.getDate(
articles[i].articleCreateTime)
articleData[i].comments = articles[i].articleCommentCount
articleData[i].comments = `<span data-uvstatcmt="${articles[i].oId}">${articles[i].articleCommentCount}</span>`
articleData[i].articleViewCount = '<span data-uvstaturl="' +
Label.servePath + articles[i].articlePermalink + '">' +
articles[i].articleViewCount + '</span>'
Expand All @@ -113,6 +113,7 @@ admin.draftList = {
that.tablePagination.updateTablePagination(articleData, pageNum,
result.pagination)
Util.uvstat.renderStat()
Util.uvstat.renderCmtStat()
$('#loadMsg').text('')
},
})
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var Util = {
Util.uvstat = new Uvstat()
Util.uvstat.addStat()
Util.uvstat.renderStat()
Util.uvstat.renderCmtStat()
},
/**
* 是否为文章页面
Expand Down Expand Up @@ -109,6 +110,7 @@ var Util = {
Util.parseLanguage()
Util.uvstat.addStat()
Util.uvstat.renderStat()
Util.uvstat.renderCmtStat()
cb && cb()
},
})
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/skins/Casper/article-list.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</a>
<#if article.articleCommentCount != 0 && commentable>
<a class="item__meta" href="${servePath}${article.articlePermalink}#comments">
${article.articleCommentCount} ${commentLabel}
<span data-uvstatcmt="${article.oId}">${article.articleCommentCount}</span> ${commentLabel}
</a>
<#else>
<a class="item__meta" href="${servePath}${article.articlePermalink}">
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/skins/timeline/js/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ var timeline = {
});

Util.uvstat.renderStat()
Util.uvstat.renderCmtStat()
}
});
},
Expand Down

0 comments on commit 2498205

Please sign in to comment.