hexo-theme-shokax 0.4.15 → 0.4.16
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -191,7 +191,7 @@ hexo.extend.generator.register("script", function(locals) {
|
|
191
191
|
res.push({
|
192
192
|
path: theme.js + "/cf-patch.js",
|
193
193
|
data: function() {
|
194
|
-
return
|
194
|
+
return import_node_fs.default.readFileSync("./cf-patch.js", { encoding: "utf-8" });
|
195
195
|
}
|
196
196
|
});
|
197
197
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// rocket-loader & Auto minify(cloudflare) 补丁
|
2
2
|
// cloudflare 的上述功能会导致DOMContentLoaded事件无法触发,此补丁会将DOMContentLoaded重定向为load事件
|
3
|
-
function cloudflareInit () {
|
3
|
+
export function cloudflareInit () {
|
4
4
|
let inCloudFlare = true
|
5
5
|
window.addEventListener('DOMContentLoaded', function () {
|
6
6
|
inCloudFlare = false
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import domInit from './domInit'
|
2
2
|
import { pjaxReload, siteRefresh } from './refresh'
|
3
|
-
import { cloudflareInit } from '../
|
3
|
+
import { cloudflareInit } from '../components/cloudflare'
|
4
4
|
import { BODY, CONFIG, pjax, setPjax, setSiteSearch, siteSearch } from '../globals/globalVars'
|
5
5
|
import { autoDarkmode, themeColorListener } from '../globals/themeColor'
|
6
6
|
import { resizeHandle, scrollHandle, visibilityListener } from '../globals/handles'
|