Skip to content

Commit

Permalink
refactor: 移除quicklink [publish dev]
Browse files Browse the repository at this point in the history
  • Loading branch information
zkz098 committed Nov 2, 2024
1 parent 057c7b1 commit 4774f82
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 38 deletions.
11 changes: 1 addition & 10 deletions layout/_partials/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ include ../_mixin/breadcrumb.pug
include ../_mixin/sidebar.pug
include ../_mixin/widgets.pug

- ignores = []
if (theme.quicklink.ignores)
- ignores.push(theme.quicklink.ignores)

- var covers = _cover_index(page, 6)
- var enableFixedCover = theme.homeConfig?.fixedCover
- var enablePreload = theme.experiments?.coverConfig?.enablePreload
Expand Down Expand Up @@ -120,12 +116,7 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
essay: `#{__('quiz.essay')}`,
gap_fill: `#{__('quiz.gap_fill')}`,
mistake: `#{__('quiz.mistake')}`
},
ignores: [
(uri) => uri.includes('#'),
(uri) => new RegExp(LOCAL.path + '$').test(uri),
!{JSON.stringify(ignores)}
]
}
};
!= partial('_partials/third-party/baidu-analytics.pug', {}, {cache: true})
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"js-yaml": "^4.1.0",
"katex": "^0.16.11",
"mouse-firework": "^0.0.6",
"quicklink": "^2.3.0",
"theme-shokax-anime": "^0.0.7",
"twikoo": "^1.6.39",
"unlazy": "^0.11.3"
Expand Down
4 changes: 0 additions & 4 deletions scripts/generaters/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ hexo.extend.generator.register('script', function (locals) {
enable: theme.outime.enable,
days: theme.outime.days
},
quicklink: {
timeout: theme.quicklink.timeout,
priority: theme.quicklink.priority
},
playerAPI: theme.playerAPI,
experiments: {
copyrightLength: theme.experiments.copyrightLength,
Expand Down
5 changes: 0 additions & 5 deletions source/js/_app/library/declare.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ interface configType {
region: string
}
walinePageView: boolean
quicklink: {
ignores: any
timeout: number
priority: boolean
}
playerAPI: string
experiments: {
copyrightLength: number;
Expand Down
13 changes: 8 additions & 5 deletions source/js/_app/pjax/refresh.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { cardActive } from '../page/common'
import { resizeHandle } from '../globals/handles'
import {
CONFIG,
setLocalHash, setLocalUrl, setOriginTitle,
toolPlayer
} from '../globals/globalVars'
import { positionInit } from '../globals/tools'
import { menuActive, sideBarTab, sidebarTOC } from '../components/sidebar'
Expand Down Expand Up @@ -95,10 +93,15 @@ export const siteRefresh = async (reload) => {
tabFormat()
}

if (__shokax_player__) {
toolPlayer.player.load(LOCAL.audio || CONFIG.audio || {})
// if (__shokax_player__) {
// toolPlayer.player.load(LOCAL.audio || CONFIG.audio || {})
// }
if (sessionStorage.getItem('loaded') === 'true') {
Loader.hide(30)
} else {
sessionStorage.setItem('loaded', 'true')
Loader.hide(500)
}
Loader.hide(100)

setTimeout(() => {
positionInit()
Expand Down
14 changes: 1 addition & 13 deletions source/js/_app/pjax/siteInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ const siteInit = async () => {
initVue()
domInit()

CONFIG.quicklink.ignores = LOCAL.ignores
import('quicklink').then(({listen}) => {
listen(CONFIG.quicklink)
})

autoDarkmode()

if (__shokax_VL__) {
Expand Down Expand Up @@ -70,18 +65,11 @@ const siteInit = async () => {
passive: true
})

// window.addEventListener('pjax:send', pjaxReload, {
// passive: true
// })

// window.addEventListener('pjax:success', siteRefresh, {
// passive: true
// }) // 默认会传入一个event参数

window.addEventListener('beforeunload', () => {
pagePosition()
})
await siteRefresh(1)
// TODO 修复内页跳转后重复出现加载动画的问题
}

cloudflareInit()
Expand Down

0 comments on commit 4774f82

Please sign in to comment.