💄 🐛 Fixed the 51la widget not init error & format busuanzi value.
This commit is contained in:
parent
e0c4a0ecd4
commit
9bde077b0b
@ -34,7 +34,7 @@ NexT.boot.registerEvents = function() {
|
|||||||
NexT.boot.refresh = function() {
|
NexT.boot.refresh = function() {
|
||||||
|
|
||||||
NexT.utils.calSiteInfo();
|
NexT.utils.calSiteInfo();
|
||||||
|
|
||||||
if (!NexT.CONFIG.page.isPage) return;
|
if (!NexT.CONFIG.page.isPage) return;
|
||||||
|
|
||||||
NexT.utils.registerSidebarTOC();
|
NexT.utils.registerSidebarTOC();
|
||||||
|
@ -65,15 +65,28 @@ NexT.utils = {
|
|||||||
lastPushDate.innerText = pushDateVal;
|
lastPushDate.innerText = pushDateVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
var statistic = document.querySelectorAll('#la-siteinfo-widget span');
|
const statisWidget = document.querySelectorAll('#la-siteinfo-widget span');
|
||||||
if (statistic) {
|
if (statisWidget.length > 0) {
|
||||||
const valIds = [0,2,4,6];
|
const valIds = [0,2,4,6];
|
||||||
const domIds = ['today_site_pv', 'yesterday_site_pv', 'month_site_pv', 'total_site_pv']
|
const domIds = ['today_site_pv', 'yesterday_site_pv', 'month_site_pv', 'total_site_pv']
|
||||||
for (var i in valIds) {
|
for (var i in valIds) {
|
||||||
let pv = NexT.utils.numberFormat(statistic[valIds[i]].innerText);
|
let pv = NexT.utils.numberFormat(statisWidget[valIds[i]].innerText);
|
||||||
document.getElementById(domIds[i]).innerText = pv;
|
document.getElementById(domIds[i]).innerText = pv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(()=>{ NexT.utils.fmtBusuanzi(); }, 500);
|
||||||
|
},
|
||||||
|
|
||||||
|
fmtBusuanzi: function() {
|
||||||
|
const bszUV = document.getElementById('busuanzi_value_site_uv');
|
||||||
|
if (bszUV) {
|
||||||
|
bszUV.innerText = NexT.utils.numberFormat(bszUV.innerText);
|
||||||
|
}
|
||||||
|
const bszPV = document.getElementById('busuanzi_value_site_pv');
|
||||||
|
if (bszPV) {
|
||||||
|
bszPV.innerText = NexT.utils.numberFormat(bszPV.innerText);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
numberFormat: function(number) {
|
numberFormat: function(number) {
|
||||||
|
Loading…
Reference in New Issue
Block a user