From 8a90a70648a29c0a2ff961fe4e4f8998a36549ae Mon Sep 17 00:00:00 2001 From: sunfkny <30853461+sunfkny@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:17:57 +0800 Subject: [PATCH 01/16] Fix deleteFeeds --- registry/lib/components/feeds/del-feeds/check-in-item.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/lib/components/feeds/del-feeds/check-in-item.ts b/registry/lib/components/feeds/del-feeds/check-in-item.ts index aa06777df..67b56c0ca 100644 --- a/registry/lib/components/feeds/del-feeds/check-in-item.ts +++ b/registry/lib/components/feeds/del-feeds/check-in-item.ts @@ -131,4 +131,4 @@ const builtInItems: CheckInItem[] = [ }, ] -export const [checkInItems] = registerAndGetData('checkInCenter.items', builtInItems) +export const [checkInItems] = registerAndGetData('deleteFeeds.items', builtInItems) From 09afe495413eb8db6e9d1b2d19e08417141c0ebd Mon Sep 17 00:00:00 2001 From: sunfkny <30853461+sunfkny@users.noreply.github.com> Date: Thu, 24 Oct 2024 19:43:51 +0800 Subject: [PATCH 02/16] =?UTF-8?q?[=E7=BB=84=E4=BB=B6-=E7=A6=81=E6=AD=A2?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=8A=A8=E6=80=81=E8=AF=A6=E6=83=85]=20fix:?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E5=B8=A6=E5=9B=BE=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=BA=8C=E6=AC=A1=E8=BD=AC=E5=8F=91=E5=90=8E?= =?UTF-8?q?=EF=BC=8C`=E6=9F=A5=E7=9C=8B=E5=9B=BE=E7=89=87`=20=E5=A4=B1?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- registry/lib/components/feeds/disable-details/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/registry/lib/components/feeds/disable-details/index.ts b/registry/lib/components/feeds/disable-details/index.ts index cfc9e9a4b..c781c0a72 100644 --- a/registry/lib/components/feeds/disable-details/index.ts +++ b/registry/lib/components/feeds/disable-details/index.ts @@ -41,6 +41,7 @@ const entry = async () => { 'bili-rich-text-topic', 'bili-rich-text-module', 'bili-rich-text-link', + 'bili-rich-text-viewpic', ].some(className => target.classList.contains(className)) ) { return From cf950a81f7919f8a4889934978c0fbb8dcf79e4a Mon Sep 17 00:00:00 2001 From: WakelessSloth56 Date: Sun, 27 Oct 2024 10:03:20 +0800 Subject: [PATCH 03/16] fix: fix wasm plugin option muxWithMetadata --- registry/lib/plugins/video/download/wasm-output/Config.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/lib/plugins/video/download/wasm-output/Config.vue b/registry/lib/plugins/video/download/wasm-output/Config.vue index 0934be6e4..09862e113 100644 --- a/registry/lib/plugins/video/download/wasm-output/Config.vue +++ b/registry/lib/plugins/video/download/wasm-output/Config.vue @@ -33,7 +33,7 @@ export default Vue.extend({ }, methods: { saveOptions() { - options.muxWithMetadata = this.muxExtraAssets + options.muxWithMetadata = this.muxWithMetadata Object.assign(storedOptions, options) }, }, From cb7df01bdf3216d45ef1c85d54a129c6e0c67b93 Mon Sep 17 00:00:00 2001 From: WakelessSloth56 Date: Sun, 27 Oct 2024 10:41:38 +0800 Subject: [PATCH 04/16] feat: wasm plugin deleteFile message --- .../video/download/wasm-output/ffmpeg.ts | 21 +++++++++++++++++++ .../video/download/wasm-output/handler.ts | 13 +++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts b/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts index 5f991c0ba..04d025239 100644 --- a/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts +++ b/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts @@ -17,6 +17,7 @@ enum FFMessageType { EXEC = 'EXEC', WRITE_FILE = 'WRITE_FILE', READ_FILE = 'READ_FILE', + DELETE_FILE = 'DELETE_FILE', ERROR = 'ERROR', } @@ -38,6 +39,7 @@ export class FFmpeg { case FFMessageType.EXEC: case FFMessageType.WRITE_FILE: case FFMessageType.READ_FILE: + case FFMessageType.DELETE_FILE: this.#resolves[id](data) break case FFMessageType.ERROR: @@ -140,6 +142,20 @@ export class FFmpeg { undefined, signal, ) as Promise + + public deleteFile = (path: string, signal?: AbortSignal) => + this.#send( + { + type: FFMessageType.DELETE_FILE, + data: { path }, + }, + undefined, + signal, + ) as Promise + + public onProgress(callback: (event: ProgressEvent) => void): void { + this.#progressEventCallback = callback + } } // ========================================================================== // @@ -165,11 +181,16 @@ interface FFMessageReadFileData { encoding: string } +interface FFMessageDeleteFileData { + path: string +} + type FFMessageData = | FFMessageLoadConfig | FFMessageExecData | FFMessageWriteFileData | FFMessageReadFileData + | FFMessageDeleteFileData interface Message { type: string diff --git a/registry/lib/plugins/video/download/wasm-output/handler.ts b/registry/lib/plugins/video/download/wasm-output/handler.ts index 7d6842e1c..256c2612e 100644 --- a/registry/lib/plugins/video/download/wasm-output/handler.ts +++ b/registry/lib/plugins/video/download/wasm-output/handler.ts @@ -59,13 +59,13 @@ async function single( httpGet(audioUrl, progress(1, '正在下载音频流')), ]) - ffmpeg.writeFile('video', video) - ffmpeg.writeFile('audio', audio) + await ffmpeg.writeFile('video', video) + await ffmpeg.writeFile('audio', audio) const args = ['-i', 'video', '-i', 'audio'] if (ffmetadata) { - ffmpeg.writeFile('ffmetadata', new TextEncoder().encode(ffmetadata)) + await ffmpeg.writeFile('ffmetadata', new TextEncoder().encode(ffmetadata)) args.push('-i', 'ffmetadata', '-map_metadata', '2') if (!outputMkv) { args.push('-movflags', '+use_metadata_tags') @@ -87,6 +87,13 @@ async function single( toast.message = '完成!' toast.duration = 1000 + await Promise.all([ + ffmpeg.deleteFile('video'), + ffmpeg.deleteFile('audio'), + ffmpeg.deleteFile('output'), + ffmetadata ? ffmpeg.deleteFile('ffmetadata') : Promise.resolve(), + ]) + await DownloadPackage.single( name.replace(/.[^/.]+$/, `.${outputMkv ? 'mkv' : 'mp4'}`), outputBlob, From 30ec155fa8a37c23afe7bc8f5a0cb62aff615b6f Mon Sep 17 00:00:00 2001 From: WakelessSloth56 Date: Sun, 27 Oct 2024 10:42:22 +0800 Subject: [PATCH 05/16] feat: wasm plugin progress event --- .../plugins/video/download/wasm-output/ffmpeg.ts | 15 ++++++++++++++- .../plugins/video/download/wasm-output/handler.ts | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts b/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts index 04d025239..f02e78d34 100644 --- a/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts +++ b/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts @@ -19,6 +19,7 @@ enum FFMessageType { READ_FILE = 'READ_FILE', DELETE_FILE = 'DELETE_FILE', ERROR = 'ERROR', + PROGRESS = 'PROGRESS', } export class FFmpeg { @@ -26,6 +27,8 @@ export class FFmpeg { #resolves: Callbacks = {} #rejects: Callbacks = {} + #progressEventCallback: (event: ProgressEvent) => void + public loaded = false #registerHandlers = () => { @@ -42,6 +45,11 @@ export class FFmpeg { case FFMessageType.DELETE_FILE: this.#resolves[id](data) break + case FFMessageType.PROGRESS: + if (this.#progressEventCallback) { + this.#progressEventCallback(data) + } + break case FFMessageType.ERROR: this.#rejects[id](data) break @@ -197,7 +205,12 @@ interface Message { data?: FFMessageData } -type CallbackData = Uint8Array | string | boolean | Error | undefined +interface ProgressEvent { + progress: number + time: number +} + +type CallbackData = Uint8Array | string | boolean | Error | ProgressEvent | undefined interface Callbacks { [id: number | string]: (data: CallbackData) => void diff --git a/registry/lib/plugins/video/download/wasm-output/handler.ts b/registry/lib/plugins/video/download/wasm-output/handler.ts index 256c2612e..4be359a0d 100644 --- a/registry/lib/plugins/video/download/wasm-output/handler.ts +++ b/registry/lib/plugins/video/download/wasm-output/handler.ts @@ -2,6 +2,7 @@ import { DownloadPackage, PackageEntry } from '@/core/download' import { meta } from '@/core/meta' import { getComponentSettings } from '@/core/settings' import { Toast } from '@/core/toast' +import { formatPercent } from '@/core/utils/formatters' import { title as pluginTitle } from '.' import type { Options } from '../../../../components/video/download' import { DownloadVideoAction } from '../../../../components/video/download/types' @@ -76,7 +77,9 @@ async function single( console.debug('FFmpeg commandline args:', args.join(' ')) - toast.message = '混流中……' + ffmpeg.onProgress(event => { + toast.message = `混流中: ${formatPercent(event.progress)}` + }) await ffmpeg.exec(args) const output = await ffmpeg.readFile('output') From 5be4fab2e23bcb87cecb4564d5ae0e4cb7bdf8b4 Mon Sep 17 00:00:00 2001 From: the1812 Date: Tue, 24 Dec 2024 23:17:43 +0800 Subject: [PATCH 06/16] Add PGC navbar items plugin (#5045) --- .vscode/settings.json | 1 + .../plugins/style/custom-navbar-pgc/index.ts | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 registry/lib/plugins/style/custom-navbar-pgc/index.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 4ff1db327..fcc76fc01 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -51,6 +51,7 @@ "Fullscreen", "githubusercontent", "Greasemonkey", + "guochuang", "haruna", "hdslb", "HEVC", diff --git a/registry/lib/plugins/style/custom-navbar-pgc/index.ts b/registry/lib/plugins/style/custom-navbar-pgc/index.ts new file mode 100644 index 000000000..f7fac0721 --- /dev/null +++ b/registry/lib/plugins/style/custom-navbar-pgc/index.ts @@ -0,0 +1,46 @@ +import { PluginMetadata } from '@/plugins/plugin' +import type { CustomNavbarItemInit } from '../../../components/style/custom-navbar/custom-navbar-item' + +export const plugin: PluginMetadata = { + name: 'customNavbar.items.pgc', + displayName: '自定义顶栏 - 版权内容', + description: '为自定义顶栏扩充版权内容相关的快速入口, 包括国创 / 电影 / 电视剧 /综艺 / 纪录片', + async setup({ addData }) { + addData('customNavbar.items', (items: CustomNavbarItemInit[]) => { + const pgcItems = [ + { + name: 'guochuang', + displayName: '国创', + href: 'https://www.bilibili.com/guochuang/', + }, + { + name: 'movie', + displayName: '电影', + href: 'https://www.bilibili.com/movie/', + }, + { + name: 'tv', + displayName: '电视剧', + href: 'https://www.bilibili.com/tv/', + }, + { + name: 'variety', + displayName: '综艺', + href: 'https://www.bilibili.com/variety/', + }, + { + name: 'documentary', + displayName: '纪录片', + href: 'https://www.bilibili.com/documentary/', + }, + ] + items.push( + ...pgcItems.map(item => ({ + ...item, + content: item.displayName, + active: document.URL.startsWith(item.href), + })), + ) + }) + }, +} From 1a02068bcb56f9b91119a6125c4982883e933b38 Mon Sep 17 00:00:00 2001 From: the1812 Date: Tue, 24 Dec 2024 23:25:16 +0800 Subject: [PATCH 07/16] Add confirm when screenshots are not empty (#5066) --- .../video/player/screenshot/index.ts | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/registry/lib/components/video/player/screenshot/index.ts b/registry/lib/components/video/player/screenshot/index.ts index ee1d559b8..6b03db815 100644 --- a/registry/lib/components/video/player/screenshot/index.ts +++ b/registry/lib/components/video/player/screenshot/index.ts @@ -8,10 +8,16 @@ import desc from './desc.md' import ScreenshotContainer from './VideoScreenshotContainer.vue' export const VideoScreenshotDisabledClass = 'video-screenshot-disable' -const entry = async () => { - let screenShotsList: Vue & { - screenshots: Screenshot[] +let screenShotsList: Vue & { + screenshots: Screenshot[] +} +const exitConfirmHandler = (e: BeforeUnloadEvent) => { + if (screenShotsList?.screenshots.length > 0) { + e.preventDefault() } +} + +const entry = async () => { addControlBarButton({ name: 'takeScreenshot', displayName: '截图', @@ -35,6 +41,7 @@ const entry = async () => { } }, }) + window.addEventListener('beforeunload', exitConfirmHandler) } export const component = defineComponentMetadata({ name: 'videoScreenshot', @@ -45,8 +52,14 @@ export const component = defineComponentMetadata({ 'zh-CN': desc, }, urlInclude: playerUrls, - reload: () => document.body.classList.remove(VideoScreenshotDisabledClass), - unload: () => document.body.classList.add(VideoScreenshotDisabledClass), + reload: () => { + document.body.classList.remove(VideoScreenshotDisabledClass) + window.addEventListener('beforeunload', exitConfirmHandler) + }, + unload: () => { + document.body.classList.add(VideoScreenshotDisabledClass) + window.removeEventListener('beforeunload', exitConfirmHandler) + }, plugin: { displayName: '视频截图 - 快捷键支持', setup: ({ addData }) => { From 11dd64f9652fba0ce2f446ea19062874fef500e9 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 28 Dec 2024 11:28:44 +0800 Subject: [PATCH 08/16] Update docs --- doc/features/features.json | 8 ++++++++ doc/features/features.md | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/features/features.json b/doc/features/features.json index ccc4e03fb..152b05095 100644 --- a/doc/features/features.json +++ b/doc/features/features.json @@ -1056,6 +1056,14 @@ "fullRelativePath": "../../registry/dist/plugins/style/custom-navbar-dark-mode.js", "fullAbsolutePath": "registry/dist/plugins/style/custom-navbar-dark-mode.js" }, + { + "type": "plugin", + "name": "customNavbar.items.pgc", + "displayName": "自定义顶栏 - 版权内容", + "description": "为自定义顶栏扩充版权内容相关的快速入口, 包括国创 / 电影 / 电视剧 /综艺 / 纪录片", + "fullRelativePath": "../../registry/dist/plugins/style/custom-navbar-pgc.js", + "fullAbsolutePath": "registry/dist/plugins/style/custom-navbar-pgc.js" + }, { "type": "plugin", "name": "keymap.actions.darkMode", diff --git a/doc/features/features.md b/doc/features/features.md index 701bbe341..862ed2574 100644 --- a/doc/features/features.md +++ b/doc/features/features.md @@ -1466,6 +1466,15 @@ by FoundTheWOUT 为自定义顶栏添加一个夜间模式开关, 方便快速切换夜间模式. +### [自定义顶栏 - 版权内容](../../registry/dist/plugins/style/custom-navbar-pgc.js) +`customNavbar.items.pgc` + +**jsDelivr:** [`Stable`](https://cdn.jsdelivr.net/gh/the1812/Bilibili-Evolved@master/registry/dist/plugins/style/custom-navbar-pgc.js) / [`Preview`](https://cdn.jsdelivr.net/gh/the1812/Bilibili-Evolved@preview/registry/dist/plugins/style/custom-navbar-pgc.js) + +**GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/plugins/style/custom-navbar-pgc.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/plugins/style/custom-navbar-pgc.js) + +为自定义顶栏扩充版权内容相关的快速入口, 包括国创 / 电影 / 电视剧 /综艺 / 纪录片 + ### [快捷键扩展 - 夜间模式](../../registry/dist/plugins/utils/keymap-dark-mode.js) `keymap.actions.darkMode` From 9243994c5953fd4409d02bf9514a9f6af56bec2a Mon Sep 17 00:00:00 2001 From: WakelessSloth56 Date: Sat, 11 Jan 2025 11:59:59 +0800 Subject: [PATCH 09/16] feat: wasm plugin throws error if file size over 4GB #5097 --- registry/lib/plugins/video/download/wasm-output/handler.ts | 6 +++++- registry/lib/plugins/video/download/wasm-output/index.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/registry/lib/plugins/video/download/wasm-output/handler.ts b/registry/lib/plugins/video/download/wasm-output/handler.ts index 4be359a0d..1f39bad3f 100644 --- a/registry/lib/plugins/video/download/wasm-output/handler.ts +++ b/registry/lib/plugins/video/download/wasm-output/handler.ts @@ -2,7 +2,7 @@ import { DownloadPackage, PackageEntry } from '@/core/download' import { meta } from '@/core/meta' import { getComponentSettings } from '@/core/settings' import { Toast } from '@/core/toast' -import { formatPercent } from '@/core/utils/formatters' +import { formatFileSize, formatPercent } from '@/core/utils/formatters' import { title as pluginTitle } from '.' import type { Options } from '../../../../components/video/download' import { DownloadVideoAction } from '../../../../components/video/download/types' @@ -139,6 +139,10 @@ export async function run(action: DownloadVideoAction, muxWithMetadata: boolean) throw new Error('仅支持 DASH 格式视频和音频') } + if (video.size + audio.size > 4294967295) { + throw new Error(`仅支持合并 4GB 内的音视频(${formatFileSize(video.size + audio.size)})`) + } + await single( video.title, video.url, diff --git a/registry/lib/plugins/video/download/wasm-output/index.ts b/registry/lib/plugins/video/download/wasm-output/index.ts index d5039f259..97ae9d151 100644 --- a/registry/lib/plugins/video/download/wasm-output/index.ts +++ b/registry/lib/plugins/video/download/wasm-output/index.ts @@ -19,7 +19,7 @@ export const plugin: PluginMetadata = { outputs.push({ name: 'wasm', displayName: 'WASM', - description: `${desc}。运行过程中请勿关闭页面,初次使用或清除缓存后需要加载约 30 MB 的 WASM 文件。`, + description: `${desc}。运行过程中请勿关闭页面,初次使用或清除缓存后需要加载约 30 MB 的 WASM 文件。由于浏览器限制,仅支持合并 4GB 以内的音视频。`, runAction: async (action, instance) => { try { await run(action, instance.muxWithMetadata) From 1ee5b56127ad8d598f67d8450bd6bab2b552742b Mon Sep 17 00:00:00 2001 From: magicFeirl <2100709458@qq.com> Date: Tue, 11 Feb 2025 21:56:28 +0800 Subject: [PATCH 10/16] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=83=AD?= =?UTF-8?q?=E6=90=9C=E8=BE=93=E5=85=A5=E6=A1=86=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trending-search/hide-trending-search.scss | 8 ++++--- .../style/hide/trending-search/index.ts | 23 +++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/registry/lib/components/style/hide/trending-search/hide-trending-search.scss b/registry/lib/components/style/hide/trending-search/hide-trending-search.scss index b3453bb69..080f5cc19 100644 --- a/registry/lib/components/style/hide/trending-search/hide-trending-search.scss +++ b/registry/lib/components/style/hide/trending-search/hide-trending-search.scss @@ -1,5 +1,7 @@ .search-panel { - > .trending { - display: none !important; - } + display: none !important; } + +#nav-searchform.is-focus { + border-radius: 8px !important; +} \ No newline at end of file diff --git a/registry/lib/components/style/hide/trending-search/index.ts b/registry/lib/components/style/hide/trending-search/index.ts index b6bbf495f..7def41243 100644 --- a/registry/lib/components/style/hide/trending-search/index.ts +++ b/registry/lib/components/style/hide/trending-search/index.ts @@ -1,5 +1,15 @@ import { defineComponentMetadata } from '@/components/define' import { allMutations } from '@/core/observer' +import { select } from '@/core/spin-query' + + +const DEFAULT_PLACEHOLDER = '搜索' + + +const resetPlaceholder = (input: HTMLInputElement) => { + input.placeholder = input.title = DEFAULT_PLACEHOLDER +} + export const component = defineComponentMetadata({ name: 'hideTrendingSearch', @@ -12,14 +22,23 @@ export const component = defineComponentMetadata({ }, ], entry: async () => { + const input: HTMLInputElement = await select('input.nav-search-input', { + queryInterval: 500 + }); + + if (input) { + return resetPlaceholder(input) + } + + // Fallback to observer allMutations(records => { records.forEach(record => { if ( record.target instanceof HTMLInputElement && record.target.classList.contains('nav-search-input') && - record.target.placeholder !== '搜索' + record.target.placeholder !== DEFAULT_PLACEHOLDER ) { - record.target.placeholder = '搜索' + resetPlaceholder(record.target) } }) }) From 9069c3a8e6b46f3dd98b8e99b91853973b2b80ed Mon Sep 17 00:00:00 2001 From: magicFeirl <2100709458@qq.com> Date: Tue, 11 Feb 2025 22:50:44 +0800 Subject: [PATCH 11/16] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trending-search/hide-trending-search.scss | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/registry/lib/components/style/hide/trending-search/hide-trending-search.scss b/registry/lib/components/style/hide/trending-search/hide-trending-search.scss index 080f5cc19..c9d8407e7 100644 --- a/registry/lib/components/style/hide/trending-search/hide-trending-search.scss +++ b/registry/lib/components/style/hide/trending-search/hide-trending-search.scss @@ -1,7 +1,18 @@ .search-panel { - display: none !important; + + > .trending { + display: none !important; + } + + &:not(:has(.history)) { + padding: 0 !important; + border: none !important; + } } #nav-searchform.is-focus { - border-radius: 8px !important; + /* 搜索框 focusing 且有关键字列表 or 历史记录列表时不显示低边框*/ + &:not(:has(+ .search-panel > .suggestions), :has(+ .search-panel > .history)) { + border-radius: 8px !important; + } } \ No newline at end of file From d517d5860d9387f1f1412a508d83a595959452ff Mon Sep 17 00:00:00 2001 From: magicFeirl <2100709458@qq.com> Date: Wed, 12 Feb 2025 15:23:15 +0800 Subject: [PATCH 12/16] fix: lint --- .../components/style/hide/trending-search/index.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/registry/lib/components/style/hide/trending-search/index.ts b/registry/lib/components/style/hide/trending-search/index.ts index 7def41243..d4003911b 100644 --- a/registry/lib/components/style/hide/trending-search/index.ts +++ b/registry/lib/components/style/hide/trending-search/index.ts @@ -2,15 +2,13 @@ import { defineComponentMetadata } from '@/components/define' import { allMutations } from '@/core/observer' import { select } from '@/core/spin-query' - const DEFAULT_PLACEHOLDER = '搜索' - const resetPlaceholder = (input: HTMLInputElement) => { - input.placeholder = input.title = DEFAULT_PLACEHOLDER + input.placeholder = DEFAULT_PLACEHOLDER + input.title = DEFAULT_PLACEHOLDER } - export const component = defineComponentMetadata({ name: 'hideTrendingSearch', displayName: '隐藏热搜', @@ -23,11 +21,12 @@ export const component = defineComponentMetadata({ ], entry: async () => { const input: HTMLInputElement = await select('input.nav-search-input', { - queryInterval: 500 - }); + queryInterval: 500, + }) if (input) { - return resetPlaceholder(input) + resetPlaceholder(input) + return } // Fallback to observer From a5283105b06ff681687c2a640f78e77a9681bb92 Mon Sep 17 00:00:00 2001 From: the1812 Date: Wed, 19 Feb 2025 08:31:35 +0800 Subject: [PATCH 13/16] Restore double click fullscreen (#5095) --- README.md | 2 +- .../double-click-fullscreen/index.ts | 0 src/components/video/player-adaptor/bpx.ts | 13 +------------ 3 files changed, 2 insertions(+), 13 deletions(-) rename registry/lib/{components/video/player => deprecated}/double-click-fullscreen/index.ts (100%) diff --git a/README.md b/README.md index f0996e674..86839b10d 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ **注意事项** - **⚠ 使用正式版 (GitHub 源) 和预览版须翻墙.** -- 默认不预装任何组件, 需要在按[设置](#设置)中的说明添加感兴趣的功能; 默认会屏蔽双击全屏, 如有需要可以安装 `双击全屏` 组件来恢复. +- 默认不预装任何组件, 需要在按[设置](#设置)中的说明添加感兴趣的功能. - 这个是一个综合性的脚本, 如果只是想下载视频建议去 [GreasyFork](https://greasyfork.org/zh-CN/scripts/by-site/bilibili.com) 找个更专业的. - 对性能有较大影响, 详见[配置要求](#配置). - 默认不对未登录的状态做适配. diff --git a/registry/lib/components/video/player/double-click-fullscreen/index.ts b/registry/lib/deprecated/double-click-fullscreen/index.ts similarity index 100% rename from registry/lib/components/video/player/double-click-fullscreen/index.ts rename to registry/lib/deprecated/double-click-fullscreen/index.ts diff --git a/src/components/video/player-adaptor/bpx.ts b/src/components/video/player-adaptor/bpx.ts index d96eada32..8762d50c5 100644 --- a/src/components/video/player-adaptor/bpx.ts +++ b/src/components/video/player-adaptor/bpx.ts @@ -1,6 +1,6 @@ import { attributes } from '@/core/observer' import { select } from '@/core/spin-query' -import { playerReady, preventEvent } from '@/core/utils' +import { playerReady } from '@/core/utils' import { createPlayerModeChangeEvent, PlayerMode } from './events' /** 播放器模式标记同步 */ @@ -36,19 +36,8 @@ const playerModePolyfill = async () => { } }) } -/** 移除 3.x 的双击全屏. - * 如果以后视频区兼容了弹幕点赞层, 需要将双击全屏组件更换为阻止双击全屏, 并取消对此函数的使用. - */ -const doubleClickPolyfill = async () => { - const layer = (await select('.bpx-player-video-perch')) as HTMLElement - if (!layer) { - return - } - preventEvent(layer, 'dblclick') -} /** 番剧 & 视频播放器 (BPX) 通用 polyfill */ export const bpxPlayerPolyfill = lodash.once(async () => { playerModePolyfill() - doubleClickPolyfill() }) From e2ec33f1f4c047b3d5424b128e83dcc3105839c8 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 22 Feb 2025 17:56:21 +0800 Subject: [PATCH 14/16] Add scroll animations for transparent mode (#4996) --- .../style/custom-navbar/CustomNavbar.vue | 1 + .../custom-navbar/_scroll-animation.scss | 183 ++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100644 registry/lib/components/style/custom-navbar/_scroll-animation.scss diff --git a/registry/lib/components/style/custom-navbar/CustomNavbar.vue b/registry/lib/components/style/custom-navbar/CustomNavbar.vue index 602bbf91d..f095e6d1a 100644 --- a/registry/lib/components/style/custom-navbar/CustomNavbar.vue +++ b/registry/lib/components/style/custom-navbar/CustomNavbar.vue @@ -74,6 +74,7 @@ export default Vue.extend({