diff --git a/404.php b/404.php index 4c8792f..07a296e 100644 --- a/404.php +++ b/404.php @@ -18,23 +18,42 @@ document.addEventListener('DOMContentLoaded', function() { var countdown = 5; // 设置倒计时时间(秒) var countdownElement = document.getElementById('time-count-down'); - + // 检查是否在 PJAX 环境中 + var isPjax = typeof window.Pjax !== 'undefined' || + (typeof jQuery !== 'undefined' && jQuery.pjax); // 更新倒计时显示 function updateCountdown() { countdownElement.textContent = countdown; - countdown--; - + countdown--; if (countdown < 0) { // 倒计时结束,跳转到首页 - window.location.href = "options->siteUrl(); ?>"; + var homeUrl = "options->siteUrl(); ?>"; + + if (isPjax) { + // 使用 PJAX 方式跳转 + if (typeof window.Pjax !== 'undefined') { + // 使用原生 PJAX + var pjax = new Pjax(); + pjax.loadUrl(homeUrl); + } else if (typeof jQuery !== 'undefined' && jQuery.pjax) { + // 使用 jQuery PJAX + $.pjax({url: homeUrl, container: '[data-pjax-container]'}); + } + } else { + // 普通跳转 + window.location.href = homeUrl; + } } else { // 继续倒计时 setTimeout(updateCountdown, 1000); } } - // 开始倒计时 updateCountdown(); + // 如果是 PJAX 加载,需要手动执行一些初始化 + if (isPjax && typeof window.puockInit !== 'undefined') { + window.puockInit(); + } }); need('footer.php'); ?> diff --git a/README.MD b/README.MD index c4a8400..6a9a8ec 100644 --- a/README.MD +++ b/README.MD @@ -20,6 +20,16 @@ 4. 主题部分功能需要安装插件`Puock`。项目地址: [Puock Plugin](https://github.com/jkjoy/typecho-plugin-puock) 5. 友情链接功能需要使用插件`Links`。项目地址: [Links Plugin](https://file.imsun.org/upload/2025-06/Links-1.2.7.zip),首页友情链接需要在`友链分类`中添加分类`home`。 -### 主题配置 +### 更新 -- 全部标签页面需要启用php的 `iconv` 扩展 +- 2025.07.05 + - 1.1.3 + - 兼容typecho 1.3.0版本 + - 修复pjax黑暗模式下闪烁问题 + - 修复说说页面的pjax加载问题 + - 修复上一篇与下一篇文章的链接 + - 增加归属地显示设置 + - 增加系统显示设置 + - 增加浏览器信息显示设置 + - 修复pjax模式下的404跳转 + \ No newline at end of file diff --git a/comments.php b/comments.php index ca08f4a..e3aae67 100644 --- a/comments.php +++ b/comments.php @@ -180,10 +180,11 @@