Merge branch 'preview-features' into preview

This commit is contained in:
the1812 2022-10-22 10:30:13 +08:00
commit 3c2cce86de
18 changed files with 156 additions and 123 deletions

View File

@ -22,7 +22,10 @@ jobs:
fetch-depth: '0'
- name: Install dependencies
uses: bahmutov/npm-install@v1
uses: pnpm/action-setup@v2.2.4
with:
version: latest
run_install: true
- name: Type check
run: pnpm run type

View File

@ -20,7 +20,10 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install dependencies
uses: bahmutov/npm-install@v1
uses: pnpm/action-setup@v2.2.4
with:
version: latest
run_install: true
- name: Type check
run: pnpm run type

1
.gitignore vendored
View File

@ -6,4 +6,5 @@ dev/
dist/stats.html
dist/profile.json
dist/bilibili-evolved.dev.user.js
registry/dist/doc.js
dev-tools/**/dist/

View File

@ -1,5 +1,13 @@
# 更新日志
## v2.5.1
`2022-10-22`
- 修复 `展开选集列表``展开选集标题` 冲突的问题, 这两个组件将合并在一起, 并提供单独的选项控制列表和标题. (#3752, #692)
> 如果在 v2.5.0 中尝试安装过 `展开选集列表`, 记得先卸载掉.
- 修复 jsDelivr 源中 MDI 图标库加载失败. (#3752, #3761)
- 修复 `简化首页` 在带 query 参数的首页不显示分区选项. (#3730)
## v2.5.0
`2022-10-20`

View File

@ -570,16 +570,8 @@
{
"type": "component",
"name": "fullEpisodeTitle",
"displayName": "展开选集列表",
"description": "总是完全展开视频选集列表, 注意对番剧无效.\r\n",
"fullRelativePath": "../../registry/dist/components/video/full-episode-list.js",
"fullAbsolutePath": "registry/dist/components/video/full-episode-list.js"
},
{
"type": "component",
"name": "fullEpisodeTitle",
"displayName": "展开选集标题",
"description": "总是完全展开视频选集列表的标题, 注意对番剧无效.",
"displayName": "选集区域优化",
"description": "提供一些视频选集区域的优化, 对番剧无效.\r\n- `展开选集标题`: 总是完全展开视频选集列表项的标题\r\n- `展开选集列表`: 总是完全展开视频选集列表\r\n\r\n打开 `展开选集列表` 时, 在选集区域的标题上按住 <kbd>Alt</kbd> 键点击可以临时切换展开/收起选集列表.\r\n",
"fullRelativePath": "../../registry/dist/components/video/full-episode-title.js",
"fullAbsolutePath": "registry/dist/components/video/full-episode-title.js"
},

View File

@ -725,23 +725,18 @@ by [@kdxcxs](https://github.com/kdxcxs)
总是展开完整的视频简介.
### [展开选集列表](../../registry/dist/components/video/full-episode-list.js)
`fullEpisodeTitle`
**AltCdn:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/video/full-episode-list.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/video/full-episode-list.js)
**GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/video/full-episode-list.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/video/full-episode-list.js)
总是完全展开视频选集列表, 注意对番剧无效.
### [展开选集标题](../../registry/dist/components/video/full-episode-title.js)
### [选集区域优化](../../registry/dist/components/video/full-episode-title.js)
`fullEpisodeTitle`
**AltCdn:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/video/full-episode-title.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/video/full-episode-title.js)
**GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/video/full-episode-title.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/video/full-episode-title.js)
总是完全展开视频选集列表的标题, 注意对番剧无效.
提供一些视频选集区域的优化, 对番剧无效.
- `展开选集标题`: 总是完全展开视频选集列表项的标题
- `展开选集列表`: 总是完全展开视频选集列表
打开 `展开选集列表` 时, 在选集区域的标题上按住 <kbd>Alt</kbd> 键点击可以临时切换展开/收起选集列表.
### [外置稍后再看](../../registry/dist/components/video/outer-watchlater.js)
`outerWatchlater`

View File

@ -1,9 +0,0 @@
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["video/full-episode-list"]=e():t["video/full-episode-list"]=e()}(self,(function(){return function(){var t,e,n={618:function(t,e,n){var o=n(355)((function(t){return t[1]}));o.push([t.id,".video-sections-content-list {\n max-height: unset !important;\n height: auto !important;\n}\n.video-sections-content-list .video-section-list {\n height: auto !important;\n}",""]),t.exports=o},355:function(t){"use strict";
// eslint-disable-next-line func-names
t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},
// eslint-disable-next-line func-names
e.i=function(t,n,o){"string"==typeof t&&(
// eslint-disable-next-line no-param-reassign
t=[[null,t,""]]);var r={};if(o)for(var i=0;i<this.length;i++){
// eslint-disable-next-line prefer-destructuring
var c=this[i][0];null!=c&&(r[c]=!0)}for(var u=0;u<t.length;u++){var s=[].concat(t[u]);o&&r[s[0]]||(n&&(s[2]?s[2]="".concat(n," and ").concat(s[2]):s[2]=n),e.push(s))}},e}},380:function(t,e,n){var o=n(618);o&&o.__esModule&&(o=o.default),t.exports="string"==typeof o?o:o.toString()},599:function(t){function e(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}e.keys=function(){return[]},e.resolve=e,e.id=599,t.exports=e},284:function(t){"use strict";t.exports="总是完全展开视频选集列表, 注意对番剧无效.\r\n"}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var i=o[t]={id:t,exports:{}};return n[t](i,i.exports,r),i.exports}e=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"==typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"==typeof n.then)return n}var i=Object.create(null);r.r(i);var c={};t=t||[null,e({}),e([]),e(e)];for(var u=2&o&&n;"object"==typeof u&&!~t.indexOf(u);u=e(u))Object.getOwnPropertyNames(u).forEach((function(t){c[t]=function(){return n[t]}}));return c.default=function(){return n},r.d(i,c),i},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){"use strict";r.d(i,{component:function(){return o}});var t=coreApis.componentApis.define,e=coreApis.utils.urls;const n="fullEpisodeTitle",o=(0,t.defineComponentMetadata)({name:n,instantStyles:[{name:n,style:()=>Promise.resolve().then(r.t.bind(r,380,23))}],entry:none,displayName:"展开选集列表",tags:[componentsTags.video,componentsTags.style],urlInclude:e.videoUrls,commitHash:"d8dd1116163cf72b4b88081e0b3ed38ec4a619c3",coreVersion:"2.5.0",description:(()=>{const t=r(599);return{...Object.fromEntries(t.keys().map((e=>[e.match(/index\.(.+)\.md$/)[1],t(e)]))),"zh-CN":()=>Promise.resolve().then(r.t.bind(r,284,17)).then((t=>t.default))}})()})}(),i=i.component}()}));

View File

@ -1,9 +1,9 @@
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["video/full-episode-title"]=e():t["video/full-episode-title"]=e()}(self,(function(){return function(){var t,e,n={330:function(t,e,n){var o=n(355)((function(t){return t[1]}));o.push([t.id,".multi-page .cur-list ul {\n max-height: none !important;\n}\n.multi-page .cur-list li {\n height: auto !important;\n}\n.multi-page .cur-list li a {\n overflow: visible !important;\n white-space: normal !important;\n}",""]),t.exports=o},355:function(t){"use strict";
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["video/full-episode-title"]=t():e["video/full-episode-title"]=t()}(self,(function(){return function(){var e,t,i={489:function(e,t,i){var o=i(355)((function(e){return e[1]}));o.push([e.id,"body.full-episode-title .base-video-sections-v1 .video-episode-card {\n height: auto !important;\n}\nbody.full-episode-title .base-video-sections-v1 .video-episode-card .cur-play-icon {\n margin-right: 6px;\n}\nbody.full-episode-title .base-video-sections-v1 .video-episode-card__info {\n height: auto !important;\n}\nbody.full-episode-title .base-video-sections-v1 .video-episode-card__info-title {\n padding: 4px 0 !important;\n width: auto !important;\n max-height: unset !important;\n height: auto !important;\n white-space: normal !important;\n line-height: 1.5 !important;\n}\nbody.full-episode-title .multi-page-v1 .cur-list li,\nbody.full-episode-title .multi-page .cur-list li {\n height: auto !important;\n}\nbody.full-episode-title .multi-page-v1 .cur-list li a,\nbody.full-episode-title .multi-page .cur-list li a {\n overflow: visible !important;\n white-space: normal !important;\n}\nbody.full-episode-title .multi-page-v1 .cur-list li .part,\nbody.full-episode-title .multi-page .cur-list li .part {\n padding: 4px 0 !important;\n line-height: 1.75 !important;\n}\nbody.full-episode-title .multi-page-v1 .cur-list li .duration,\nbody.full-episode-title .multi-page .cur-list li .duration {\n align-self: center !important;\n}\nbody.full-episode-list:not(.disable-full-episode-list) .video-sections-content-list {\n max-height: unset !important;\n height: auto !important;\n}\nbody.full-episode-list:not(.disable-full-episode-list) .video-sections-content-list .video-section-list {\n height: auto !important;\n}\nbody.full-episode-list:not(.disable-full-episode-list) .multi-page-v1 .head-left h3,\nbody.full-episode-list:not(.disable-full-episode-list) .multi-page .head-left h3 {\n cursor: pointer;\n}\nbody.full-episode-list:not(.disable-full-episode-list) .multi-page-v1 .cur-list,\nbody.full-episode-list:not(.disable-full-episode-list) .multi-page .cur-list {\n max-height: unset !important;\n}\nbody.full-episode-list:not(.disable-full-episode-list) .multi-page-v1 .cur-list ul,\nbody.full-episode-list:not(.disable-full-episode-list) .multi-page .cur-list ul {\n max-height: unset !important;\n}",""]),e.exports=o},355:function(e){"use strict";
// eslint-disable-next-line func-names
t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},
e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},
// eslint-disable-next-line func-names
e.i=function(t,n,o){"string"==typeof t&&(
t.i=function(e,i,o){"string"==typeof e&&(
// eslint-disable-next-line no-param-reassign
t=[[null,t,""]]);var r={};if(o)for(var i=0;i<this.length;i++){
e=[[null,e,""]]);var n={};if(o)for(var l=0;l<this.length;l++){
// eslint-disable-next-line prefer-destructuring
var u=this[i][0];null!=u&&(r[u]=!0)}for(var c=0;c<t.length;c++){var f=[].concat(t[c]);o&&r[f[0]]||(n&&(f[2]?f[2]="".concat(n," and ").concat(f[2]):f[2]=n),e.push(f))}},e}},920:function(t,e,n){var o=n(330);o&&o.__esModule&&(o=o.default),t.exports="string"==typeof o?o:o.toString()}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var i=o[t]={id:t,exports:{}};return n[t](i,i.exports,r),i.exports}e=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"==typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"==typeof n.then)return n}var i=Object.create(null);r.r(i);var u={};t=t||[null,e({}),e([]),e(e)];for(var c=2&o&&n;"object"==typeof c&&!~t.indexOf(c);c=e(c))Object.getOwnPropertyNames(c).forEach((function(t){u[t]=function(){return n[t]}}));return u.default=function(){return n},r.d(i,u),i},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){"use strict";r.d(i,{component:function(){return o}});var t=coreApis.componentApis.styledComponent,e=coreApis.componentApis.define,n=coreApis.utils.urls;const o=(0,e.defineComponentMetadata)({...(0,t.toggleStyle)("fullEpisodeTitle",(()=>Promise.resolve().then(r.t.bind(r,920,23)))),displayName:"展开选集标题",description:{"zh-CN":"总是完全展开视频选集列表的标题, 注意对番剧无效."},tags:[componentsTags.video],urlInclude:n.videoUrls,commitHash:"d8dd1116163cf72b4b88081e0b3ed38ec4a619c3",coreVersion:"2.5.0"})}(),i=i.component}()}));
var s=this[l][0];null!=s&&(n[s]=!0)}for(var r=0;r<e.length;r++){var u=[].concat(e[r]);o&&n[u[0]]||(i&&(u[2]?u[2]="".concat(i," and ").concat(u[2]):u[2]=i),t.push(u))}},t}},249:function(e,t,i){var o=i(489);o&&o.__esModule&&(o=o.default),e.exports="string"==typeof o?o:o.toString()},365:function(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=365,e.exports=t},393:function(e){"use strict";e.exports="提供一些视频选集区域的优化, 对番剧无效.\r\n- `展开选集标题`: 总是完全展开视频选集列表项的标题\r\n- `展开选集列表`: 总是完全展开视频选集列表\r\n\r\n打开 `展开选集列表` 时, 在选集区域的标题上按住 <kbd>Alt</kbd> 键点击可以临时切换展开/收起选集列表.\r\n"}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var l=o[e]={id:e,exports:{}};return i[e](l,l.exports,n),l.exports}t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},n.t=function(i,o){if(1&o&&(i=this(i)),8&o)return i;if("object"==typeof i&&i){if(4&o&&i.__esModule)return i;if(16&o&&"function"==typeof i.then)return i}var l=Object.create(null);n.r(l);var s={};e=e||[null,t({}),t([]),t(t)];for(var r=2&o&&i;"object"==typeof r&&!~e.indexOf(r);r=t(r))Object.getOwnPropertyNames(r).forEach((function(e){s[e]=function(){return i[e]}}));return s.default=function(){return i},n.d(l,s),l},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return function(){"use strict";n.d(l,{component:function(){return r}});var e=coreApis.componentApis.define,t=coreApis.utils.urls,i=coreApis.settings,o=coreApis.spinQuery;const s="fullEpisodeTitle",r=(0,e.defineComponentMetadata)({name:s,instantStyles:[{name:s,style:()=>Promise.resolve().then(n.t.bind(n,249,23))}],options:{fullEpisodeTitle:{defaultValue:!0,displayName:"展开选集标题"},fullEpisodeList:{defaultValue:!0,displayName:"展开选集列表"}},entry:e=>{let{metadata:{options:t}}=e;Object.keys(t).forEach((e=>{(0,i.addComponentListener)(`fullEpisodeTitle.${e}`,(t=>{document.body.classList.toggle(lodash.kebabCase(e),t)}),!0)})),t.fullEpisodeList&&Promise.race([(0,o.select)(".multi-page-v1 .head-left h3"),(0,o.select)(".base-video-sections-v1 .first-line-title")]).then((e=>{e.addEventListener("click",(e=>{e.altKey&&0===e.button&&(document.body.classList.toggle("disable-full-episode-list"),e.preventDefault(),e.stopImmediatePropagation())}),{capture:!0})}))},displayName:"选集区域优化",tags:[componentsTags.video],urlInclude:t.videoUrls,commitHash:"b56d7b482af639ec27d1ddc6c9935281b5a77924",coreVersion:"2.5.1",description:(()=>{const e=n(365);return{...Object.fromEntries(e.keys().map((t=>[t.match(/index\.(.+)\.md$/)[1],e(t)]))),"zh-CN":()=>Promise.resolve().then(n.t.bind(n,393,17)).then((e=>e.default))}})()})}(),l=l.component}()}));

41
registry/dist/doc.js vendored

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,8 @@ import { ComponentMetadata } from '@/components/types'
import { addComponentListener, getComponentSettings } from '@/core/settings'
import { sq } from '@/core/spin-query'
import { addStyle } from '@/core/style'
import { getCookieValue } from '@/core/utils'
import { getCookieValue, matchUrlPattern } from '@/core/utils'
import { useScopedConsole } from '@/core/utils/log'
import { mainSiteUrls } from '@/core/utils/urls'
const switchOptions: SwitchOptions = {
@ -44,6 +45,7 @@ const switchOptions: SwitchOptions = {
},
},
}
const console = useScopedConsole('简化首页')
const metadata: ComponentMetadata = {
name: 'simplifyHome',
displayName: '简化首页',
@ -58,10 +60,12 @@ const metadata: ComponentMetadata = {
tags: [componentsTags.style],
entry: async () => {
// 正好是首页时提供首页分区的简化选项
if (document.URL !== 'https://www.bilibili.com/') {
const isHome = matchUrlPattern('https://www.bilibili.com/')
if (!isHome) {
return
}
console.log('isHome', isHome)
const { options } = getComponentSettings(metadata.name)
const isNewHome = getCookieValue('i-wanna-go-back') === '-1'
type SimplifyHomeOption = {
@ -69,11 +73,10 @@ const metadata: ComponentMetadata = {
defaultValue: boolean
}
const generatedOptions: Record<string, SimplifyHomeOption> = await (async () => {
const isNotHome = document.URL !== 'https://www.bilibili.com/'
if (!isNewHome) {
const categoryElements = await sq(
() => dqa('.proxy-box > div'),
elements => elements.length > 0 || isNotHome,
elements => elements.length > 0 || !isHome,
)
return Object.fromEntries(
categoryElements.map(it => [
@ -89,7 +92,7 @@ const metadata: ComponentMetadata = {
const skipIds = ['推广']
const headers = await sq(
() => dqa('.bili-grid .the-world'),
elements => elements.length > 3 || isNotHome,
elements => elements.length > 3 || !isHome,
)
console.log(headers)
const getContainer = (header: Element) => {

View File

@ -1,7 +0,0 @@
.video-sections-content-list {
max-height: unset !important;
height: auto !important;
.video-section-list {
height: auto !important;
}
}

View File

@ -1 +0,0 @@
总是完全展开视频选集列表, 注意对番剧无效.

View File

@ -1,17 +0,0 @@
import { defineComponentMetadata } from '@/components/define'
import { videoUrls } from '@/core/utils/urls'
const name = 'fullEpisodeTitle'
export const component = defineComponentMetadata({
name,
instantStyles: [
{
name,
style: () => import('./full-episode-list.scss'),
},
],
entry: none,
displayName: '展开选集列表',
tags: [componentsTags.video, componentsTags.style],
urlInclude: videoUrls,
})

View File

@ -1,12 +1,63 @@
.multi-page .cur-list {
ul {
max-height: none !important;
body {
&.full-episode-title {
.base-video-sections-v1 {
.video-episode-card {
height: auto !important;
.cur-play-icon {
margin-right: 6px;
}
&__info {
height: auto !important;
}
&__info-title {
padding: 4px 0 !important;
width: auto !important;
max-height: unset !important;
height: auto !important;
white-space: normal !important;
line-height: 1.5 !important;
}
}
}
.multi-page-v1,
.multi-page {
.cur-list {
li {
height: auto !important;
a {
overflow: visible !important;
white-space: normal !important;
}
.part {
padding: 4px 0 !important;
line-height: 1.75 !important;
}
.duration {
align-self: center !important;
}
}
}
}
}
li {
height: auto !important;
a {
overflow: visible !important;
white-space: normal !important;
&.full-episode-list:not(.disable-full-episode-list) {
.video-sections-content-list {
max-height: unset !important;
height: auto !important;
.video-section-list {
height: auto !important;
}
}
.multi-page-v1,
.multi-page {
.head-left h3 {
cursor: pointer;
}
.cur-list {
max-height: unset !important;
ul {
max-height: unset !important;
}
}
}
}
}

View File

@ -0,0 +1,5 @@
提供一些视频选集区域的优化, 对番剧无效.
- `展开选集标题`: 总是完全展开视频选集列表项的标题
- `展开选集列表`: 总是完全展开视频选集列表
打开 `展开选集列表` 时, 在选集区域的标题上按住 <kbd>Alt</kbd> 键点击可以临时切换展开/收起选集列表.

View File

@ -1,13 +1,60 @@
import { toggleStyle } from '@/components/styled-component'
import { defineComponentMetadata } from '@/components/define'
import { videoUrls } from '@/core/utils/urls'
import { addComponentListener } from '@/core/settings'
import { select } from '@/core/spin-query'
const name = 'fullEpisodeTitle'
export const component = defineComponentMetadata({
...toggleStyle('fullEpisodeTitle', () => import('./full-episode-title.scss')),
displayName: '展开选集标题',
description: {
'zh-CN': '总是完全展开视频选集列表的标题, 注意对番剧无效.',
name,
instantStyles: [
{
name,
style: () => import('./full-episode-title.scss'),
},
],
options: {
fullEpisodeTitle: {
defaultValue: true,
displayName: '展开选集标题',
},
fullEpisodeList: {
defaultValue: true,
displayName: '展开选集列表',
},
},
entry: ({ metadata: { options } }) => {
Object.keys(options).forEach(key => {
addComponentListener(
`${name}.${key}`,
(value: boolean) => {
document.body.classList.toggle(lodash.kebabCase(key), value)
},
true,
)
})
if (!options.fullEpisodeList) {
return
}
Promise.race([
select('.multi-page-v1 .head-left h3'),
select('.base-video-sections-v1 .first-line-title'),
]).then(titleElement => {
titleElement.addEventListener(
'click',
(e: MouseEvent) => {
// Alt + 左键点击才能触发
if (!e.altKey || e.button !== 0) {
return
}
document.body.classList.toggle('disable-full-episode-list')
e.preventDefault()
e.stopImmediatePropagation()
},
{ capture: true },
)
})
},
displayName: '选集区域优化',
tags: [componentsTags.video],
urlInclude: videoUrls,
})

View File

@ -1,5 +1,5 @@
{
"version": "2.5.0",
"version": "2.5.1",
"author": "Grant Howard, Coulomb-G",
"copyright": "[year], Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)",
"license": "MIT",

View File

@ -19,7 +19,7 @@ export const initMdiStyle = () => {
const cssPromise = new Promise<void>(resolve => {
mdi.onload = () => resolve()
})
Promise.all([cssPromise, webFontPromise]).then(() => {
Promise.allSettled([cssPromise, webFontPromise]).then(() => {
mdi.media = 'all'
})