增加卜蒜子统计
This commit is contained in:
1 parent
ee23f40735
commit
8587f80c2a
226 files changed
+258
-6138
No files matched your search
@@ -3,7 +3,7 @@
|
||||
<article style="margin-bottom: 3.5em;">
|
||||
<h1 class="post-title" itemprop="name headline">{{ .Title }}</h1>
|
||||
<div class="meta">
|
||||
作者: 小赵同学 浏览: {{ .Params.views }} 字数: {{ .WordCount }} 分类:
|
||||
作者: 小赵同学 浏览: <span id="busuanzi_value_page_uv"></span> 字数: {{ .WordCount }} 分类:
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ . }}">{{ . }}</a>
|
||||
{{ end }}
|
||||
@@ -29,9 +29,6 @@
|
||||
</div>
|
||||
{{/* 文章页面评论弹幕 */}}
|
||||
<script>
|
||||
for (let i = 0; i <= 100; i++) {
|
||||
loadBarrager();
|
||||
}
|
||||
function loadBarrager() {
|
||||
// 获取当前页面的路径
|
||||
var currentPath = "{{ .RelPermalink }}";
|
||||
@@ -49,5 +46,6 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script async src="/js/bsz.js"></script>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -0,0 +1 @@
|
||||
!function(){var e=["site_pv","site_uv","page_pv","page_uv"],t=document.currentScript,a=t.hasAttribute("pjax"),n=t.getAttribute("data-api")||"https://bsz.dusays.com:9001/api",i="busuanzi-identity",r=function(){var t=new XMLHttpRequest;t.open("POST",n,!0);var a=localStorage.getItem(i);null!=a&&t.setRequestHeader("Authorization","Bearer "+a);var r=window.location.href;0==window.location.host.indexOf("www.")&&(r=r.replace("www.","")),t.setRequestHeader("x-bsz-referer",r),t.onreadystatechange=function(){if(4===t.readyState&&200===t.status){var a=JSON.parse(t.responseText);if(!0===a.success){e.map((function(e){var t=document.getElementById("busuanzi_value_".concat(e));t&&(t.innerHTML=a.data[e])}));var n=t.getResponseHeader("Set-Bsz-Identity");null!=n&&""!=n&&localStorage.setItem(i,n)}}},t.send()};if(r(),a){var s=window.history.pushState;window.history.pushState=function(){s.apply(this,arguments),r()},window.addEventListener("popstate",(function(e){r()}),!1)}}();
|
||||
@@ -84,8 +84,6 @@ async function fetchCommentsAndCreateBarrager(path, options) {
|
||||
speed: options.speed || 10
|
||||
};
|
||||
|
||||
console.log(barragerItem.content);
|
||||
|
||||
// 发送弹幕
|
||||
barrage.start(barragerItem.content, {
|
||||
speed: barragerItem.speed,
|
||||
|
||||
@@ -199,7 +199,15 @@ document.addEventListener("pjax:complete", function () {
|
||||
});
|
||||
}
|
||||
// 重载文章弹幕
|
||||
loadBarrager();
|
||||
if(!isMobile()){
|
||||
loadBarrager();
|
||||
}
|
||||
//当前页面是否为移动端
|
||||
if (isMobile()) {
|
||||
console.log('"当前为移动端"');
|
||||
} else {
|
||||
console.log('"当前为电脑端"');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user