Refactor reloadables manifest

This commit is contained in:
the1812 2019-09-25 14:55:32 +08:00
parent d944269777
commit 1f8569b89c
6 changed files with 225 additions and 105 deletions

View File

@ -573,31 +573,35 @@ function loadResources () {
Resource.root = 'https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/'
Resource.all = {}
Resource.displayNames = {}
Resource.reloadables = [
'useDarkStyle',
'hideBanner',
'customNavbar',
'playerShadow',
'narrowDanmaku',
'compactLayout',
'useCommentStyle',
'removeVideoTopMask',
'hideOldEntry',
'hideBangumiReviews',
'videoScreenshot',
'blurVideoControl',
'customControlBackground',
'harunaScale',
'removeLiveWatermark',
'framePlayback',
'hideCategory',
'fullTweetsTitle',
'fullActivityContent',
]
// Resource.reloadables = [
// 'useDarkStyle',
// 'hideBanner',
// 'customNavbar',
// 'playerShadow',
// 'narrowDanmaku',
// 'compactLayout',
// 'useCommentStyle',
// 'removeVideoTopMask',
// 'hideOldEntry',
// 'hideBangumiReviews',
// 'videoScreenshot',
// 'blurVideoControl',
// 'customControlBackground',
// 'harunaScale',
// 'removeLiveWatermark',
// 'framePlayback',
// 'hideCategory',
// 'fullTweetsTitle',
// 'fullActivityContent',
// ]
Resource.reloadables = []
for (const [key, data] of Object.entries(Resource.manifest)) {
const resource = new Resource(data.path, { styles: data.styles, alwaysPreview: data.alwaysPreview })
resource.key = key
resource.dropdown = data.dropdown
if (data.reloadable) {
Resource.reloadables.push(key)
}
if (data.displayNames) {
resource.displayName = data.displayNames[key]
Object.assign(Resource.displayNames, data.displayNames)
@ -1399,6 +1403,7 @@ Resource.manifest = {
},
useDarkStyle: {
path: 'dark-styles.min.js',
reloadable: true,
alwaysPreview: true,
styles: [
'darkStyle',
@ -1446,6 +1451,7 @@ Resource.manifest = {
},
hideBanner: {
path: 'hide-banner.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideBanner: '隐藏顶部横幅'
@ -1496,18 +1502,21 @@ Resource.manifest = {
},
harunaScale: {
path: 'haruna-scale.min.js',
reloadable: true,
displayNames: {
harunaScale: '缩放直播看板娘'
}
},
removeLiveWatermark: {
path: 'remove-watermark.min.js',
reloadable: true,
displayNames: {
removeLiveWatermark: '删除直播水印'
}
},
fullTweetsTitle: {
path: 'full-tweets-title.min.js',
reloadable: true,
style: 'instant',
displayNames: {
fullTweetsTitle: '展开动态标题'
@ -1550,12 +1559,14 @@ Resource.manifest = {
},
removeVideoTopMask: {
path: 'remove-top-mask.min.js',
reloadable: true,
displayNames: {
removeVideoTopMask: '删除视频标题层'
}
},
blurVideoControl: {
path: 'blur-video-control.min.js',
reloadable: true,
style: 'instant',
displayNames: {
blurVideoControl: '模糊视频控制栏背景'
@ -1617,6 +1628,7 @@ Resource.manifest = {
},
customControlBackground: {
path: 'custom-control-background.min.js',
reloadable: true,
style: {
key: 'customControlBackgroundStyle',
condition: () => settings.customControlBackgroundOpacity > 0
@ -1714,6 +1726,7 @@ Resource.manifest = {
},
compactLayout: {
path: 'compact-layout.min.js',
reloadable: true,
style: true,
displayNames: {
compactLayout: '首页使用紧凑布局'
@ -1747,6 +1760,7 @@ Resource.manifest = {
},
useCommentStyle: {
path: 'comment.min.js',
reloadable: true,
style: 'important',
displayNames: {
useCommentStyle: '简化评论区'
@ -1772,6 +1786,7 @@ Resource.manifest = {
},
framePlayback: {
path: 'frame-playback.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -1836,6 +1851,7 @@ Resource.manifest = {
},
customNavbar: {
path: 'custom-navbar.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -1864,24 +1880,28 @@ Resource.manifest = {
},
playerShadow: {
path: 'player-shadow.min.js',
reloadable: true,
displayNames: {
playerShadow: '播放器投影'
}
},
narrowDanmaku: {
path: 'narrow-danmaku.min.js',
reloadable: true,
displayNames: {
narrowDanmaku: '强制保留弹幕栏'
}
},
hideOldEntry: {
path: 'hide-old-entry.min.js',
reloadable: true,
displayNames: {
hideOldEntry: '隐藏返回旧版'
}
},
videoScreenshot: {
path: 'screenshot.min.js',
reloadable: true,
style: true,
displayNames: {
videoScreenshot: '启用视频截图'
@ -1892,6 +1912,7 @@ Resource.manifest = {
},
hideBangumiReviews: {
path: 'hide-bangumi-reviews.min.js',
reloadable: true,
displayNames: {
hideBangumiReviews: '隐藏番剧点评'
}
@ -1911,6 +1932,7 @@ Resource.manifest = {
},
hideCategory: {
path: 'hide-category.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideCategory: '隐藏分区栏',
@ -1974,6 +1996,7 @@ Resource.manifest = {
},
fullActivityContent: {
path: 'full-activity-content.min.js',
reloadable: true,
displayNames: {
fullActivityContent: '展开动态内容',
},
@ -1986,6 +2009,7 @@ Resource.manifest = {
},
selectableColumnText: {
path: 'selectable-column-text.min.js',
reloadable: true,
displayNames: {
selectableColumnText: '专栏文字选择',
},

View File

@ -573,31 +573,35 @@ function loadResources () {
Resource.root = 'https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/'
Resource.all = {}
Resource.displayNames = {}
Resource.reloadables = [
'useDarkStyle',
'hideBanner',
'customNavbar',
'playerShadow',
'narrowDanmaku',
'compactLayout',
'useCommentStyle',
'removeVideoTopMask',
'hideOldEntry',
'hideBangumiReviews',
'videoScreenshot',
'blurVideoControl',
'customControlBackground',
'harunaScale',
'removeLiveWatermark',
'framePlayback',
'hideCategory',
'fullTweetsTitle',
'fullActivityContent',
]
// Resource.reloadables = [
// 'useDarkStyle',
// 'hideBanner',
// 'customNavbar',
// 'playerShadow',
// 'narrowDanmaku',
// 'compactLayout',
// 'useCommentStyle',
// 'removeVideoTopMask',
// 'hideOldEntry',
// 'hideBangumiReviews',
// 'videoScreenshot',
// 'blurVideoControl',
// 'customControlBackground',
// 'harunaScale',
// 'removeLiveWatermark',
// 'framePlayback',
// 'hideCategory',
// 'fullTweetsTitle',
// 'fullActivityContent',
// ]
Resource.reloadables = []
for (const [key, data] of Object.entries(Resource.manifest)) {
const resource = new Resource(data.path, { styles: data.styles, alwaysPreview: data.alwaysPreview })
resource.key = key
resource.dropdown = data.dropdown
if (data.reloadable) {
Resource.reloadables.push(key)
}
if (data.displayNames) {
resource.displayName = data.displayNames[key]
Object.assign(Resource.displayNames, data.displayNames)
@ -1399,6 +1403,7 @@ Resource.manifest = {
},
useDarkStyle: {
path: 'dark-styles.min.js',
reloadable: true,
alwaysPreview: true,
styles: [
'darkStyle',
@ -1446,6 +1451,7 @@ Resource.manifest = {
},
hideBanner: {
path: 'hide-banner.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideBanner: '隐藏顶部横幅'
@ -1496,18 +1502,21 @@ Resource.manifest = {
},
harunaScale: {
path: 'haruna-scale.min.js',
reloadable: true,
displayNames: {
harunaScale: '缩放直播看板娘'
}
},
removeLiveWatermark: {
path: 'remove-watermark.min.js',
reloadable: true,
displayNames: {
removeLiveWatermark: '删除直播水印'
}
},
fullTweetsTitle: {
path: 'full-tweets-title.min.js',
reloadable: true,
style: 'instant',
displayNames: {
fullTweetsTitle: '展开动态标题'
@ -1550,12 +1559,14 @@ Resource.manifest = {
},
removeVideoTopMask: {
path: 'remove-top-mask.min.js',
reloadable: true,
displayNames: {
removeVideoTopMask: '删除视频标题层'
}
},
blurVideoControl: {
path: 'blur-video-control.min.js',
reloadable: true,
style: 'instant',
displayNames: {
blurVideoControl: '模糊视频控制栏背景'
@ -1617,6 +1628,7 @@ Resource.manifest = {
},
customControlBackground: {
path: 'custom-control-background.min.js',
reloadable: true,
style: {
key: 'customControlBackgroundStyle',
condition: () => settings.customControlBackgroundOpacity > 0
@ -1714,6 +1726,7 @@ Resource.manifest = {
},
compactLayout: {
path: 'compact-layout.min.js',
reloadable: true,
style: true,
displayNames: {
compactLayout: '首页使用紧凑布局'
@ -1747,6 +1760,7 @@ Resource.manifest = {
},
useCommentStyle: {
path: 'comment.min.js',
reloadable: true,
style: 'important',
displayNames: {
useCommentStyle: '简化评论区'
@ -1772,6 +1786,7 @@ Resource.manifest = {
},
framePlayback: {
path: 'frame-playback.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -1836,6 +1851,7 @@ Resource.manifest = {
},
customNavbar: {
path: 'custom-navbar.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -1864,24 +1880,28 @@ Resource.manifest = {
},
playerShadow: {
path: 'player-shadow.min.js',
reloadable: true,
displayNames: {
playerShadow: '播放器投影'
}
},
narrowDanmaku: {
path: 'narrow-danmaku.min.js',
reloadable: true,
displayNames: {
narrowDanmaku: '强制保留弹幕栏'
}
},
hideOldEntry: {
path: 'hide-old-entry.min.js',
reloadable: true,
displayNames: {
hideOldEntry: '隐藏返回旧版'
}
},
videoScreenshot: {
path: 'screenshot.min.js',
reloadable: true,
style: true,
displayNames: {
videoScreenshot: '启用视频截图'
@ -1892,6 +1912,7 @@ Resource.manifest = {
},
hideBangumiReviews: {
path: 'hide-bangumi-reviews.min.js',
reloadable: true,
displayNames: {
hideBangumiReviews: '隐藏番剧点评'
}
@ -1911,6 +1932,7 @@ Resource.manifest = {
},
hideCategory: {
path: 'hide-category.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideCategory: '隐藏分区栏',
@ -1974,6 +1996,7 @@ Resource.manifest = {
},
fullActivityContent: {
path: 'full-activity-content.min.js',
reloadable: true,
displayNames: {
fullActivityContent: '展开动态内容',
},
@ -1986,6 +2009,7 @@ Resource.manifest = {
},
selectableColumnText: {
path: 'selectable-column-text.min.js',
reloadable: true,
displayNames: {
selectableColumnText: '专栏文字选择',
},

View File

@ -572,31 +572,35 @@ function loadResources () {
Resource.root = 'https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/'
Resource.all = {}
Resource.displayNames = {}
Resource.reloadables = [
'useDarkStyle',
'hideBanner',
'customNavbar',
'playerShadow',
'narrowDanmaku',
'compactLayout',
'useCommentStyle',
'removeVideoTopMask',
'hideOldEntry',
'hideBangumiReviews',
'videoScreenshot',
'blurVideoControl',
'customControlBackground',
'harunaScale',
'removeLiveWatermark',
'framePlayback',
'hideCategory',
'fullTweetsTitle',
'fullActivityContent',
]
// Resource.reloadables = [
// 'useDarkStyle',
// 'hideBanner',
// 'customNavbar',
// 'playerShadow',
// 'narrowDanmaku',
// 'compactLayout',
// 'useCommentStyle',
// 'removeVideoTopMask',
// 'hideOldEntry',
// 'hideBangumiReviews',
// 'videoScreenshot',
// 'blurVideoControl',
// 'customControlBackground',
// 'harunaScale',
// 'removeLiveWatermark',
// 'framePlayback',
// 'hideCategory',
// 'fullTweetsTitle',
// 'fullActivityContent',
// ]
Resource.reloadables = []
for (const [key, data] of Object.entries(Resource.manifest)) {
const resource = new Resource(data.path, { styles: data.styles, alwaysPreview: data.alwaysPreview })
resource.key = key
resource.dropdown = data.dropdown
if (data.reloadable) {
Resource.reloadables.push(key)
}
if (data.displayNames) {
resource.displayName = data.displayNames[key]
Object.assign(Resource.displayNames, data.displayNames)
@ -1452,6 +1456,7 @@ Resource.manifest = {
},
useDarkStyle: {
path: 'dark-styles.min.js',
reloadable: true,
alwaysPreview: true,
styles: [
'darkStyle',
@ -1499,6 +1504,7 @@ Resource.manifest = {
},
hideBanner: {
path: 'hide-banner.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideBanner: '隐藏顶部横幅'
@ -1549,18 +1555,21 @@ Resource.manifest = {
},
harunaScale: {
path: 'haruna-scale.min.js',
reloadable: true,
displayNames: {
harunaScale: '缩放直播看板娘'
}
},
removeLiveWatermark: {
path: 'remove-watermark.min.js',
reloadable: true,
displayNames: {
removeLiveWatermark: '删除直播水印'
}
},
fullTweetsTitle: {
path: 'full-tweets-title.min.js',
reloadable: true,
style: 'instant',
displayNames: {
fullTweetsTitle: '展开动态标题'
@ -1603,12 +1612,14 @@ Resource.manifest = {
},
removeVideoTopMask: {
path: 'remove-top-mask.min.js',
reloadable: true,
displayNames: {
removeVideoTopMask: '删除视频标题层'
}
},
blurVideoControl: {
path: 'blur-video-control.min.js',
reloadable: true,
style: 'instant',
displayNames: {
blurVideoControl: '模糊视频控制栏背景'
@ -1670,6 +1681,7 @@ Resource.manifest = {
},
customControlBackground: {
path: 'custom-control-background.min.js',
reloadable: true,
style: {
key: 'customControlBackgroundStyle',
condition: () => settings.customControlBackgroundOpacity > 0
@ -1767,6 +1779,7 @@ Resource.manifest = {
},
compactLayout: {
path: 'compact-layout.min.js',
reloadable: true,
style: true,
displayNames: {
compactLayout: '首页使用紧凑布局'
@ -1800,6 +1813,7 @@ Resource.manifest = {
},
useCommentStyle: {
path: 'comment.min.js',
reloadable: true,
style: 'important',
displayNames: {
useCommentStyle: '简化评论区'
@ -1825,6 +1839,7 @@ Resource.manifest = {
},
framePlayback: {
path: 'frame-playback.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -1889,6 +1904,7 @@ Resource.manifest = {
},
customNavbar: {
path: 'custom-navbar.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -1917,24 +1933,28 @@ Resource.manifest = {
},
playerShadow: {
path: 'player-shadow.min.js',
reloadable: true,
displayNames: {
playerShadow: '播放器投影'
}
},
narrowDanmaku: {
path: 'narrow-danmaku.min.js',
reloadable: true,
displayNames: {
narrowDanmaku: '强制保留弹幕栏'
}
},
hideOldEntry: {
path: 'hide-old-entry.min.js',
reloadable: true,
displayNames: {
hideOldEntry: '隐藏返回旧版'
}
},
videoScreenshot: {
path: 'screenshot.min.js',
reloadable: true,
style: true,
displayNames: {
videoScreenshot: '启用视频截图'
@ -1945,6 +1965,7 @@ Resource.manifest = {
},
hideBangumiReviews: {
path: 'hide-bangumi-reviews.min.js',
reloadable: true,
displayNames: {
hideBangumiReviews: '隐藏番剧点评'
}
@ -1964,6 +1985,7 @@ Resource.manifest = {
},
hideCategory: {
path: 'hide-category.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideCategory: '隐藏分区栏',
@ -2027,6 +2049,7 @@ Resource.manifest = {
},
fullActivityContent: {
path: 'full-activity-content.min.js',
reloadable: true,
displayNames: {
fullActivityContent: '展开动态内容',
},
@ -2039,6 +2062,7 @@ Resource.manifest = {
},
selectableColumnText: {
path: 'selectable-column-text.min.js',
reloadable: true,
displayNames: {
selectableColumnText: '专栏文字选择',
},

View File

@ -572,31 +572,35 @@ function loadResources () {
Resource.root = 'https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/'
Resource.all = {}
Resource.displayNames = {}
Resource.reloadables = [
'useDarkStyle',
'hideBanner',
'customNavbar',
'playerShadow',
'narrowDanmaku',
'compactLayout',
'useCommentStyle',
'removeVideoTopMask',
'hideOldEntry',
'hideBangumiReviews',
'videoScreenshot',
'blurVideoControl',
'customControlBackground',
'harunaScale',
'removeLiveWatermark',
'framePlayback',
'hideCategory',
'fullTweetsTitle',
'fullActivityContent',
]
// Resource.reloadables = [
// 'useDarkStyle',
// 'hideBanner',
// 'customNavbar',
// 'playerShadow',
// 'narrowDanmaku',
// 'compactLayout',
// 'useCommentStyle',
// 'removeVideoTopMask',
// 'hideOldEntry',
// 'hideBangumiReviews',
// 'videoScreenshot',
// 'blurVideoControl',
// 'customControlBackground',
// 'harunaScale',
// 'removeLiveWatermark',
// 'framePlayback',
// 'hideCategory',
// 'fullTweetsTitle',
// 'fullActivityContent',
// ]
Resource.reloadables = []
for (const [key, data] of Object.entries(Resource.manifest)) {
const resource = new Resource(data.path, { styles: data.styles, alwaysPreview: data.alwaysPreview })
resource.key = key
resource.dropdown = data.dropdown
if (data.reloadable) {
Resource.reloadables.push(key)
}
if (data.displayNames) {
resource.displayName = data.displayNames[key]
Object.assign(Resource.displayNames, data.displayNames)
@ -1452,6 +1456,7 @@ Resource.manifest = {
},
useDarkStyle: {
path: 'dark-styles.min.js',
reloadable: true,
alwaysPreview: true,
styles: [
'darkStyle',
@ -1499,6 +1504,7 @@ Resource.manifest = {
},
hideBanner: {
path: 'hide-banner.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideBanner: '隐藏顶部横幅'
@ -1549,18 +1555,21 @@ Resource.manifest = {
},
harunaScale: {
path: 'haruna-scale.min.js',
reloadable: true,
displayNames: {
harunaScale: '缩放直播看板娘'
}
},
removeLiveWatermark: {
path: 'remove-watermark.min.js',
reloadable: true,
displayNames: {
removeLiveWatermark: '删除直播水印'
}
},
fullTweetsTitle: {
path: 'full-tweets-title.min.js',
reloadable: true,
style: 'instant',
displayNames: {
fullTweetsTitle: '展开动态标题'
@ -1603,12 +1612,14 @@ Resource.manifest = {
},
removeVideoTopMask: {
path: 'remove-top-mask.min.js',
reloadable: true,
displayNames: {
removeVideoTopMask: '删除视频标题层'
}
},
blurVideoControl: {
path: 'blur-video-control.min.js',
reloadable: true,
style: 'instant',
displayNames: {
blurVideoControl: '模糊视频控制栏背景'
@ -1670,6 +1681,7 @@ Resource.manifest = {
},
customControlBackground: {
path: 'custom-control-background.min.js',
reloadable: true,
style: {
key: 'customControlBackgroundStyle',
condition: () => settings.customControlBackgroundOpacity > 0
@ -1767,6 +1779,7 @@ Resource.manifest = {
},
compactLayout: {
path: 'compact-layout.min.js',
reloadable: true,
style: true,
displayNames: {
compactLayout: '首页使用紧凑布局'
@ -1800,6 +1813,7 @@ Resource.manifest = {
},
useCommentStyle: {
path: 'comment.min.js',
reloadable: true,
style: 'important',
displayNames: {
useCommentStyle: '简化评论区'
@ -1825,6 +1839,7 @@ Resource.manifest = {
},
framePlayback: {
path: 'frame-playback.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -1889,6 +1904,7 @@ Resource.manifest = {
},
customNavbar: {
path: 'custom-navbar.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -1917,24 +1933,28 @@ Resource.manifest = {
},
playerShadow: {
path: 'player-shadow.min.js',
reloadable: true,
displayNames: {
playerShadow: '播放器投影'
}
},
narrowDanmaku: {
path: 'narrow-danmaku.min.js',
reloadable: true,
displayNames: {
narrowDanmaku: '强制保留弹幕栏'
}
},
hideOldEntry: {
path: 'hide-old-entry.min.js',
reloadable: true,
displayNames: {
hideOldEntry: '隐藏返回旧版'
}
},
videoScreenshot: {
path: 'screenshot.min.js',
reloadable: true,
style: true,
displayNames: {
videoScreenshot: '启用视频截图'
@ -1945,6 +1965,7 @@ Resource.manifest = {
},
hideBangumiReviews: {
path: 'hide-bangumi-reviews.min.js',
reloadable: true,
displayNames: {
hideBangumiReviews: '隐藏番剧点评'
}
@ -1964,6 +1985,7 @@ Resource.manifest = {
},
hideCategory: {
path: 'hide-category.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideCategory: '隐藏分区栏',
@ -2027,6 +2049,7 @@ Resource.manifest = {
},
fullActivityContent: {
path: 'full-activity-content.min.js',
reloadable: true,
displayNames: {
fullActivityContent: '展开动态内容',
},
@ -2039,6 +2062,7 @@ Resource.manifest = {
},
selectableColumnText: {
path: 'selectable-column-text.min.js',
reloadable: true,
displayNames: {
selectableColumnText: '专栏文字选择',
},

View File

@ -2,31 +2,35 @@ export function loadResources () {
Resource.root = 'https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/'
Resource.all = {}
Resource.displayNames = {}
Resource.reloadables = [
'useDarkStyle',
'hideBanner',
'customNavbar',
'playerShadow',
'narrowDanmaku',
'compactLayout',
'useCommentStyle',
'removeVideoTopMask',
'hideOldEntry',
'hideBangumiReviews',
'videoScreenshot',
'blurVideoControl',
'customControlBackground',
'harunaScale',
'removeLiveWatermark',
'framePlayback',
'hideCategory',
'fullTweetsTitle',
'fullActivityContent',
]
// Resource.reloadables = [
// 'useDarkStyle',
// 'hideBanner',
// 'customNavbar',
// 'playerShadow',
// 'narrowDanmaku',
// 'compactLayout',
// 'useCommentStyle',
// 'removeVideoTopMask',
// 'hideOldEntry',
// 'hideBangumiReviews',
// 'videoScreenshot',
// 'blurVideoControl',
// 'customControlBackground',
// 'harunaScale',
// 'removeLiveWatermark',
// 'framePlayback',
// 'hideCategory',
// 'fullTweetsTitle',
// 'fullActivityContent',
// ]
Resource.reloadables = []
for (const [key, data] of Object.entries(Resource.manifest)) {
const resource = new Resource(data.path, { styles: data.styles, alwaysPreview: data.alwaysPreview })
resource.key = key
resource.dropdown = data.dropdown
if (data.reloadable) {
Resource.reloadables.push(key)
}
if (data.displayNames) {
resource.displayName = data.displayNames[key]
Object.assign(Resource.displayNames, data.displayNames)

View File

@ -103,6 +103,7 @@ Resource.manifest = {
},
useDarkStyle: {
path: 'dark-styles.min.js',
reloadable: true,
alwaysPreview: true,
styles: [
'darkStyle',
@ -150,6 +151,7 @@ Resource.manifest = {
},
hideBanner: {
path: 'hide-banner.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideBanner: '隐藏顶部横幅'
@ -200,18 +202,21 @@ Resource.manifest = {
},
harunaScale: {
path: 'haruna-scale.min.js',
reloadable: true,
displayNames: {
harunaScale: '缩放直播看板娘'
}
},
removeLiveWatermark: {
path: 'remove-watermark.min.js',
reloadable: true,
displayNames: {
removeLiveWatermark: '删除直播水印'
}
},
fullTweetsTitle: {
path: 'full-tweets-title.min.js',
reloadable: true,
style: 'instant',
displayNames: {
fullTweetsTitle: '展开动态标题'
@ -254,12 +259,14 @@ Resource.manifest = {
},
removeVideoTopMask: {
path: 'remove-top-mask.min.js',
reloadable: true,
displayNames: {
removeVideoTopMask: '删除视频标题层'
}
},
blurVideoControl: {
path: 'blur-video-control.min.js',
reloadable: true,
style: 'instant',
displayNames: {
blurVideoControl: '模糊视频控制栏背景'
@ -321,6 +328,7 @@ Resource.manifest = {
},
customControlBackground: {
path: 'custom-control-background.min.js',
reloadable: true,
style: {
key: 'customControlBackgroundStyle',
condition: () => settings.customControlBackgroundOpacity > 0
@ -418,6 +426,7 @@ Resource.manifest = {
},
compactLayout: {
path: 'compact-layout.min.js',
reloadable: true,
style: true,
displayNames: {
compactLayout: '首页使用紧凑布局'
@ -451,6 +460,7 @@ Resource.manifest = {
},
useCommentStyle: {
path: 'comment.min.js',
reloadable: true,
style: 'important',
displayNames: {
useCommentStyle: '简化评论区'
@ -476,6 +486,7 @@ Resource.manifest = {
},
framePlayback: {
path: 'frame-playback.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -540,6 +551,7 @@ Resource.manifest = {
},
customNavbar: {
path: 'custom-navbar.min.js',
reloadable: true,
style: 'instant',
html: true,
displayNames: {
@ -568,24 +580,28 @@ Resource.manifest = {
},
playerShadow: {
path: 'player-shadow.min.js',
reloadable: true,
displayNames: {
playerShadow: '播放器投影'
}
},
narrowDanmaku: {
path: 'narrow-danmaku.min.js',
reloadable: true,
displayNames: {
narrowDanmaku: '强制保留弹幕栏'
}
},
hideOldEntry: {
path: 'hide-old-entry.min.js',
reloadable: true,
displayNames: {
hideOldEntry: '隐藏返回旧版'
}
},
videoScreenshot: {
path: 'screenshot.min.js',
reloadable: true,
style: true,
displayNames: {
videoScreenshot: '启用视频截图'
@ -596,6 +612,7 @@ Resource.manifest = {
},
hideBangumiReviews: {
path: 'hide-bangumi-reviews.min.js',
reloadable: true,
displayNames: {
hideBangumiReviews: '隐藏番剧点评'
}
@ -615,6 +632,7 @@ Resource.manifest = {
},
hideCategory: {
path: 'hide-category.min.js',
reloadable: true,
style: 'instant',
displayNames: {
hideCategory: '隐藏分区栏',
@ -678,6 +696,7 @@ Resource.manifest = {
},
fullActivityContent: {
path: 'full-activity-content.min.js',
reloadable: true,
displayNames: {
fullActivityContent: '展开动态内容',
},
@ -690,6 +709,7 @@ Resource.manifest = {
},
selectableColumnText: {
path: 'selectable-column-text.min.js',
reloadable: true,
displayNames: {
selectableColumnText: '专栏文字选择',
},