fix: 修复waline最近评论未自动定位到该评论的位置上
add: 增加了检测footer被拦截出现alert提醒
This commit is contained in:
parent
5d8757120e
commit
1564a578a1
|
@ -189,7 +189,6 @@ let halo = {
|
|||
expander.addEventListener('click', prismToolsFn)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const expandCode = function () {
|
||||
|
@ -415,6 +414,7 @@ let halo = {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
const data = saveToLocal.get('power-data')
|
||||
if (data) {
|
||||
|
@ -423,7 +423,20 @@ let halo = {
|
|||
getPower()
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("power-star") && init()
|
||||
},
|
||||
|
||||
checkAd() {
|
||||
var default_enable = GLOBAL_CONFIG.source.footer.default_enable
|
||||
if (default_enable) {
|
||||
var adElement = document.getElementById("footer-banner");
|
||||
if (adElement.offsetWidth <= 0 || adElement.offsetHeight <= 0) {
|
||||
// 元素不可见,可能被拦截
|
||||
console.log("Element may be blocked by AdBlocker Ultimate");
|
||||
alert("页脚信息可能被AdBlocker Ultimate拦截,请检查广告拦截插件!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function checkOpen() {
|
||||
}
|
||||
|
||||
function checkOpen() {}
|
||||
checkOpen.toString = function () {
|
||||
this.opened = true;
|
||||
};
|
||||
|
@ -264,6 +265,7 @@ function rightMenuCommentText(txt) {
|
|||
document.getElementById("comment-tips").classList.add("show");
|
||||
}
|
||||
}
|
||||
|
||||
//替换所有内容
|
||||
function replaceAll(string, search, replace) {
|
||||
return string.split(search).join(replace);
|
||||
|
@ -317,6 +319,7 @@ function travelling() {
|
|||
renderer(json.items);
|
||||
})
|
||||
}
|
||||
|
||||
function renderer(data) {
|
||||
var linksData = data
|
||||
var name = ''
|
||||
|
@ -342,6 +345,7 @@ function travelling() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
const data = saveToLocal.get('links-data')
|
||||
if (data) {
|
||||
|
@ -350,6 +354,7 @@ function travelling() {
|
|||
getLinks()
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
}
|
||||
|
||||
|
@ -523,7 +528,8 @@ function initObserver() {
|
|||
// 页面百分比
|
||||
function percent() {
|
||||
let e = document.documentElement.scrollTop || window.pageYOffset
|
||||
, t = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - document.documentElement.clientHeight
|
||||
,
|
||||
t = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - document.documentElement.clientHeight
|
||||
, o = Math.round(e / t * 100)
|
||||
, n = document.querySelector("#percent");
|
||||
var a = window.scrollY + document.documentElement.clientHeight
|
||||
|
@ -555,6 +561,7 @@ function setBodyDataType(){
|
|||
att.value = GLOBAL_CONFIG.htmlType;
|
||||
body.setAttributeNode(att);
|
||||
}
|
||||
|
||||
function listenToPageInputPress() {
|
||||
var e = document.getElementById("toPageText")
|
||||
, t = document.getElementById("toPageButton");
|
||||
|
@ -571,6 +578,7 @@ function listenToPageInputPress() {
|
|||
}
|
||||
)))
|
||||
}
|
||||
|
||||
function initBlog() {
|
||||
// 图片主色
|
||||
GLOBAL_CONFIG.source.post.dynamicBackground && coverColor(),
|
||||
|
@ -598,7 +606,8 @@ function initBlog() {
|
|||
heo.tagPageActive(),
|
||||
initObserver(),
|
||||
checkUrlAndAddHideBanner(),
|
||||
halo.getTopSponsors()
|
||||
halo.getTopSponsors(),
|
||||
halo.checkAd()
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,10 @@
|
|||
isHome: [[${ htmlType == 'index'}]],
|
||||
copyright: undefined,
|
||||
lightbox: 'fancybox',
|
||||
lazyload: {enable: [[${theme.config.other.vanillaLazyload.enable}]], error: [[@{${theme.config.other.vanillaLazyload.errorImg}}]] },
|
||||
lazyload: {
|
||||
enable: [[${theme.config.other.vanillaLazyload.enable}]],
|
||||
error: [[@{${theme.config.other.vanillaLazyload.errorImg}}]]
|
||||
},
|
||||
isFriendLinksInFooter: [[${theme.config.footer.footer_group.enable_footer_group}]],
|
||||
loadingBox: [[${theme.config.other.loadingBoxs.loadingBoxEnable}]],
|
||||
loadProgressBar: [[${theme.config.other.loadingBoxs.loadProgressBar}]],
|
||||
|
@ -113,7 +116,6 @@
|
|||
js: [[${not #strings.isEmpty(theme.config.comments.twikoos.js) ? theme.config.comments.twikoos.js : assets_link +'/libs/twikoo/twikoo.all.min.js' }]],
|
||||
twikooUrl: "[(${theme.config.comments.twikoos.envId})]",
|
||||
accessToken: "[(${theme.config.comments.twikoos.accessToken})]",
|
||||
|
||||
},
|
||||
artalk: {
|
||||
js: [[${not #strings.isEmpty(theme.config.comments.artalks.artalkJs) ? theme.config.comments.artalks.artalkJs : assets_link +'/libs/artalk/Artalk.js' }]],
|
||||
|
@ -124,10 +126,12 @@
|
|||
waline: {
|
||||
js: [[${not #strings.isEmpty(theme.config.comments.walines.walinesJs) ? theme.config.comments.walines.walinesJs : 'https://cdn.cbd.int/@waline/client@2.15.7/dist/waline.js' }]],
|
||||
serverURL: "[(${theme.config.comments.walines.serverURL})]",
|
||||
locale: [(${not #strings.isEmpty(theme.config.comments.walines.locale) ? theme.config.comments.walines.locale : {} })]
|
||||
locale: [[${not #strings.isEmpty(theme.config.comments.walines.locale) ? theme.config.comments.walines.locale : '' }]]
|
||||
},
|
||||
},
|
||||
|
||||
footer: {
|
||||
default_enable: [[${theme.config.footer.footerContent.default_enable}]]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue