Skip to content

Commit

Permalink
feat: run itemFunc when label checked
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Jan 1, 2024
1 parent 6aa38e9 commit 53b6414
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 优化:首页 隐藏下载桌面端弹窗 改为默认开启
- 优化:全屏下隐藏弹幕输入框
- 优化:用户开启开关时执行功能函数

## 2.2.1

Expand Down
3 changes: 3 additions & 0 deletions src/core/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ export class NormalItem implements IItem {
if ((<HTMLInputElement>event.target).checked) {
this.setStatus(true)
this.insertItemCSS()
if (this.itemFunc !== undefined) {
this.itemFunc()
}
} else {
this.setStatus(false)
this.removeItemCSS()
Expand Down
22 changes: 11 additions & 11 deletions src/pages/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,6 @@ if (location.href.startsWith('https://www.bilibili.com/video/')) {
`.bpx-player-video-area .bili-link {display: none !important;}`,
),
)
// 隐藏 右上角 反馈按钮, 默认开启
playerItems.push(
new NormalItem(
'video-page-hide-bpx-player-top-issue',
'隐藏 右上角 反馈按钮',
true,
undefined,
false,
`.bpx-player-top-issue {display: none !important;}`,
),
)
// 隐藏 左上角 播放器内标题
playerItems.push(
new NormalItem(
Expand Down Expand Up @@ -299,6 +288,17 @@ if (location.href.startsWith('https://www.bilibili.com/video/')) {
`.bpx-player-top-left-follow {display: none !important;}`,
),
)
// 隐藏 右上角 反馈按钮, 默认开启
playerItems.push(
new NormalItem(
'video-page-hide-bpx-player-top-issue',
'隐藏 右上角 反馈按钮',
true,
undefined,
false,
`.bpx-player-top-issue {display: none !important;}`,
),
)
// 隐藏 视频暂停时大Logo
playerItems.push(
new NormalItem(
Expand Down

0 comments on commit 53b6414

Please sign in to comment.