From 2f543a8e35db76b86600148df9775423ca274b7f Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <1152958806@qq.com> Date: Thu, 31 Aug 2023 22:32:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B5=E8=84=9A=E5=8F=8B?= =?UTF-8?q?=E8=81=94bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/js/heo.js | 8 ++++++- templates/assets/zhheo/blogex.js | 41 +++++++++++++------------------- templates/moments.html | 1 - 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/templates/assets/js/heo.js b/templates/assets/js/heo.js index ab3e6c40..faf2bc9f 100644 --- a/templates/assets/js/heo.js +++ b/templates/assets/js/heo.js @@ -70,6 +70,10 @@ var heo = { const linksUrl = GLOBAL_CONFIG.source.links.linksUrl const links = GLOBAL_CONFIG.source.links.linksData const num = GLOBAL_CONFIG.source.links.linksNum + console.log() + if(links){ + + } var randomFriendLinks = getArrayItems(links, num); var htmlText = ''; for (let i = 0; i < randomFriendLinks.length; ++i) { @@ -77,7 +81,9 @@ var heo = { htmlText += `${item.spec.displayName}`; } htmlText += `更多` - document.getElementById("friend-links-in-footer").innerHTML = htmlText; + if(document.getElementById("friend-links-in-footer")){ + document.getElementById("friend-links-in-footer").innerHTML = htmlText; + } }, //禁止图片右键单击 diff --git a/templates/assets/zhheo/blogex.js b/templates/assets/zhheo/blogex.js index b23d7675..04ab9131 100644 --- a/templates/assets/zhheo/blogex.js +++ b/templates/assets/zhheo/blogex.js @@ -647,24 +647,25 @@ function listenToPageInputPress() { function initBlog() { // 图片主色 GLOBAL_CONFIG.source.post.dynamicBackground && coverColor(), - percent(), - heo.topCategoriesBarScroll(), - heo.initIndexEssay(), - setBodyDataType(), - listenToPageInputPress(), - heo.topPostScroll(), - heo.sayhi(), - heo.qrcodeCreate(), - //右下角 snackbar 弹窗 + percent(), + heo.topCategoriesBarScroll(), + heo.initIndexEssay(), + setBodyDataType(), + listenToPageInputPress(), + heo.topPostScroll(), + heo.sayhi(), + heo.qrcodeCreate(), + //右下角 snackbar 弹窗 GLOBAL_CONFIG.source.tool.switch && heo.hidecookie(), - heo.stopImgRightDrag(), - heo.onlyHome(), - heo.addNavBackgroundInit(), - heo.darkModeStatus(), - heo.initThemeColor(), - //隐藏加载动画 + heo.stopImgRightDrag(), + heo.onlyHome(), + heo.addNavBackgroundInit(), + heo.reflashEssayWaterFall(), + heo.darkModeStatus(), + heo.initThemeColor(), + //隐藏加载动画 GLOBAL_CONFIG.loadingBox && heo.hideLoading(), - checkUrlAndAddHideBanner() + checkUrlAndAddHideBanner() } // 如果当前页有评论就执行函数 @@ -861,11 +862,3 @@ document.addEventListener('pjax:send', function () { }) - -document.addEventListener('DOMContentLoaded', function () { - //页脚友联 - if(GLOBAL_CONFIG.isFriendLinksInFooter){ - heo.addFriendLinksInFooter() - } - heo.reflashEssayWaterFall() -}) diff --git a/templates/moments.html b/templates/moments.html index 6af2524e..33ccd50d 100644 --- a/templates/moments.html +++ b/templates/moments.html @@ -62,7 +62,6 @@ -