修复:启用离屏信息和pjax后显示的标题不正确的问题

新增:支持隐藏页脚主题信息
This commit is contained in:
mjsoftware 2024-02-25 11:45:03 +08:00
parent bb5406ffd3
commit 7550d8abc3
3 changed files with 15 additions and 3 deletions

View File

@ -69,6 +69,16 @@ spec:
value: false value: false
- label: 居中 - label: 居中
value: true value: true
- $formkit: radio
name: footer_hide_theme_info
label: 页脚主题信息
value: false
help: 控制页脚主题信息“Powered by Halo & Dream”的显示或隐藏。
options:
- label: 显示
value: false
- label: 隐藏
value: true
- group: basic_style - group: basic_style
label: '基础样式' label: '基础样式'
formSchema: formSchema:

View File

@ -282,10 +282,12 @@ const commonContext = {
/* 离屏提示 */ /* 离屏提示 */
offscreenTip() { offscreenTip() {
if (Utils.isMobile() || (!DreamConfig.document_hidden_title && !DreamConfig.document_visible_title)) return if (Utils.isMobile() || (!DreamConfig.document_hidden_title && !DreamConfig.document_visible_title)) return
const originTitle = document.title // const originTitle = document.title
let originTitle = document.title
let timer = null let timer = null
document.addEventListener('visibilitychange', function () { document.addEventListener('visibilitychange', function () {
if (document.hidden) { if (document.hidden) {
originTitle = document.title
DreamConfig.document_hidden_title && (document.title = DreamConfig.document_hidden_title) DreamConfig.document_hidden_title && (document.title = DreamConfig.document_hidden_title)
clearTimeout(timer) clearTimeout(timer)
} else { } else {
@ -560,7 +562,7 @@ const commonContext = {
window.commonContext = commonContext window.commonContext = commonContext
!(function () { !(function () {
const loads = ['initCarousel', 'sparkInput', 'websiteTime', 'initComment', 'webCopyright', 'initTimeCount'] const loads = ['initCarousel', 'sparkInput', 'websiteTime', 'initComment']
const omits = ['initEffects', 'loadMaintain', 'showThemeVersion'] const omits = ['initEffects', 'loadMaintain', 'showThemeVersion']
Object.keys(commonContext).forEach( Object.keys(commonContext).forEach(

View File

@ -15,7 +15,7 @@
<span id="webCopyright" th:text="'&copy; '+${#dates.format(#dates.createNow(), 'yyyy')}+' '+ ${site.title}"></span><a <span id="webCopyright" th:text="'&copy; '+${#dates.format(#dates.createNow(), 'yyyy')}+' '+ ${site.title}"></span><a
th:if="${!#strings.isEmpty(theme.config.basic_info.record_number)}" th:if="${!#strings.isEmpty(theme.config.basic_info.record_number)}"
href="http://beian.miit.gov.cn/publish/query/indexFirst.action" target="_blank" rel="noopener noreferrer nofollow" href="http://beian.miit.gov.cn/publish/query/indexFirst.action" target="_blank" rel="noopener noreferrer nofollow"
th:text="${theme.config.basic_info.record_number}"></a><span class="footer-truncation">Powered by <a class="powered" href="https://halo.run/" target="_blank">Halo</a> & <a class="powered" href="https://github.com/nineya/halo-theme-dream2.0" target="_blank">Dream</a></span></p> th:text="${theme.config.basic_info.record_number}"></a><span th:unless="${theme.config.basic_info.footer_hide_theme_info}" class="footer-truncation">Powered by <a class="powered" href="https://halo.run/" target="_blank">Halo</a> & <a class="powered" href="https://github.com/nineya/halo-theme-dream2.0" target="_blank">Dream</a></span></p>
<p class="icon-spot" th:if="${!#strings.isEmpty(theme.config.basic_info.website_time) || theme.config.enhance.enable_busuanzi == true}"> <p class="icon-spot" th:if="${!#strings.isEmpty(theme.config.basic_info.website_time) || theme.config.enhance.enable_busuanzi == true}">
<span th:if="${!#strings.isEmpty(theme.config.basic_info.website_time)}" id="websiteDate">建站<span class="stand">00</span><span class="stand">0</span><span class="stand">0</span><span class="stand">0</span></span> <span th:if="${!#strings.isEmpty(theme.config.basic_info.website_time)}" id="websiteDate">建站<span class="stand">00</span><span class="stand">0</span><span class="stand">0</span><span class="stand">0</span></span>
<span th:if="${theme.config.enhance.enable_busuanzi == true}" class="icon-spot footer-truncation"> <span th:if="${theme.config.enhance.enable_busuanzi == true}" class="icon-spot footer-truncation">