From 3c196c0cdb1a434d568f3f57493c0acb948c715e Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <1152958806@qq.com> Date: Thu, 31 Aug 2023 23:51: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/custom.js | 2 +- templates/assets/js/heo.js | 3 +++ templates/assets/zhheo/blogex.js | 39 ++++++++++++--------------- templates/modules/layouts/layout.html | 5 +--- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/templates/assets/js/custom.js b/templates/assets/js/custom.js index 1230a6c5..cf7a046a 100644 --- a/templates/assets/js/custom.js +++ b/templates/assets/js/custom.js @@ -432,7 +432,7 @@ document.addEventListener("DOMContentLoaded", () => { // flink 友链标签 customElements.define( "hao-flink", - class HaoGalleryGroup extends HTMLElement { + class HaoFlink extends HTMLElement { constructor() { super(); this.options = { diff --git a/templates/assets/js/heo.js b/templates/assets/js/heo.js index ab3e6c40..1872d21e 100644 --- a/templates/assets/js/heo.js +++ b/templates/assets/js/heo.js @@ -78,6 +78,9 @@ var heo = { } 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..96c227a8 100644 --- a/templates/assets/zhheo/blogex.js +++ b/templates/assets/zhheo/blogex.js @@ -647,24 +647,24 @@ 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.darkModeStatus(), + heo.initThemeColor(), + //隐藏加载动画 GLOBAL_CONFIG.loadingBox && heo.hideLoading(), - checkUrlAndAddHideBanner() + checkUrlAndAddHideBanner() } // 如果当前页有评论就执行函数 @@ -859,13 +859,8 @@ document.addEventListener('pjax:send', function () { heo.showLoading(); } - }) - document.addEventListener('DOMContentLoaded', function () { - //页脚友联 - if(GLOBAL_CONFIG.isFriendLinksInFooter){ - heo.addFriendLinksInFooter() - } heo.reflashEssayWaterFall() }) + diff --git a/templates/modules/layouts/layout.html b/templates/modules/layouts/layout.html index 94078fb2..42609c6a 100644 --- a/templates/modules/layouts/layout.html +++ b/templates/modules/layouts/layout.html @@ -220,10 +220,7 @@ removeLoading(); } //页脚友联 - if(GLOBAL_CONFIG.isFriendLinksInFooter){ - heo.addFriendLinksInFooter() - } - + GLOBAL_CONFIG.isFriendLinksInFooter && heo.addFriendLinksInFooter() //音乐页面切换歌曲调用 if(GLOBAL_CONFIG.isMusic){ heo.changeMusicBg(false);