sinzmise-cetastories-en 1.7.0-1719905274967 → 1.7.0-1719906897661
Sign up to get free protection for your applications and to get access to all the features.
- package/404.html +72 -0
- package/BingSiteAuth.xml +4 -0
- package/archives/2023/12/index.html +72 -0
- package/archives/2023/index.html +72 -0
- package/archives/index.html +72 -0
- package/article.json +1 -0
- package/{en/atom.xml → atom.xml} +9 -9
- package/baidu_verify_codeva-NA6uDlCuZg.html +72 -0
- package/{en/baidusitemap.xml → baidusitemap.xml} +1 -1
- package/bangumis/index.html +72 -0
- package/cacheList.json +1 -0
- package/categories/Test/index.html +72 -0
- package/categories/index.html +72 -0
- package/css/custom2.css +1 -0
- package/css/plane.css +1 -0
- package/google8073542809160a67.html +72 -0
- package/images/favicon.ico +0 -0
- package/images/siteicon/16.png +0 -0
- package/images/siteicon/32.png +0 -0
- package/images/siteicon/apple-icon-180.png +0 -0
- package/images/siteicon/manifest-icon-192.maskable.png +0 -0
- package/images/siteicon/manifest-icon-512.maskable.png +0 -0
- package/img/512.png +0 -0
- package/img/avatar.png +0 -0
- package/img/bili.jpg +0 -0
- package/img/dark.jpg +0 -0
- package/img/friend_404.gif +0 -0
- package/img/icon-dark.png +0 -0
- package/img/icon-light.png +0 -0
- package/img/icons/api.svg +1 -0
- package/img/icons/diary.svg +1 -0
- package/img/icons/homepage.svg +1 -0
- package/img/icons/navi.svg +1 -0
- package/img/icons/pan.svg +1 -0
- package/img/icons/rtalk.svg +1 -0
- package/img/light.jpg +0 -0
- package/img/link.png +0 -0
- package/img/load-dark.png +0 -0
- package/img/load-light.png +0 -0
- package/img/longnian.webp +0 -0
- package/img/longnian1.webp +0 -0
- package/img/longnian2.webp +0 -0
- package/img/longnian3.webp +0 -0
- package/img/siteicon/android-chrome-144x144.png +0 -0
- package/img/siteicon/android-chrome-192x192.png +0 -0
- package/img/siteicon/android-chrome-256x256.png +0 -0
- package/img/siteicon/android-chrome-36x36.png +0 -0
- package/img/siteicon/android-chrome-384x384.png +0 -0
- package/img/siteicon/android-chrome-48x48.png +0 -0
- package/img/siteicon/android-chrome-512x512.png +0 -0
- package/img/siteicon/android-chrome-72x72.png +0 -0
- package/img/siteicon/android-chrome-96x96.png +0 -0
- package/img/siteicon/apple-splash-1125-2436.jpg +0 -0
- package/img/siteicon/apple-splash-1136-640.jpg +0 -0
- package/img/siteicon/apple-splash-1170-2532.jpg +0 -0
- package/img/siteicon/apple-splash-1179-2556.jpg +0 -0
- package/img/siteicon/apple-splash-1242-2208.jpg +0 -0
- package/img/siteicon/apple-splash-1242-2688.jpg +0 -0
- package/img/siteicon/apple-splash-1284-2778.jpg +0 -0
- package/img/siteicon/apple-splash-1290-2796.jpg +0 -0
- package/img/siteicon/apple-splash-1334-750.jpg +0 -0
- package/img/siteicon/apple-splash-1536-2048.jpg +0 -0
- package/img/siteicon/apple-splash-1620-2160.jpg +0 -0
- package/img/siteicon/apple-splash-1668-2224.jpg +0 -0
- package/img/siteicon/apple-splash-1668-2388.jpg +0 -0
- package/img/siteicon/apple-splash-1792-828.jpg +0 -0
- package/img/siteicon/apple-splash-2048-1536.jpg +0 -0
- package/img/siteicon/apple-splash-2048-2732.jpg +0 -0
- package/img/siteicon/apple-splash-2160-1620.jpg +0 -0
- package/img/siteicon/apple-splash-2208-1242.jpg +0 -0
- package/img/siteicon/apple-splash-2224-1668.jpg +0 -0
- package/img/siteicon/apple-splash-2388-1668.jpg +0 -0
- package/img/siteicon/apple-splash-2436-1125.jpg +0 -0
- package/img/siteicon/apple-splash-2532-1170.jpg +0 -0
- package/img/siteicon/apple-splash-2556-1179.jpg +0 -0
- package/img/siteicon/apple-splash-2688-1242.jpg +0 -0
- package/img/siteicon/apple-splash-2732-2048.jpg +0 -0
- package/img/siteicon/apple-splash-2778-1284.jpg +0 -0
- package/img/siteicon/apple-splash-2796-1290.jpg +0 -0
- package/img/siteicon/apple-splash-640-1136.jpg +0 -0
- package/img/siteicon/apple-splash-750-1334.jpg +0 -0
- package/img/siteicon/apple-splash-828-1792.jpg +0 -0
- package/img/siteicon/apple-touch-icon.png +0 -0
- package/img/siteicon/favicon-16x16.png +0 -0
- package/img/siteicon/favicon-32x32.png +0 -0
- package/img/siteicon/favicon.ico +0 -0
- package/img/siteicon/mstile-150x150.png +0 -0
- package/img/siteicon/safari-pinned-tab.svg +247 -0
- package/img/theta.svg +1 -0
- package/index.html +72 -0
- package/js/autoload.js +1 -0
- package/js/clock.js +1 -0
- package/js/kslink.js +1 -0
- package/js/newyear.js +1 -0
- package/js/plane.js +1 -0
- package/js/txmap.js +1 -0
- package/js/waifu-tips.json +1 -0
- package/manifest.json +1 -0
- package/package.json +1 -1
- package/posts/46521/index.html +72 -0
- package/sitemap.xml +101 -0
- package/sw-dom.js +73 -0
- package/sw.js +580 -138
- package/tags/Test/index.html +72 -0
- package/tags/index.html +72 -0
- package/test.json +1 -0
- package/update.json +1 -0
- package/en/404.html +0 -72
- package/en/archives/2023/12/index.html +0 -72
- package/en/archives/2023/index.html +0 -72
- package/en/archives/index.html +0 -72
- package/en/article.json +0 -1
- package/en/bangumis/index.html +0 -72
- package/en/categories/Test/index.html +0 -72
- package/en/categories/index.html +0 -72
- package/en/img/friend_404.gif +0 -0
- package/en/index.html +0 -72
- package/en/posts/46521/index.html +0 -72
- package/en/sitemap.xml +0 -56
- package/en/tags/Test/index.html +0 -72
- package/en/tags/index.html +0 -72
- /package/{en/assets → assets}/algolia/algoliasearch.js +0 -0
- /package/{en/assets → assets}/algolia/algoliasearch.min.js +0 -0
- /package/{en/assets → assets}/algolia/algoliasearchLite.js +0 -0
- /package/{en/assets → assets}/algolia/algoliasearchLite.min.js +0 -0
- /package/{en/css → css}/404.css +0 -0
- /package/{en/css → css}/anzhiyu-var.css +0 -0
- /package/{en/css → css}/bywind-var.css +0 -0
- /package/{en/css → css}/categoryBar.css +0 -0
- /package/{en/css → css}/console.css +0 -0
- /package/{en/css → css}/custom.css +0 -0
- /package/{en/css → css}/essay_page.css +0 -0
- /package/{en/css → css}/footer.css +0 -0
- /package/{en/css → css}/heo-var.css +0 -0
- /package/{en/css → css}/icat-var.css +0 -0
- /package/{en/css → css}/iconfont.css +0 -0
- /package/{en/css → css}/iconfont.ttf +0 -0
- /package/{en/css → css}/iconfont.woff +0 -0
- /package/{en/css → css}/iconfont.woff2 +0 -0
- /package/{en/css → css}/index.css +0 -0
- /package/{en/css → css}/orlike.css +0 -0
- /package/{en/css → css}/rightmenu.css +0 -0
- /package/{en/css → css}/var.css +0 -0
- /package/{en/img → img}/404.jpg +0 -0
- /package/{en/img → img}/favicon.png +0 -0
- /package/{en/img → img}/footer-social-link.svg +0 -0
- /package/{en/js → js}/about.js +0 -0
- /package/{en/js → js}/categoryBar.js +0 -0
- /package/{en/js → js}/comments.js +0 -0
- /package/{en/js → js}/console.js +0 -0
- /package/{en/js → js}/custom/fixed_card_widget.js +0 -0
- /package/{en/js → js}/custom.js +0 -0
- /package/{en/js → js}/day.js +0 -0
- /package/{en/js → js}/fps.js +0 -0
- /package/{en/js → js}/hometop.js +0 -0
- /package/{en/js → js}/lunar.js +0 -0
- /package/{en/js → js}/main.js +0 -0
- /package/{en/js → js}/nav.js +0 -0
- /package/{en/js → js}/orlike.js +0 -0
- /package/{en/js → js}/owobig.js +0 -0
- /package/{en/js → js}/random-friends-post.js +0 -0
- /package/{en/js → js}/randompost.js +0 -0
- /package/{en/js → js}/rightmenu.js +0 -0
- /package/{en/js → js}/sakura.js +0 -0
- /package/{en/js → js}/search/algolia.js +0 -0
- /package/{en/js → js}/search/local-search.js +0 -0
- /package/{en/js → js}/tw_cn.js +0 -0
- /package/{en/js → js}/utils.js +0 -0
- /package/{en/js → js}/waterfall/waterfall.js +0 -0
- /package/{en/js → js}/welcome.js +0 -0
- /package/{en/lib → lib}/tag_plugins.css +0 -0
- /package/{en/robots.txt → robots.txt} +0 -0
package/sw-dom.js
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
document.addEventListener('DOMContentLoaded', () => {
|
2
|
+
if (!navigator.serviceWorker?.controller) return
|
3
|
+
/** 发送信息到 sw */
|
4
|
+
const postMessage2SW = type => navigator.serviceWorker.controller.postMessage(type)
|
5
|
+
const pjaxUpdate = url => {
|
6
|
+
const type = url.endsWith('js') ? 'script' : 'link'
|
7
|
+
const name = type === 'link' ? 'href' : 'src'
|
8
|
+
for (let item of document.getElementsByTagName(type)) {
|
9
|
+
const itUrl = item[name]
|
10
|
+
if (url.length > itUrl ? url.endsWith(itUrl) : itUrl.endsWith(url)) {
|
11
|
+
const newEle = document.createElement(type)
|
12
|
+
const content = item.text || item.textContent || item.innerHTML || ''
|
13
|
+
// noinspection JSUnresolvedReference
|
14
|
+
Array.from(item.attributes).forEach(attr => newEle.setAttribute(attr.name, attr.value))
|
15
|
+
newEle.appendChild(document.createTextNode(content))
|
16
|
+
item.parentNode.replaceChildren(newEle, item)
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
const SESSION_KEY = 'updated'
|
22
|
+
// noinspection JSFileReferences
|
23
|
+
const onSuccess = () => {
|
24
|
+
caches.match('https://id.v3/').then(function(response) {
|
25
|
+
if (response) {
|
26
|
+
// 如果找到了匹配的缓存响应
|
27
|
+
response.json().then(function(data) {
|
28
|
+
var snackbarBg =
|
29
|
+
document.documentElement.getAttribute('data-theme') === 'light' ?
|
30
|
+
GLOBAL_CONFIG.Snackbar.bgLight :
|
31
|
+
GLOBAL_CONFIG.Snackbar.bgDark
|
32
|
+
var snackbarPos = GLOBAL_CONFIG.Snackbar.position
|
33
|
+
Snackbar.show({
|
34
|
+
text: `Cache refreshed,Updated to version ${GLOBAL_CONFIG.uiversion} with the latest content.`,
|
35
|
+
backgroundColor: snackbarBg,
|
36
|
+
duration: 30000,
|
37
|
+
pos: snackbarPos,
|
38
|
+
actionText: '查看更新日志',
|
39
|
+
actionTextColor: '#fff',
|
40
|
+
onActionClick: function(e) {
|
41
|
+
location.assign("/update/");
|
42
|
+
},
|
43
|
+
})
|
44
|
+
});
|
45
|
+
} else {
|
46
|
+
console.info('未找到匹配的缓存响应');
|
47
|
+
}
|
48
|
+
}).catch(function(error) {
|
49
|
+
console.error('缓存匹配出错:', error);
|
50
|
+
});
|
51
|
+
};
|
52
|
+
if (sessionStorage.getItem(SESSION_KEY)) {
|
53
|
+
onSuccess()
|
54
|
+
sessionStorage.removeItem(SESSION_KEY)
|
55
|
+
} else postMessage2SW('update')
|
56
|
+
navigator.serviceWorker.addEventListener('message', event => {
|
57
|
+
const data = event.data
|
58
|
+
sessionStorage.setItem(SESSION_KEY, data.type)
|
59
|
+
const list = data.list?.filter(url => /\.(js|css)$/.test(url))
|
60
|
+
if (list) {
|
61
|
+
// noinspection JSUnresolvedReference
|
62
|
+
if (window.Pjax?.isSupported?.())
|
63
|
+
list.forEach(pjaxUpdate)
|
64
|
+
location.reload()
|
65
|
+
} else {
|
66
|
+
const newVersion = data.new, oldVersion = data.old
|
67
|
+
if (oldVersion && (newVersion.global !== oldVersion.global || newVersion.local !== oldVersion.local)) {
|
68
|
+
onSuccess()
|
69
|
+
}
|
70
|
+
sessionStorage.removeItem(SESSION_KEY)
|
71
|
+
}
|
72
|
+
})
|
73
|
+
})
|