⚡ 🐛 Fixed the 51la widget load data issue.
This commit is contained in:
parent
0d1b00f7b0
commit
ac712b9277
@ -24,13 +24,11 @@
|
|||||||
.search-popup {
|
.search-popup {
|
||||||
background: var(--card-bg-color);
|
background: var(--card-bg-color);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
height: 60%;
|
height: 65%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
transform: scale(0);
|
transform: scale(0);
|
||||||
transition: transform .4s;
|
transition: transform .4s;
|
||||||
width: 700px;
|
width: 700px;
|
||||||
//display: flex;
|
|
||||||
//flex-wrap: wrap;
|
|
||||||
|
|
||||||
.search-active & {
|
.search-active & {
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
@ -77,10 +75,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.search-result-container {
|
.search-result-container {
|
||||||
/* height: calc(100% - 65px);
|
height: calc(100% - 55px);
|
||||||
@include mobile() {
|
|
||||||
height: calc(100% - 105px);
|
|
||||||
} */
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 0px 25px;
|
padding: 0px 25px;
|
||||||
}
|
}
|
||||||
@ -94,28 +89,23 @@
|
|||||||
|
|
||||||
.search-meta-info {
|
.search-meta-info {
|
||||||
height: 26px;
|
height: 26px;
|
||||||
|
display: flex;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
|
|
||||||
.search-hit-stats {
|
.search-hit-stats {
|
||||||
font-size: $font-size-smaller;
|
font-size: $font-size-smaller;
|
||||||
|
width: 65%;
|
||||||
padding: 2px 8px;
|
padding: 2px 8px;
|
||||||
float: left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-vendor {
|
.search-vendor {
|
||||||
|
width: 34%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: $font-size-small;
|
font-size: $font-size-small;
|
||||||
@include mobile() {
|
|
||||||
font-size: $font-size-smaller;
|
|
||||||
}
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
float: right;
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 68px;
|
width: 68px;
|
||||||
@include mobile() {
|
|
||||||
width: 48px;
|
|
||||||
}
|
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
display: inline;
|
display: inline;
|
||||||
|
@ -49,7 +49,7 @@ NexT.boot.registerEvents = function() {
|
|||||||
|
|
||||||
NexT.boot.refresh = function() {
|
NexT.boot.refresh = function() {
|
||||||
|
|
||||||
NexT.utils.calSiteInfo();
|
NexT.utils.fmtSiteInfo();
|
||||||
|
|
||||||
if (!NexT.CONFIG.page.isPage) return;
|
if (!NexT.CONFIG.page.isPage) return;
|
||||||
|
|
||||||
|
5
assets/js/third-party/others/lawidget.js
vendored
5
assets/js/third-party/others/lawidget.js
vendored
@ -10,7 +10,8 @@ NexT.plugins.others.lawidget = function() {
|
|||||||
crossorigin: 'anonymous',
|
crossorigin: 'anonymous',
|
||||||
charset: 'UTF-8',
|
charset: 'UTF-8',
|
||||||
defer: true
|
defer: true
|
||||||
}
|
},
|
||||||
});
|
parentNode: document.getElementById('la-siteinfo-widget')
|
||||||
|
}, NexT.utils.fmtLaWidget());
|
||||||
});
|
});
|
||||||
}
|
}
|
@ -45,7 +45,7 @@ NexT.utils = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
calSiteInfo: function () {
|
fmtSiteInfo: function () {
|
||||||
const runtimeCount = document.getElementById('runTimes');
|
const runtimeCount = document.getElementById('runTimes');
|
||||||
if (runtimeCount) {
|
if (runtimeCount) {
|
||||||
const publishDate = runtimeCount.getAttribute('data-publishDate');
|
const publishDate = runtimeCount.getAttribute('data-publishDate');
|
||||||
@ -86,29 +86,33 @@ NexT.utils = {
|
|||||||
const pushDateVal = this.diffDate(lastPushDate.getAttribute('data-lastPushDate'), 1);
|
const pushDateVal = this.diffDate(lastPushDate.getAttribute('data-lastPushDate'), 1);
|
||||||
lastPushDate.innerText = pushDateVal;
|
lastPushDate.innerText = pushDateVal;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
const statisWidget = document.querySelectorAll('#la-siteinfo-widget span');
|
fmtLaWidget: function(){
|
||||||
if (statisWidget.length > 0) {
|
setTimeout(function(){
|
||||||
const valIds = [0, 2, 4, 6];
|
const laWidget = document.querySelectorAll('#la-siteinfo-widget span');
|
||||||
const domIds = ['today_site_pv', 'yesterday_site_pv', 'month_site_pv', 'total_site_pv']
|
if (laWidget.length > 0) {
|
||||||
for (var i in valIds) {
|
const valIds = [0, 2, 4, 6];
|
||||||
let pv = this.numberFormat(statisWidget[valIds[i]].innerText);
|
const domIds = ['today_site_pv', 'yesterday_site_pv', 'month_site_pv', 'total_site_pv']
|
||||||
document.getElementById(domIds[i]).innerText = pv;
|
for (var i in valIds) {
|
||||||
|
let pv = NexT.utils.numberFormat(laWidget[valIds[i]].innerText);
|
||||||
|
document.getElementById(domIds[i]).innerText = pv;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}, 800);
|
||||||
|
|
||||||
setTimeout(() => { this.fmtBusuanzi(); }, 500);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
fmtBusuanzi: function () {
|
fmtBusuanzi: function () {
|
||||||
const bszUV = document.getElementById('busuanzi_value_site_uv');
|
setTimeout(function(){
|
||||||
if (bszUV) {
|
const bszUV = document.getElementById('busuanzi_value_site_uv');
|
||||||
bszUV.innerText = this.numberFormat(bszUV.innerText);
|
if (bszUV) {
|
||||||
}
|
bszUV.innerText = NexT.utils.numberFormat(bszUV.innerText);
|
||||||
const bszPV = document.getElementById('busuanzi_value_site_pv');
|
}
|
||||||
if (bszPV) {
|
const bszPV = document.getElementById('busuanzi_value_site_pv');
|
||||||
bszPV.innerText = this.numberFormat(bszPV.innerText);
|
if (bszPV) {
|
||||||
}
|
bszPV.innerText = NexT.utils.numberFormat(bszPV.innerText);
|
||||||
|
}
|
||||||
|
}, 800);
|
||||||
},
|
},
|
||||||
|
|
||||||
numberFormat: function (number) {
|
numberFormat: function (number) {
|
||||||
|
@ -4,8 +4,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
script.charset = "UTF-8";
|
script.charset = "UTF-8";
|
||||||
script.src = "{{ .Site.Data.resources.analytics.busuanzi }}";
|
script.src = "{{ .Site.Data.resources.analytics.busuanzi }}";
|
||||||
script.async = "true"
|
script.async = false
|
||||||
|
script.defer = true
|
||||||
|
|
||||||
document.head.appendChild(script);
|
document.head.appendChild(script);
|
||||||
|
script.onload = function() {
|
||||||
|
NexT.utils.fmtBusuanzi();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -114,6 +114,11 @@
|
|||||||
{{ $config = merge $config (dict "addthis" $addthis) }}
|
{{ $config = merge $config (dict "addthis" $addthis) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ with .Site.Params.siteState.statistic }}
|
||||||
|
{{ $statis := dict "statis" . }}
|
||||||
|
{{ $config = merge $config $statis }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ with .Site.Params.analytics.laId }}
|
{{ with .Site.Params.analytics.laId }}
|
||||||
{{ $lawidget := dict
|
{{ $lawidget := dict
|
||||||
"js" $.Site.Data.resources.analytics.laWidget
|
"js" $.Site.Data.resources.analytics.laWidget
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq .Site.Params.siteState.statistic.plugin "51la" }}
|
{{- if eq .Site.Params.siteState.statistic.plugin "51la" }}
|
||||||
|
<div id="la-siteinfo-widget" style="display: none;"></div>
|
||||||
<div class="siteinfo-item">
|
<div class="siteinfo-item">
|
||||||
<div class="item-name">
|
<div class="item-name">
|
||||||
<i class="fa fa-user-plus"></i>{{ T "SiteInfoItems.todayViews" }}
|
<i class="fa fa-user-plus"></i>{{ T "SiteInfoItems.todayViews" }}
|
||||||
|
Loading…
Reference in New Issue
Block a user