Skip to content

Commit

Permalink
chore: update live page search bar, video page simple share
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Dec 31, 2023
1 parent 401d01d commit ccf40f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/pages/live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,12 @@ if (location.host === 'live.bilibili.com') {
}
liveGroupList.push(new Group('live-header-left', '顶栏 左侧', headerLeftItems))

// 顶栏中间part, headerCenterItems
// 顶栏中间part, 同步通用设定的顶栏搜索框状态, headerCenterItems
{
// 隐藏 搜索框 推荐搜索
headerCenterItems.push(
new NormalItem(
'live-page-header-search-block-placeholder',
'common-hide-nav-search-rcmd',
'隐藏 搜索框 推荐搜索',
false,
undefined,
Expand All @@ -781,7 +781,7 @@ if (location.host === 'live.bilibili.com') {
// 隐藏 搜索框 搜索历史
headerCenterItems.push(
new NormalItem(
'live-page-header-search-history',
'common-hide-nav-search-history',
'隐藏 搜索框 搜索历史',
false,
undefined,
Expand All @@ -792,7 +792,7 @@ if (location.host === 'live.bilibili.com') {
// 隐藏 搜索框 bilibili热搜
headerCenterItems.push(
new NormalItem(
'live-page-header-search-trending',
'common-hide-nav-search-trending',
'隐藏 搜索框 bilibili热搜',
false,
undefined,
Expand Down
5 changes: 4 additions & 1 deletion src/pages/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ function simpleShare() {
// 若replace element, 会在切换视频后无法更新视频分享数量, 故直接新增click事件覆盖剪贴板
shareBtn.addEventListener('click', () => {
let title = document.querySelector('#viewbox_report > h1')?.textContent as string
if (!'(({【[[《「<{〔〖<〈『'.includes(title[0])) {
if (
!'(({【[[《「<{〔〖<〈『'.includes(title[0]) ||
'))}】]]》」>}〕〗>〉』'.includes(title.slice(-1))
) {
title = `【${title}】`
}
let urlPath = location.pathname
Expand Down

0 comments on commit ccf40f2

Please sign in to comment.