diff --git a/README.md b/README.md index fb6f06874..7bb62b5ae 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ ### 直播间勋章快速切换 在直播区(live.bilibili.com)中, 可从`附加功能`中直接切换勋章和头衔. ### 显示失效视频信息 -在空间的收藏夹中, 为已失效视频恢复标题和封面. 也可以使用`失效视频重定向`转到BiliPlus观看. +在空间的收藏夹和频道中, 为已失效视频恢复标题和封面. 也可以使用`失效视频重定向`转到BiliPlus观看. ## 触摸 ### 顶栏 diff --git a/bilibili-evolved.offline.user.js b/bilibili-evolved.offline.user.js index 37dbc3905..1e94f3440 100644 --- a/bilibili-evolved.offline.user.js +++ b/bilibili-evolved.offline.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Bilibili Evolved (Offline) -// @version 212.94 +// @version 212.96 // @description Bilibili Evolved 的离线版, 所有功能都已内置于脚本中. // @author Grant Howard, Coulomb-G // @copyright 2019, Grant Howrad (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G) @@ -1236,7 +1236,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/text-validate.min.js"] = (()=>{return(t,e)=>{class i{constructor(t){this.key=t}get originalValue(){return t[this.key]}static getValidator(t){switch(t){case"customStyleColor":return new r(t);case"blurBackgroundOpacity":case"customControlBackgroundOpacity":return new a(t);case"defaultPlayerMode":case"defaultVideoQuality":return new s(t);case"darkScheduleStart":case"darkScheduleEnd":return new n(t);default:return new i(t)}}isValidate(t){return t}validate(t){const e=this.isValidate(t);if(e===undefined){return this.originalValue}return e}}class r extends i{isValidate(t){if(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(t)){if(t.length<7){return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`}else{return t}}}}class a extends i{isValidate(t){if(/^([-\+]?\d+)(\.\d+)?$/.test(t)){const e=parseFloat(t);if(e>=0&&e<=1){return t}}}}class s extends i{isValidate(t){const[e]=Object.values(Resource.manifest).filter(t=>t.dropdown&&t.dropdown.key===this.key).map(t=>t.dropdown);if(e.items.indexOf(t)!==-1){return t}}}class n extends i{isValidate(t){const e=t.match(/^([\d]{1,2}):([\d]{1,2})$/);if(e&&e.length>=3){const t={hour:parseInt(e[1]),minute:parseInt(e[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(t);return`${t.hour}:${t.minute<10?"0"+t.minute:t.minute}`}}}return{export:{Validator:i,ColorValidator:r,DropDownValidator:s,OpacityValidator:a,TimeValidator:n}}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/theme-colors.min.js"] = (()=>{return(e,o)=>{const r={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};class t{constructor(){this.reloadColor=(()=>{const e=document.querySelector("html");return function(o){const r=new ColorProcessor(o);const t=e=>r.rgbToString(r.hexToRgba(e));const l=r.hexToRgba(o+"70");$("div.custom-color-preview").css("background",o).css("box-shadow",`0px 2px 8px 1px rgba(${l.r},${l.g},${l.b},${l.a})`);e.style.setProperty("--theme-color",o);for(let r=10;r<=90;r+=10){e.style.setProperty(`--theme-color-${r}`,t(o+r))}e.style.setProperty("--foreground-color",r.foreground);e.style.setProperty("--foreground-color-b",t(r.foreground+"b"));e.style.setProperty("--foreground-color-d",t(r.foreground+"d"));e.style.setProperty("--blue-image-filter",r.blueImageFilter);e.style.setProperty("--pink-image-filter",r.pinkImageFilter);e.style.setProperty("--brightness",r.brightness);e.style.setProperty("--invert-filter",r.filterInvert)}})()}setupDom(){$(`input[key='customStyleColor']`).on("change",()=>{this.reloadColor($(`input[key='customStyleColor']`).val())});const e=$(".predefined-colors-grid");for(const o of Object.values(r)){$(`
`).appendTo(e).css("background",o).attr("data-color",o).on("click",e=>{const o=$(e.target).attr("data-color");$(`input[key='customStyleColor']`).val(o).trigger("input").change();$("div.custom-color-preview").on("click")})}$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")})}}return{export:t}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/settings-tooltip.min.css"] = `.gui-settings-tooltip{position:fixed;left:420px;color:#fff;background:#0008;padding:1rem;font-size:12pt;top:50%;transform:translateY(-50%);transition:.2s ease-out .8s;opacity:0;min-width:100%;max-height:60%;line-height:24px;white-space:pre-wrap;pointer-events:none}.gui-settings-tooltip.show{pointer-events:initial;opacity:1}.gui-settings-tooltip span{font-weight:700}`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/settings-tooltip.min.js"] = (()=>{return(e,a)=>{const n={useDefaultPlayerMode:`控制是否使用默认播放器模式, 可以为常规, 宽屏网页全屏(全屏还未完成).`,defaultPlayerMode:`设置默认的播放器模式.`,applyPlayerModeOnPlay:`是否在播放时应用模式, 若选择否就会在未开始播放时就应用.`,useDefaultPlayerLayout:`设置默认的播放器布局, 尽量在相应的页面里设置(比如在番剧播放页面设置番剧播放器布局), 否则可能没有效果.\n- 旧版: 传统布局\n- 新版: 视频区默认的新版布局\n注: 旧版布局中, 很多脚本功能将不适用.`,defaultPlayerLayout:`设置视频区的布局.`,defaultBangumiLayout:`设置番剧区的布局.`,useDefaultVideoQuality:`进入视频时自动选择指定的画质, 若视频最高画质低于所选画质, 则使用视频的最高画质.`,defaultVideoQuality:`设定自动选择的视频画质.`,autoLightOff:`首次播放时, 自动进入关灯模式.`,useDefaultDanmakuSettings:`设置默认是否开启弹幕, 以及是否记住防挡字幕和智能防挡弹幕.`,enableDanmaku:`控制弹幕是否默认开启.`,rememberDanmakuSettings:`控制是否记住弹幕设置, 包括防挡字幕和智能防挡弹幕. 在播放器中改动这些设置后, 每个视频都会默认使用这些设置.`,expandDanmakuList:`新版播放页面中, 弹幕列表默认收起以显示推荐的其他视频. 启用此功能可在每次加载视频时自动展开弹幕列表.`,expandDescription:`长的视频简介默认会被折叠, 启用此功能可以强制展开完整的视频简介.`,autoPlay:`进入视频页面时自动开始播放视频.`,autoContinue:`播放视频时如果检测到历史记录信息(上次看到...消息), 则自动跳转到相应的时间播放.`,skipChargeList:`自动跳过视频结尾的充电鸣谢.`,customStyleColor:`设定顶栏(样式调整启用时)和夜间模式使用的主题色, 可以点击颜色预览的圆圈打开色板, 其中含有预定义的16种主题色, 也可以在右侧的文本框直接输入任何有效的16进制颜色值(#rrggbb#rgb).`,useNewStyle:`主要会改变顶栏的样式, 并有一些其他地方的界面微调:\n- 为播放器增加主题色投影\n- 可控制顶栏对横幅的透明度\n- 使播放器按钮垂直对齐\n- 使部分搜索栏的提示文字的颜色更清晰\n- 隐藏播放页面的"返回旧版"侧栏\n- 修复直播间一些文字初始状态不正确`,blurBackgroundOpacity:`设置顶栏对横幅的透明度(0~1), 数值越高顶栏越淡, 当横幅关闭时此选项无效.`,useDarkStyle:`夜间模式更适合光线暗的环境, 并会大量应用主题颜色.`,darkSchedule:`设置一个使用夜间模式的时间段, 进入/离开此时间段时, 会自动开启/关闭夜间模式.\n结束时间小于起始时间时将视为次日, 如18:006:00表示晚上18:00到次日6:00.`,darkScheduleStart:`设置计划时段的起始时间.`,darkScheduleEnd:`设置计划时段的结束时间.`,compactLayout:`设置首页是否使用紧凑布局, 视频的间距会减小并削去圆角, 分区栏的图标会使用高清重制版. 目前仅支持首页, 其他分区的样式后续会添加.`,useCommentStyle:`- 删除热评头像下方的关注按钮\n- 删除用户的等级标识\n- 删除发送源信息(来自安卓客户端这种)\n- 发送时间移动到右上角\n- 位图图标全部换用矢量图标, 高分屏不会模糊\n注: 关注和等级可以通过鼠标停留在头像上, 在弹出的资料卡小窗中查看. 暂不支持动态里的评论, 以后会加.`,overrideNavBar:`开启后, 在主站中总是把搜索框置于顶栏, 如果页面里没有搜索栏则不会显示.`,showBanner:`控制是否显示主站顶部的横幅`,preserveRank:`控制是否在搜索框左侧显示排行榜图标.`,blurVideoControl:`模糊视频控制栏背景, 原版的阴影效果将无效.`,customControlBackground:`给视频控制栏附上半透明的黑色, 代替原来的阴影.`,customControlBackgroundOpacity:`设置控制栏着色的黑色不透明度(0~1), 数值越大黑色越浓.`,harunaScale:`根据屏幕DPI缩放直播看板娘的大小以提高像素的清晰度.`,removeLiveWatermark:`删除观看直播时角落的水印.`,removeVideoTopMask:`删除视频里鼠标经过时出现在右上角的覆盖层.`,removeAds:`删除站内的各种广告. 包括首页的推广模块, 手机app推荐, 视频页面右侧的广告等.`,watchLaterRedirect:`将稍后再看的链接重定向为普通播放网址, 以使用新版播放页面.`,hideTopSearch:`将搜索框的推荐词替换为搜索.`,fullTweetsTitle:`在顶栏的动态预览框中, 总是展开完整的标题.`,fullPageTitle:`在视频选集列表中, 总是展开完整的标题.`,showDeadVideoTitle:`在空间的收藏夹中, 为已失效视频恢复标题和封面.`,useBiliplusRedirect:`将失效视频重定向到BiliPlus.`,touchNavBar:`删除顶栏右侧的一级链接(从大会员历史), 以方便触屏设备快速预览信息. 被删除的链接可从各预览中的查看更多进入.`,comboLike:`为素质三连(长按点赞)启用触摸支持.`,touchVideoPlayer:`增大控制栏的按钮间距, 使触摸操作更准确. 并为播放器启用触摸支持:\n- 左右滑动可调整进度\n- 上下滑动可调整音量\n- 进度调整可在左上角和右上角取消\n- 在不同位置滑动, 可以使用3档不同的灵敏度.`,touchVideoPlayerAnimation:`决定是否要对触摸调整的提示框使用出现/消失动画, 此动画可能导致掉帧.`,touchVideoPlayerDoubleTapControl:`将操作方式更改为: 单击显示/隐藏控制栏, 双击播放/暂停.`,toast:`允许在网页左下角显示来自本脚本的消息, 如更新提醒, 错误提示等.`,toastInternalError:`开启后, 错误消息将显示详细的技术性错误信息及堆栈跟踪, 这通常用于准确地确定问题发生的原因, 所以报告问题时这些信息会非常有用.`,useCache:`使用缓存以提高脚本的加载速度.`};function t(e){const a=$(e).find("input");if(a.length>0){return a.attr("key")}return null}(async()=>{a.applyStyle("settingsTooltipStyle");const e=await SpinQuery.select(()=>document.querySelector(".gui-settings-tooltip"));document.querySelectorAll(".gui-settings-content>ul>li").forEach(a=>{a.addEventListener("mouseover",()=>{const s=n[t(a)];if(s!==undefined){e.innerHTML=s;e.classList.add("show")}});a.addEventListener("mouseout",()=>{e.classList.remove("show")})})})();return{export:n}}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/settings-tooltip.min.js"] = (()=>{return(e,a)=>{const n={useDefaultPlayerMode:`控制是否使用默认播放器模式, 可以为常规, 宽屏网页全屏(全屏还未完成).`,defaultPlayerMode:`设置默认的播放器模式.`,applyPlayerModeOnPlay:`是否在播放时应用模式, 若选择否就会在未开始播放时就应用.`,useDefaultPlayerLayout:`设置默认的播放器布局, 尽量在相应的页面里设置(比如在番剧播放页面设置番剧播放器布局), 否则可能没有效果.\n- 旧版: 传统布局\n- 新版: 视频区默认的新版布局\n注: 旧版布局中, 很多脚本功能将不适用.`,defaultPlayerLayout:`设置视频区的布局.`,defaultBangumiLayout:`设置番剧区的布局.`,useDefaultVideoQuality:`进入视频时自动选择指定的画质, 若视频最高画质低于所选画质, 则使用视频的最高画质.`,defaultVideoQuality:`设定自动选择的视频画质.`,autoLightOff:`首次播放时, 自动进入关灯模式.`,useDefaultDanmakuSettings:`设置默认是否开启弹幕, 以及是否记住防挡字幕和智能防挡弹幕.`,enableDanmaku:`控制弹幕是否默认开启.`,rememberDanmakuSettings:`控制是否记住弹幕设置, 包括防挡字幕和智能防挡弹幕. 在播放器中改动这些设置后, 每个视频都会默认使用这些设置.`,expandDanmakuList:`新版播放页面中, 弹幕列表默认收起以显示推荐的其他视频. 启用此功能可在每次加载视频时自动展开弹幕列表.`,expandDescription:`长的视频简介默认会被折叠, 启用此功能可以强制展开完整的视频简介.`,autoPlay:`进入视频页面时自动开始播放视频.`,autoContinue:`播放视频时如果检测到历史记录信息(上次看到...消息), 则自动跳转到相应的时间播放.`,skipChargeList:`自动跳过视频结尾的充电鸣谢.`,customStyleColor:`设定顶栏(样式调整启用时)和夜间模式使用的主题色, 可以点击颜色预览的圆圈打开色板, 其中含有预定义的16种主题色, 也可以在右侧的文本框直接输入任何有效的16进制颜色值(#rrggbb#rgb).`,useNewStyle:`主要会改变顶栏的样式, 并有一些其他地方的界面微调:\n- 为播放器增加主题色投影\n- 可控制顶栏对横幅的透明度\n- 使播放器按钮垂直对齐\n- 使部分搜索栏的提示文字的颜色更清晰\n- 隐藏播放页面的"返回旧版"侧栏\n- 修复直播间一些文字初始状态不正确`,blurBackgroundOpacity:`设置顶栏对横幅的透明度(0~1), 数值越高顶栏越淡, 当横幅关闭时此选项无效.`,useDarkStyle:`夜间模式更适合光线暗的环境, 并会大量应用主题颜色.`,darkSchedule:`设置一个使用夜间模式的时间段, 进入/离开此时间段时, 会自动开启/关闭夜间模式.\n结束时间小于起始时间时将视为次日, 如18:006:00表示晚上18:00到次日6:00.`,darkScheduleStart:`设置计划时段的起始时间.`,darkScheduleEnd:`设置计划时段的结束时间.`,compactLayout:`设置首页是否使用紧凑布局, 视频的间距会减小并削去圆角, 分区栏的图标会使用高清重制版. 目前仅支持首页, 其他分区的样式后续会添加.`,useCommentStyle:`- 删除热评头像下方的关注按钮\n- 删除用户的等级标识\n- 删除发送源信息(来自安卓客户端这种)\n- 发送时间移动到右上角\n- 位图图标全部换用矢量图标, 高分屏不会模糊\n注: 关注和等级可以通过鼠标停留在头像上, 在弹出的资料卡小窗中查看. 暂不支持动态里的评论, 以后会加.`,overrideNavBar:`开启后, 在主站中总是把搜索框置于顶栏, 如果页面里没有搜索栏则不会显示.`,showBanner:`控制是否显示主站顶部的横幅`,preserveRank:`控制是否在搜索框左侧显示排行榜图标.`,blurVideoControl:`模糊视频控制栏背景, 原版的阴影效果将无效.`,customControlBackground:`给视频控制栏附上半透明的黑色, 代替原来的阴影.`,customControlBackgroundOpacity:`设置控制栏着色的黑色不透明度(0~1), 数值越大黑色越浓.`,harunaScale:`根据屏幕DPI缩放直播看板娘的大小以提高像素的清晰度.`,removeLiveWatermark:`删除观看直播时角落的水印.`,removeVideoTopMask:`删除视频里鼠标经过时出现在右上角的覆盖层.`,removeAds:`删除站内的各种广告. 包括首页的推广模块, 手机app推荐, 视频页面右侧的广告等.`,watchLaterRedirect:`将稍后再看的链接重定向为普通播放网址, 以使用新版播放页面.`,hideTopSearch:`将搜索框的推荐词替换为搜索.`,fullTweetsTitle:`在顶栏的动态预览框中, 总是展开完整的标题.`,fullPageTitle:`在视频选集列表中, 总是展开完整的标题.`,showDeadVideoTitle:`在空间的收藏夹和频道中, 为已失效视频恢复标题和封面.`,useBiliplusRedirect:`将失效视频重定向到BiliPlus.`,touchNavBar:`删除顶栏右侧的一级链接(从大会员历史), 以方便触屏设备快速预览信息. 被删除的链接可从各预览中的查看更多进入.`,comboLike:`为素质三连(长按点赞)启用触摸支持.`,touchVideoPlayer:`增大控制栏的按钮间距, 使触摸操作更准确. 并为播放器启用触摸支持:\n- 左右滑动可调整进度\n- 上下滑动可调整音量\n- 进度调整可在左上角和右上角取消\n- 在不同位置滑动, 可以使用3档不同的灵敏度.`,touchVideoPlayerAnimation:`决定是否要对触摸调整的提示框使用出现/消失动画, 此动画可能导致掉帧.`,touchVideoPlayerDoubleTapControl:`将操作方式更改为: 单击显示/隐藏控制栏, 双击播放/暂停.`,toast:`允许在网页左下角显示来自本脚本的消息, 如更新提醒, 错误提示等.`,toastInternalError:`开启后, 错误消息将显示详细的技术性错误信息及堆栈跟踪, 这通常用于准确地确定问题发生的原因, 所以报告问题时这些信息会非常有用.`,useCache:`使用缓存以提高脚本的加载速度.`};function t(e){const a=$(e).find("input");if(a.length>0){return a.attr("key")}return null}(async()=>{a.applyStyle("settingsTooltipStyle");const e=await SpinQuery.select(()=>document.querySelector(".gui-settings-tooltip"));document.querySelectorAll(".gui-settings-content>ul>li").forEach(a=>{a.addEventListener("mouseover",()=>{const s=n[t(a)];if(s!==undefined){e.innerHTML=s;e.classList.add("show")}});a.addEventListener("mouseout",()=>{e.classList.remove("show")})})})();return{export:n}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/settings-search.min.js"] = (()=>{return(t,e)=>{class s{constructor(){this.input=document.querySelector(".gui-settings-search");const t=[...document.querySelectorAll(".gui-settings-content>ul>li")];const e=t=>e=>e.classList.contains("category")===t;this.categories=t.filter(e(true));this.items=t.filter(e(false));this.input.addEventListener("input",()=>this.keywordChange())}keywordChange(){const t=this.input.value.trim();const s=e.import("settingsTooltip");if(!t){this.categories.concat(this.items).forEach(t=>t.classList.add("folded"));return}this.items.forEach(e=>{const i=$(e).find("input").attr("key");const n=Resource.displayNames[i]+s[i].replace(/|<\/span>/g,"");if(n.includes(t)){e.classList.remove("folded")}else{e.classList.add("folded")}});this.foldCategories()}foldCategories(){for(const e of this.categories){function t(){let t=e.nextElementSibling;while(t!==null&&!t.classList.contains("category")){if(!t.classList.contains("folded")){return"remove"}t=t.nextElementSibling}return"add"}e.classList[t()]("folded")}}}return{export:s}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(e,t)=>{function n(e){let t=e.nextElementSibling;const n=[];while(t!==null&&!t.classList.contains("category")){n.push(t);t=t.nextElementSibling}return n}function i(e,t){$(`input[type='checkbox'][key='${e}']`).prop("checked",t);$(`input[type='text'][key='${e}']`).val(t)}function s(){for(const[t,n]of Object.entries(e)){i(t,n)}}function o(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$(".gui-settings-content ul li.category").on("click",e=>{const t=document.querySelector(".gui-settings-search");if(t.value!==""){t.value="";raiseEvent(t,"input")}e.currentTarget.classList.toggle("folded");n(e.currentTarget).forEach(e=>e.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",e=>{$(e.currentTarget).parent().toggleClass("opened")});onSettingsChange((t,n,i)=>{if(e[t]!==i){e[t]=i;$(`input[type='checkbox'][key='${t}']`).prop("checked",i).change();$(`input[type='text'][key='${t}']`).val(i).change()}})}function a(){const{Validator:n}=t.import("textValidate");const i=e=>{};$("input[type='checkbox'][key]").each((t,n)=>{$(n).on("change",()=>{const t=n.getAttribute("key");const s=n.checked;e[t]=s;i(t);saveSettings(e)})});$("input[type='text'][key]").each((t,s)=>{$(s).on("change",()=>{const t=s.getAttribute("key");const o=n.getValidator(t).validate(s.value);e[t]=o;s.value=o;i(t);saveSettings(e)})})}function c(){const e={};$(`input[dependencies]`).each((t,n)=>{const i=$(n).attr("dependencies");if(i){e[$(n).attr("key")]=i}});const t=t=>{const n=t.prop("checked");for(const i in e){const s=e[i].split(" ");if(s.indexOf(t.attr("key"))!==-1){let e=true;if(n&&s.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}const t=$(`li:has(input[key='${i}'])`);const o=e?"addClass":"removeClass";t[o]("disabled");$(`input[key='${i}'][type='text']`).parent()[o]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function r(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function l(){$(".gui-settings-content ul li.category").each((e,t)=>{$(t).click()})}function u(){if(!CSS.supports("backdrop-filter","blur(24px)")&&!CSS.supports("-webkit-backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);e.blurVideoControl=false;saveSettings(e)}if(window.devicePixelRatio===1){$("input[key=harunaScale]").prop("disabled",true);e.harunaScale=false;saveSettings(e)}if(e.defaultPlayerLayout==="旧版"){const t=$("input[key=overrideNavBar]");t.prop("disabled",true).change();if(e.overrideNavBar){t.prop("checked",false).change();e.overrideNavBar=false;saveSettings(e)}}}function p(){for(const[e,t]of Object.entries(Resource.displayNames)){const n=document.querySelector(`input[key=${e}]`);if(!n){continue}switch(n.type){case"checkbox":n.nextElementSibling.nextElementSibling.innerHTML=t;break;case"text":const e=n.parentElement;if(e.classList.contains("gui-settings-textbox-container")){n.previousElementSibling.innerHTML=t}else if(e.classList.contains("gui-settings-dropdown")){e.previousElementSibling.innerHTML=t}break;default:break}}}(async()=>{t.applyStyle("guiSettingsStyle");const e=t.data.guiSettingsDom.text;$("body").append(e);new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start();o();r();s();c();a();l();u();p();const n=t.import("themeColors");(new n).setupDom();const i=t.import("settingsSearch");new i})()}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/dark-styles.min.js"] = (()=>{return(e,l)=>{if(e.useDarkStyle){l.applyStyle("scrollbarStyle");SpinQuery.any(()=>$(".custom-scrollbar"),e=>e.removeClass("custom-scrollbar"));if($("#banner_link").length===0||$("#banner_link").length>0&&e.overrideNavBar&&!e.showBanner){l.applyImportantStyle("darkStyleNavBar")}l.applyStyle("darkStyle");l.applyImportantStyle("darkStyleImportant")}else{l.removeStyle("scrollbarStyle");l.removeStyle("darkStyleNavBar");l.removeStyle("darkStyle");l.removeStyle("darkStyleImportant")}}})(); @@ -1277,7 +1277,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/expand-description.min.css"] = `.video-desc .info{height:auto!important}.video-desc .btn{display:none!important}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/expand-description.min.js"] = (()=>{return(e,p)=>{p.applyStyle("expandDescriptionStyle")}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.css"] = `.bilibili-player-video-danmaku-setting-wrap{display:none!important}`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.js"] = (()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){reutrn}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings[t]=n.checked;saveSettings(e)})}}n();a()}}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.js"] = (()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){return}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings[t]=n.checked;saveSettings(e)})}}n();a()}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/skip-charge-list.min.css"] = `.bilibili-player .bilibili-player-area .bilibili-player-electric-panel{display:none!important}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/skip-charge-list.min.js"] = (()=>{return(e,i)=>{async function n(){const e=await SpinQuery.select(()=>document.querySelector("video"));e&&e.addEventListener("ended",async()=>{const e=await SpinQuery.select(()=>document.querySelector(".bilibili-player-electric-panel-jump"));e&&e.click()})}if(Observer.videoChange){Observer.videoChange(n)}else{Observer.childList("#bofqi",n)}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-layout.min.js"] = (()=>{return(e,t)=>{(async()=>{const t=await SpinQuery.select(()=>document.querySelector(`input[key=defaultPlayerLayout]`));const s=await SpinQuery.select(()=>document.querySelector(`input[key=defaultBangumiLayout]`));const o=await SpinQuery.select(()=>document.querySelector(`input[key=overrideNavBar]`));if(!t||!s){logError("无法加载播放器布局选项.");return}class i{setCookie(e,t){document.cookie=`${e}=${t};path=/;domain=.bilibili.com;max-age=31536000`}clearCookie(e){document.cookie=`${e}=;path=/;domain=.bilibili.com;max-age=0`}getValue(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;\\s*)${e}\\s*\\=\\s*([^;]*).*$)|^.*$`),"$1")}checkSettings(){return e.useDefaultPlayerLayout}checkCookies(){if(!this.checkSettings()){return}}useNewLayout(){if(!this.checkSettings()){return}}useOldLayout(){if(!this.checkSettings()){return}}setLayout(e){if(e){this.useNewLayout()}else{this.useOldLayout()}}}class u extends i{checkCookies(){super.checkCookies();const t=this.getValue(this.cookieKey);if(t===""||parseInt(t)<0&&e.defaultPlayerLayout!=="旧版"){this.useNewLayout()}else if(e.defaultPlayerLayout!=="新版"){this.useOldLayout()}}constructor(){super();this.cookieKey="stardustvideo";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,1);o.disabled=false;$(o).change()}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,-1);if(e.overrideNavBar){o.checked=false;o.disabled=true;$(o).change();e.overrideNavBar=false;saveSettings(e);Toast.info(`已关闭搜索栏置顶功能, 因为旧版视频播放器布局不兼容此功能.`,"提示",5e3)}}}class a extends i{checkCookies(){super.checkCookies();const t=this.getValue(this.cookieKey);if(t===""||parseInt(t)<=0&&e.defaultBangumiLayout!=="旧版"){this.useNewLayout()}else if(e.defaultBangumiLayout!=="新版"){this.useOldLayout()}}constructor(){super();this.cookieKey="stardustpgcv";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,"0606")}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,0)}}const c=new u;$(t).on("input",()=>{c.setLayout(t.value==="新版")});const r=new a;$(s).on("input",()=>{r.setLayout(s.value==="新版")})})()}})(); @@ -1286,7 +1286,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/medal-helper.min.js"] = (()=>{return(e,t)=>{class i{constructor(e,t){this.isActive=e;this.id=t}static parseJson(e,{successAction:t,errorMessage:i,errorAction:a}){const s=JSON.parse(e);if(s.code!==0){logError(`${i} 错误码:${s.code} ${s.message||""}`);return a(s)}return t(s)}}class a extends i{constructor({medal_id:e,status:t,level:i,medalName:a,uname:s}){super(t===1,e);this.level=i;this.name=a;this.upName=s}static async getList(){return i.parseJson(await Ajax.getTextWithCredentials("https://api.live.bilibili.com/i/api/medal?page=1&pageSize=256"),{successAction:e=>e.data.fansMedalList.map(e=>new a(e)),errorAction:()=>[],errorMessage:"无法获取勋章列表."})}static getContainer(){return $("#medal-helper .medal-popup ul")}static getItemTemplate(e){return`
  • \n \n
  • `}async activate(){return i.parseJson(await Ajax.getTextWithCredentials(`https://api.live.bilibili.com/i/ajaxWearFansMedal?medal_id=${this.id}`),{successAction:()=>{this.isActive=true;return true},errorAction:()=>false,errorMessage:"佩戴勋章失败."})}async deactivate(){return i.parseJson(await Ajax.getTextWithCredentials(`https://api.live.bilibili.com/i/ajaxCancelWear`),{successAction:()=>{this.isActive=false;return true},errorAction:()=>false,errorMessage:"卸下勋章失败."})}}class s extends i{constructor({id:e,cid:t,wear:i,css:a,name:r,source:n}){super(i,a);this.tid=e;this.cid=t;this.name=r;this.source=n;s.getImageMap().then(e=>{this.imageUrl=e[this.id]})}static async getImageMap(){if(s.imageMap===undefined){return i.parseJson(await Ajax.getTextWithCredentials("https://api.live.bilibili.com/rc/v1/Title/webTitles"),{successAction(e){s.imageMap={};e.data.forEach(e=>{s.imageMap[e.identification]=e.web_pic_url});return s.imageMap},errorAction:()=>{return{}},errorMessage:"获取头衔图片失败."})}else{return s.imageMap}}static async getList(){return i.parseJson(await Ajax.getTextWithCredentials("https://api.live.bilibili.com/i/api/ajaxTitleInfo?page=1&pageSize=256&had=1"),{successAction:e=>e.data.list.map(e=>new s(e)),errorAction:()=>[],errorMessage:"无法获取头衔列表."})}static getContainer(){return $("#title-helper .medal-popup ul")}static getItemTemplate(e){return`
  • \n \n
  • `}async activate(){return i.parseJson(await Ajax.postTextWithCredentials(`https://api.live.bilibili.com/i/ajaxWearTitle`,`id=${this.tid}&cid=${this.cid}`),{successAction:()=>{this.isActive=true;return true},errorAction:()=>false,errorMessage:"佩戴头衔失败."})}async deactivate(){return i.parseJson(await Ajax.postTextWithCredentials(`https://api.live.bilibili.com/i/ajaxCancelWearTitle`,""),{successAction:()=>{this.isActive=false;return true},errorAction:()=>false,errorMessage:"卸下头衔失败."})}}async function r(e){const t=e.getContainer();const i=await e.getList();const a=async()=>{const i=await e.getList();i.forEach(e=>{const i=t.find(`li[data-id=${e.id}]`);if(e.isActive){i.addClass("active")}else{i.removeClass("active")}i.find(`input`).prop("checked",e.isActive)})};i.forEach(s=>{const r=$(e.getItemTemplate(s));t.append(r);const n=r.find("input")[0];r.on("click",e=>{if(e.target===n){return}if(s.isActive){s.deactivate().then(a)}else{const e=i.find(e=>e.isActive);if(e){e.isActive=false}s.activate().then(a)}})})}return{export:{Badge:i,Medal:a,Title:s},widget:{condition:()=>document.domain==="live.bilibili.com",content:t.data.medalHelperDom.text,success:()=>{$(".medal-helper").each((e,t)=>{const i=$(t);const a=i.find(".medal-popup")[0];i.on("click",e=>{if(!a.contains(e.target)){a.classList.toggle("opened")}})});r(a);s.getImageMap().then(()=>r(s))}}}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/medal-helper.min.css"] = `.medal-popup{position:absolute;top:calc(100% + 2px);transition:.16s ease-out;transform-origin:top;transform:scaleY(0) translateX(-50%);left:50%;background:#fff;box-shadow:0 3px 20px 2px #0004;z-index:100}.medal-popup.opened{transform:scaleY(1) translateX(-50%)}.medal-popup *{transition:.2s}.medal-popup ul{list-style:none;margin:0;padding:0}.medal-popup ul>li.active{box-shadow:0 0 4px 0 var(--theme-color)}.medal-popup ul>li:hover{background-color:rgba(0,0,0,.16)}.medal-popup label{display:flex;align-items:center;justify-content:center;cursor:pointer;padding:8px}.medal-popup label>*{flex-shrink:0}.medal-popup input[type=radio]{visibility:collapse;width:0;margin:0;padding:0}.medal-popup input[type=radio]~i{opacity:0;transform:scale(.8);margin:0}.medal-popup input[type=radio]~.fans-medal-item{margin:0 8px}.medal-popup input[type=radio]:checked~i{opacity:1}.title-image{display:inline-block;vertical-align:middle;height:20px}.fans-medal-item .label{width:40px;text-align:center;padding:0 2px;color:#fff}.fans-medal-item .level{width:16px;background-color:#fff;text-align:center;color:#61decb}.fans-medal-item .label,.fans-medal-item .level{position:relative;display:block;float:left}.fans-medal-item{display:inline-block;height:14px;line-height:14px;color:#fff;border:1px solid #61decb;border-left:0;white-space:nowrap;border-radius:2px;flex-shrink:0;font-size:12px}.level-1,.level-2,.level-3,.level-4{border-color:#61decb}.level-1 .label,.level-2 .label,.level-3 .label,.level-4 .label{background-color:#61decb}.level-1 .level,.level-2 .level,.level-3 .level,.level-4 .level{color:#61decb}.level-5,.level-6,.level-7,.level-8{border-color:#5896de}.level-5 .label,.level-6 .label,.level-7 .label,.level-8 .label{background-color:#5896de}.level-5 .level,.level-6 .level,.level-7 .level,.level-8 .level{color:#5896de}.level-10,.level-11,.level-12,.level-9{border-color:#a068f1}.level-10 .label,.level-11 .label,.level-12 .label,.level-9 .label{background-color:#a068f1}.level-10 .level,.level-11 .level,.level-12 .level,.level-9 .level{color:#a068f1}.level-13,.level-14,.level-15,.level-16{border-color:#ff86b2}.level-13 .label,.level-14 .label,.level-15 .label,.level-16 .label{background-color:#ff86b2}.level-13 .level,.level-14 .level,.level-15 .level,.level-16 .level{color:#ff86b2}.level-17,.level-18,.level-19,.level-20{border-color:#f6be18}.level-17 .label,.level-18 .label,.level-19 .label,.level-20 .label{background-color:#f6be18}.level-17 .level,.level-18 .level,.level-19 .level,.level-20 .level{color:#f6be18}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/medal-helper.min.html"] = `
    更换勋章
      更换头衔
        `; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/show-dead-video-title.min.js"] = (()=>{return(t,e)=>{function i(){const e=$(".fav-video-list>li.disabled").removeClass("disabled");e.each((e,i)=>{const a=$(i);const r=a.attr("data-aid");const n=a.find("img").attr("alt");const l=(()=>{if(t.useBiliplusRedirect){return`https://www.biliplus.com/video/av${r}`}else{return`//www.bilibili.com/video/av${r}`}})();a.find(".i-watchlater").css("display","none");a.find("a.cover").attr("target","_blank").attr("href",l);a.find("a.title").attr("title",n).attr("target","_blank").attr("href",l).text(n)})}SpinQuery.any(()=>$(".fav-content"),()=>{Observer.childListSubtree(".fav-content",i)})}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/show-dead-video-title.min.js"] = (()=>{return(t,e)=>{function i(){const e=$(".fav-video-list>li.disabled,.video-list>li.disabled").removeClass("disabled");e.each((e,i)=>{const a=$(i);const r=a.attr("data-aid");const s=a.find("img").attr("alt");const n=(()=>{if(t.useBiliplusRedirect){return`https://www.biliplus.com/video/av${r}`}else{return`//www.bilibili.com/video/av${r}`}})();a.find(".i-watchlater").css("display","none");a.find("a.cover").attr("target","_blank").attr("href",n);a.find("a.title").attr("title",s).attr("target","_blank").attr("href",n).text(s)})}SpinQuery.any(()=>$(".fav-content"),()=>{Observer.childListSubtree(".fav-content",i)});SpinQuery.any(()=>$("#app>.s-space"),()=>{Observer.childListSubtree("#app>.s-space",i)})}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/auto-play.min.js"] = (()=>{return(e,i)=>{SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>e&&e.paused===true,e=>e.play())}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/comment.min.js"] = (()=>{return(r,e)=>{}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/comment.min.css"] = `.comment-list .list-item{position:relative}.bb-comment .comment-list .list-item .info,.dynamic-list-item-wrap .item-detail>.info{display:flex}.bb-comment .comment-list .list-item .info .floor,.dynamic-list-item-wrap .item-detail>.info .floor{order:1}.bb-comment .comment-list .list-item .info .reply,.dynamic-list-item-wrap .item-detail>.info .reply{order:2}.bb-comment .comment-list .list-item .info .operation,.dynamic-list-item-wrap .item-detail>.info .operation{order:3;flex-grow:1;display:flex!important;justify-content:flex-end}.bb-comment .comment-list .list-item>.con>.reply-box{transform:translateX(0)}.bb-comment .comment-list .list-item>.con>.info{margin-top:4px}.bb-comment .comment-list .list-item>.con>.info>.time,.item-detail>.info>.time{position:absolute;right:8px;top:24px;margin:0;line-height:normal;color:#000}.item-detail>.info>.time{top:12px;opacity:1}.reply-box .item-user>a{margin-right:8px}.bb-comment .comment-header .tabs-order li.on:after,.bb-comment .comment-list .list-item .user-face .hot-follow,.bb-comment .comment-list .list-item>.con>.info>.plad,.bb-comment .nameplate,.comment-area .dynamic-level,.dynamic-list-item-wrap .info .plat{display:none}.bb-comment .comment-list .reply-con{position:relative}.bb-comment .comment-list .reply-con>.info>.time,.dynamic-list-item-wrap .reply-box .time{position:absolute;right:8px;top:0;margin:0;opacity:.5;line-height:normal;color:#000}.dynamic-list-item-wrap .reply-box .time{top:10px;opacity:.7}.bb-comment .comment-list .list-item .user{margin-right:120px}.reply-box .item-user .text{display:block}.bb-comment .comment-list .list-item .user .level{visibility:hidden;width:0;margin:0}.bb-comment .comment-list .list-item .info .hate>*,.bb-comment .comment-list .list-item .info .like>*,.bb-comment .comment-list .list-item .info .operation .spot,.bb-comment .comment-send .comment-emoji>*,.dynamic-hate i,.dynamic-like i{transition:.2s ease-out}.bb-comment .comment-list .list-item .info .hate i,.bb-comment .comment-list .list-item .info .like i,.bb-comment .comment-list .list-item .info .operation .spot,.bb-comment .comment-send .comment-emoji .face,.dynamic-hate i,.dynamic-like i,.dynamic-spot,.textarea-container .comm-tool .comm-emoji .icon-face{height:16px;width:16px;background-position:center!important;opacity:.5}.bb-comment .comment-list .list-item .info .hate span,.bb-comment .comment-list .list-item .info .like span,.bb-comment .comment-send .comment-emoji span{opacity:.5}.bb-comment .comment-list .list-item .info .hate span,.bb-comment .comment-list .list-item .info .hate.hated span,.bb-comment .comment-list .list-item .info .hate:hover span,.bb-comment .comment-list .list-item .info .like span,.bb-comment .comment-list .list-item .info .like.liked span,.bb-comment .comment-list .list-item .info .like:hover span,.bb-comment .comment-send .comment-emoji span{color:#000}.bb-comment .comment-list .list-item .info .hate:hover>*,.bb-comment .comment-list .list-item .info .like.hated:hover>*,.bb-comment .comment-list .list-item .info .like.hated>*,.bb-comment .comment-list .list-item .info .like.liked:hover>*,.bb-comment .comment-list .list-item .info .like.liked>*,.bb-comment .comment-list .list-item .info .like:hover>*,.bb-comment .comment-list .list-item .info .operation .spot:hover,.bb-comment .comment-send .comment-emoji.open .face,.bb-comment .comment-send .comment-emoji:hover .face,.bb-comment .comment-send .comment-emoji:hover span{opacity:.7}.bb-comment .comment-list .list-item .info .like i,.dynamic-like i{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-list .list-item .info .like.liked i,.bb-comment .comment-list .list-item .info .like.liked:hover i,.dynamic-like:hover i,.dynamic-liked i{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-list .list-item .info .hate i,.dynamic-hate i{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-list .list-item .info .hate.hated i,.bb-comment .comment-list .list-item .info .hate.hated:hover i,.dynamic-hate:hover i,.dynamic-hated i{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-list .list-item .info .operation .spot,.dynamic-spot{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-send .comment-emoji .face,.textarea-container .comm-tool .comm-emoji .icon-face{background:url('data:image/svg+xml;utf-8,')}.bb-comment .reply-notice .notice-item{background-color:#0001;border:none;display:flex;align-items:center;padding:10px 14px}.bb-comment .reply-notice .notice-item .icon-notice{order:0;position:static;margin-right:12px}.bb-comment .reply-notice .notice-item a{order:1;flex-grow:1;color:#000}.bb-comment .reply-notice .notice-item .icon-close-notice,.bb-comment .reply-notice .notice-item .icon-notice{height:18px;width:18px;background-position:center!important;opacity:.7}.bb-comment .reply-notice .notice-item .icon-notice{background:url('data:image/svg+xml;utf-8,')}.bb-comment .reply-notice .notice-item .icon-close-notice{order:2;position:static;background:url('data:image/svg+xml;utf-8,')}`; diff --git a/bilibili-evolved.preview-offline.user.js b/bilibili-evolved.preview-offline.user.js index 348109283..760af0931 100644 --- a/bilibili-evolved.preview-offline.user.js +++ b/bilibili-evolved.preview-offline.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Bilibili Evolved (Preview Offline) -// @version 212.94 +// @version 212.96 // @description Bilibili Evolved 的预览离线版, 可以抢先体验新功能, 并且所有功能都已内置于脚本中. // @author Grant Howard, Coulomb-G // @copyright 2019, Grant Howrad (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G) @@ -1236,7 +1236,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/text-validate.min.js"] = (()=>{return(t,e)=>{class i{constructor(t){this.key=t}get originalValue(){return t[this.key]}static getValidator(t){switch(t){case"customStyleColor":return new r(t);case"blurBackgroundOpacity":case"customControlBackgroundOpacity":return new a(t);case"defaultPlayerMode":case"defaultVideoQuality":return new s(t);case"darkScheduleStart":case"darkScheduleEnd":return new n(t);default:return new i(t)}}isValidate(t){return t}validate(t){const e=this.isValidate(t);if(e===undefined){return this.originalValue}return e}}class r extends i{isValidate(t){if(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(t)){if(t.length<7){return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`}else{return t}}}}class a extends i{isValidate(t){if(/^([-\+]?\d+)(\.\d+)?$/.test(t)){const e=parseFloat(t);if(e>=0&&e<=1){return t}}}}class s extends i{isValidate(t){const[e]=Object.values(Resource.manifest).filter(t=>t.dropdown&&t.dropdown.key===this.key).map(t=>t.dropdown);if(e.items.indexOf(t)!==-1){return t}}}class n extends i{isValidate(t){const e=t.match(/^([\d]{1,2}):([\d]{1,2})$/);if(e&&e.length>=3){const t={hour:parseInt(e[1]),minute:parseInt(e[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(t);return`${t.hour}:${t.minute<10?"0"+t.minute:t.minute}`}}}return{export:{Validator:i,ColorValidator:r,DropDownValidator:s,OpacityValidator:a,TimeValidator:n}}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/theme-colors.min.js"] = (()=>{return(e,o)=>{const r={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};class t{constructor(){this.reloadColor=(()=>{const e=document.querySelector("html");return function(o){const r=new ColorProcessor(o);const t=e=>r.rgbToString(r.hexToRgba(e));const l=r.hexToRgba(o+"70");$("div.custom-color-preview").css("background",o).css("box-shadow",`0px 2px 8px 1px rgba(${l.r},${l.g},${l.b},${l.a})`);e.style.setProperty("--theme-color",o);for(let r=10;r<=90;r+=10){e.style.setProperty(`--theme-color-${r}`,t(o+r))}e.style.setProperty("--foreground-color",r.foreground);e.style.setProperty("--foreground-color-b",t(r.foreground+"b"));e.style.setProperty("--foreground-color-d",t(r.foreground+"d"));e.style.setProperty("--blue-image-filter",r.blueImageFilter);e.style.setProperty("--pink-image-filter",r.pinkImageFilter);e.style.setProperty("--brightness",r.brightness);e.style.setProperty("--invert-filter",r.filterInvert)}})()}setupDom(){$(`input[key='customStyleColor']`).on("change",()=>{this.reloadColor($(`input[key='customStyleColor']`).val())});const e=$(".predefined-colors-grid");for(const o of Object.values(r)){$(`
        `).appendTo(e).css("background",o).attr("data-color",o).on("click",e=>{const o=$(e.target).attr("data-color");$(`input[key='customStyleColor']`).val(o).trigger("input").change();$("div.custom-color-preview").on("click")})}$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")})}}return{export:t}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/settings-tooltip.min.css"] = `.gui-settings-tooltip{position:fixed;left:420px;color:#fff;background:#0008;padding:1rem;font-size:12pt;top:50%;transform:translateY(-50%);transition:.2s ease-out .8s;opacity:0;min-width:100%;max-height:60%;line-height:24px;white-space:pre-wrap;pointer-events:none}.gui-settings-tooltip.show{pointer-events:initial;opacity:1}.gui-settings-tooltip span{font-weight:700}`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/settings-tooltip.min.js"] = (()=>{return(e,a)=>{const n={useDefaultPlayerMode:`控制是否使用默认播放器模式, 可以为常规, 宽屏网页全屏(全屏还未完成).`,defaultPlayerMode:`设置默认的播放器模式.`,applyPlayerModeOnPlay:`是否在播放时应用模式, 若选择否就会在未开始播放时就应用.`,useDefaultPlayerLayout:`设置默认的播放器布局, 尽量在相应的页面里设置(比如在番剧播放页面设置番剧播放器布局), 否则可能没有效果.\n- 旧版: 传统布局\n- 新版: 视频区默认的新版布局\n注: 旧版布局中, 很多脚本功能将不适用.`,defaultPlayerLayout:`设置视频区的布局.`,defaultBangumiLayout:`设置番剧区的布局.`,useDefaultVideoQuality:`进入视频时自动选择指定的画质, 若视频最高画质低于所选画质, 则使用视频的最高画质.`,defaultVideoQuality:`设定自动选择的视频画质.`,autoLightOff:`首次播放时, 自动进入关灯模式.`,useDefaultDanmakuSettings:`设置默认是否开启弹幕, 以及是否记住防挡字幕和智能防挡弹幕.`,enableDanmaku:`控制弹幕是否默认开启.`,rememberDanmakuSettings:`控制是否记住弹幕设置, 包括防挡字幕和智能防挡弹幕. 在播放器中改动这些设置后, 每个视频都会默认使用这些设置.`,expandDanmakuList:`新版播放页面中, 弹幕列表默认收起以显示推荐的其他视频. 启用此功能可在每次加载视频时自动展开弹幕列表.`,expandDescription:`长的视频简介默认会被折叠, 启用此功能可以强制展开完整的视频简介.`,autoPlay:`进入视频页面时自动开始播放视频.`,autoContinue:`播放视频时如果检测到历史记录信息(上次看到...消息), 则自动跳转到相应的时间播放.`,skipChargeList:`自动跳过视频结尾的充电鸣谢.`,customStyleColor:`设定顶栏(样式调整启用时)和夜间模式使用的主题色, 可以点击颜色预览的圆圈打开色板, 其中含有预定义的16种主题色, 也可以在右侧的文本框直接输入任何有效的16进制颜色值(#rrggbb#rgb).`,useNewStyle:`主要会改变顶栏的样式, 并有一些其他地方的界面微调:\n- 为播放器增加主题色投影\n- 可控制顶栏对横幅的透明度\n- 使播放器按钮垂直对齐\n- 使部分搜索栏的提示文字的颜色更清晰\n- 隐藏播放页面的"返回旧版"侧栏\n- 修复直播间一些文字初始状态不正确`,blurBackgroundOpacity:`设置顶栏对横幅的透明度(0~1), 数值越高顶栏越淡, 当横幅关闭时此选项无效.`,useDarkStyle:`夜间模式更适合光线暗的环境, 并会大量应用主题颜色.`,darkSchedule:`设置一个使用夜间模式的时间段, 进入/离开此时间段时, 会自动开启/关闭夜间模式.\n结束时间小于起始时间时将视为次日, 如18:006:00表示晚上18:00到次日6:00.`,darkScheduleStart:`设置计划时段的起始时间.`,darkScheduleEnd:`设置计划时段的结束时间.`,compactLayout:`设置首页是否使用紧凑布局, 视频的间距会减小并削去圆角, 分区栏的图标会使用高清重制版. 目前仅支持首页, 其他分区的样式后续会添加.`,useCommentStyle:`- 删除热评头像下方的关注按钮\n- 删除用户的等级标识\n- 删除发送源信息(来自安卓客户端这种)\n- 发送时间移动到右上角\n- 位图图标全部换用矢量图标, 高分屏不会模糊\n注: 关注和等级可以通过鼠标停留在头像上, 在弹出的资料卡小窗中查看. 暂不支持动态里的评论, 以后会加.`,overrideNavBar:`开启后, 在主站中总是把搜索框置于顶栏, 如果页面里没有搜索栏则不会显示.`,showBanner:`控制是否显示主站顶部的横幅`,preserveRank:`控制是否在搜索框左侧显示排行榜图标.`,blurVideoControl:`模糊视频控制栏背景, 原版的阴影效果将无效.`,customControlBackground:`给视频控制栏附上半透明的黑色, 代替原来的阴影.`,customControlBackgroundOpacity:`设置控制栏着色的黑色不透明度(0~1), 数值越大黑色越浓.`,harunaScale:`根据屏幕DPI缩放直播看板娘的大小以提高像素的清晰度.`,removeLiveWatermark:`删除观看直播时角落的水印.`,removeVideoTopMask:`删除视频里鼠标经过时出现在右上角的覆盖层.`,removeAds:`删除站内的各种广告. 包括首页的推广模块, 手机app推荐, 视频页面右侧的广告等.`,watchLaterRedirect:`将稍后再看的链接重定向为普通播放网址, 以使用新版播放页面.`,hideTopSearch:`将搜索框的推荐词替换为搜索.`,fullTweetsTitle:`在顶栏的动态预览框中, 总是展开完整的标题.`,fullPageTitle:`在视频选集列表中, 总是展开完整的标题.`,showDeadVideoTitle:`在空间的收藏夹中, 为已失效视频恢复标题和封面.`,useBiliplusRedirect:`将失效视频重定向到BiliPlus.`,touchNavBar:`删除顶栏右侧的一级链接(从大会员历史), 以方便触屏设备快速预览信息. 被删除的链接可从各预览中的查看更多进入.`,comboLike:`为素质三连(长按点赞)启用触摸支持.`,touchVideoPlayer:`增大控制栏的按钮间距, 使触摸操作更准确. 并为播放器启用触摸支持:\n- 左右滑动可调整进度\n- 上下滑动可调整音量\n- 进度调整可在左上角和右上角取消\n- 在不同位置滑动, 可以使用3档不同的灵敏度.`,touchVideoPlayerAnimation:`决定是否要对触摸调整的提示框使用出现/消失动画, 此动画可能导致掉帧.`,touchVideoPlayerDoubleTapControl:`将操作方式更改为: 单击显示/隐藏控制栏, 双击播放/暂停.`,toast:`允许在网页左下角显示来自本脚本的消息, 如更新提醒, 错误提示等.`,toastInternalError:`开启后, 错误消息将显示详细的技术性错误信息及堆栈跟踪, 这通常用于准确地确定问题发生的原因, 所以报告问题时这些信息会非常有用.`,useCache:`使用缓存以提高脚本的加载速度.`};function t(e){const a=$(e).find("input");if(a.length>0){return a.attr("key")}return null}(async()=>{a.applyStyle("settingsTooltipStyle");const e=await SpinQuery.select(()=>document.querySelector(".gui-settings-tooltip"));document.querySelectorAll(".gui-settings-content>ul>li").forEach(a=>{a.addEventListener("mouseover",()=>{const s=n[t(a)];if(s!==undefined){e.innerHTML=s;e.classList.add("show")}});a.addEventListener("mouseout",()=>{e.classList.remove("show")})})})();return{export:n}}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/settings-tooltip.min.js"] = (()=>{return(e,a)=>{const n={useDefaultPlayerMode:`控制是否使用默认播放器模式, 可以为常规, 宽屏网页全屏(全屏还未完成).`,defaultPlayerMode:`设置默认的播放器模式.`,applyPlayerModeOnPlay:`是否在播放时应用模式, 若选择否就会在未开始播放时就应用.`,useDefaultPlayerLayout:`设置默认的播放器布局, 尽量在相应的页面里设置(比如在番剧播放页面设置番剧播放器布局), 否则可能没有效果.\n- 旧版: 传统布局\n- 新版: 视频区默认的新版布局\n注: 旧版布局中, 很多脚本功能将不适用.`,defaultPlayerLayout:`设置视频区的布局.`,defaultBangumiLayout:`设置番剧区的布局.`,useDefaultVideoQuality:`进入视频时自动选择指定的画质, 若视频最高画质低于所选画质, 则使用视频的最高画质.`,defaultVideoQuality:`设定自动选择的视频画质.`,autoLightOff:`首次播放时, 自动进入关灯模式.`,useDefaultDanmakuSettings:`设置默认是否开启弹幕, 以及是否记住防挡字幕和智能防挡弹幕.`,enableDanmaku:`控制弹幕是否默认开启.`,rememberDanmakuSettings:`控制是否记住弹幕设置, 包括防挡字幕和智能防挡弹幕. 在播放器中改动这些设置后, 每个视频都会默认使用这些设置.`,expandDanmakuList:`新版播放页面中, 弹幕列表默认收起以显示推荐的其他视频. 启用此功能可在每次加载视频时自动展开弹幕列表.`,expandDescription:`长的视频简介默认会被折叠, 启用此功能可以强制展开完整的视频简介.`,autoPlay:`进入视频页面时自动开始播放视频.`,autoContinue:`播放视频时如果检测到历史记录信息(上次看到...消息), 则自动跳转到相应的时间播放.`,skipChargeList:`自动跳过视频结尾的充电鸣谢.`,customStyleColor:`设定顶栏(样式调整启用时)和夜间模式使用的主题色, 可以点击颜色预览的圆圈打开色板, 其中含有预定义的16种主题色, 也可以在右侧的文本框直接输入任何有效的16进制颜色值(#rrggbb#rgb).`,useNewStyle:`主要会改变顶栏的样式, 并有一些其他地方的界面微调:\n- 为播放器增加主题色投影\n- 可控制顶栏对横幅的透明度\n- 使播放器按钮垂直对齐\n- 使部分搜索栏的提示文字的颜色更清晰\n- 隐藏播放页面的"返回旧版"侧栏\n- 修复直播间一些文字初始状态不正确`,blurBackgroundOpacity:`设置顶栏对横幅的透明度(0~1), 数值越高顶栏越淡, 当横幅关闭时此选项无效.`,useDarkStyle:`夜间模式更适合光线暗的环境, 并会大量应用主题颜色.`,darkSchedule:`设置一个使用夜间模式的时间段, 进入/离开此时间段时, 会自动开启/关闭夜间模式.\n结束时间小于起始时间时将视为次日, 如18:006:00表示晚上18:00到次日6:00.`,darkScheduleStart:`设置计划时段的起始时间.`,darkScheduleEnd:`设置计划时段的结束时间.`,compactLayout:`设置首页是否使用紧凑布局, 视频的间距会减小并削去圆角, 分区栏的图标会使用高清重制版. 目前仅支持首页, 其他分区的样式后续会添加.`,useCommentStyle:`- 删除热评头像下方的关注按钮\n- 删除用户的等级标识\n- 删除发送源信息(来自安卓客户端这种)\n- 发送时间移动到右上角\n- 位图图标全部换用矢量图标, 高分屏不会模糊\n注: 关注和等级可以通过鼠标停留在头像上, 在弹出的资料卡小窗中查看. 暂不支持动态里的评论, 以后会加.`,overrideNavBar:`开启后, 在主站中总是把搜索框置于顶栏, 如果页面里没有搜索栏则不会显示.`,showBanner:`控制是否显示主站顶部的横幅`,preserveRank:`控制是否在搜索框左侧显示排行榜图标.`,blurVideoControl:`模糊视频控制栏背景, 原版的阴影效果将无效.`,customControlBackground:`给视频控制栏附上半透明的黑色, 代替原来的阴影.`,customControlBackgroundOpacity:`设置控制栏着色的黑色不透明度(0~1), 数值越大黑色越浓.`,harunaScale:`根据屏幕DPI缩放直播看板娘的大小以提高像素的清晰度.`,removeLiveWatermark:`删除观看直播时角落的水印.`,removeVideoTopMask:`删除视频里鼠标经过时出现在右上角的覆盖层.`,removeAds:`删除站内的各种广告. 包括首页的推广模块, 手机app推荐, 视频页面右侧的广告等.`,watchLaterRedirect:`将稍后再看的链接重定向为普通播放网址, 以使用新版播放页面.`,hideTopSearch:`将搜索框的推荐词替换为搜索.`,fullTweetsTitle:`在顶栏的动态预览框中, 总是展开完整的标题.`,fullPageTitle:`在视频选集列表中, 总是展开完整的标题.`,showDeadVideoTitle:`在空间的收藏夹和频道中, 为已失效视频恢复标题和封面.`,useBiliplusRedirect:`将失效视频重定向到BiliPlus.`,touchNavBar:`删除顶栏右侧的一级链接(从大会员历史), 以方便触屏设备快速预览信息. 被删除的链接可从各预览中的查看更多进入.`,comboLike:`为素质三连(长按点赞)启用触摸支持.`,touchVideoPlayer:`增大控制栏的按钮间距, 使触摸操作更准确. 并为播放器启用触摸支持:\n- 左右滑动可调整进度\n- 上下滑动可调整音量\n- 进度调整可在左上角和右上角取消\n- 在不同位置滑动, 可以使用3档不同的灵敏度.`,touchVideoPlayerAnimation:`决定是否要对触摸调整的提示框使用出现/消失动画, 此动画可能导致掉帧.`,touchVideoPlayerDoubleTapControl:`将操作方式更改为: 单击显示/隐藏控制栏, 双击播放/暂停.`,toast:`允许在网页左下角显示来自本脚本的消息, 如更新提醒, 错误提示等.`,toastInternalError:`开启后, 错误消息将显示详细的技术性错误信息及堆栈跟踪, 这通常用于准确地确定问题发生的原因, 所以报告问题时这些信息会非常有用.`,useCache:`使用缓存以提高脚本的加载速度.`};function t(e){const a=$(e).find("input");if(a.length>0){return a.attr("key")}return null}(async()=>{a.applyStyle("settingsTooltipStyle");const e=await SpinQuery.select(()=>document.querySelector(".gui-settings-tooltip"));document.querySelectorAll(".gui-settings-content>ul>li").forEach(a=>{a.addEventListener("mouseover",()=>{const s=n[t(a)];if(s!==undefined){e.innerHTML=s;e.classList.add("show")}});a.addEventListener("mouseout",()=>{e.classList.remove("show")})})})();return{export:n}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/settings-search.min.js"] = (()=>{return(t,e)=>{class s{constructor(){this.input=document.querySelector(".gui-settings-search");const t=[...document.querySelectorAll(".gui-settings-content>ul>li")];const e=t=>e=>e.classList.contains("category")===t;this.categories=t.filter(e(true));this.items=t.filter(e(false));this.input.addEventListener("input",()=>this.keywordChange())}keywordChange(){const t=this.input.value.trim();const s=e.import("settingsTooltip");if(!t){this.categories.concat(this.items).forEach(t=>t.classList.add("folded"));return}this.items.forEach(e=>{const i=$(e).find("input").attr("key");const n=Resource.displayNames[i]+s[i].replace(/|<\/span>/g,"");if(n.includes(t)){e.classList.remove("folded")}else{e.classList.add("folded")}});this.foldCategories()}foldCategories(){for(const e of this.categories){function t(){let t=e.nextElementSibling;while(t!==null&&!t.classList.contains("category")){if(!t.classList.contains("folded")){return"remove"}t=t.nextElementSibling}return"add"}e.classList[t()]("folded")}}}return{export:s}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(e,t)=>{function n(e){let t=e.nextElementSibling;const n=[];while(t!==null&&!t.classList.contains("category")){n.push(t);t=t.nextElementSibling}return n}function i(e,t){$(`input[type='checkbox'][key='${e}']`).prop("checked",t);$(`input[type='text'][key='${e}']`).val(t)}function s(){for(const[t,n]of Object.entries(e)){i(t,n)}}function o(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$(".gui-settings-content ul li.category").on("click",e=>{const t=document.querySelector(".gui-settings-search");if(t.value!==""){t.value="";raiseEvent(t,"input")}e.currentTarget.classList.toggle("folded");n(e.currentTarget).forEach(e=>e.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",e=>{$(e.currentTarget).parent().toggleClass("opened")});onSettingsChange((t,n,i)=>{if(e[t]!==i){e[t]=i;$(`input[type='checkbox'][key='${t}']`).prop("checked",i).change();$(`input[type='text'][key='${t}']`).val(i).change()}})}function a(){const{Validator:n}=t.import("textValidate");const i=e=>{};$("input[type='checkbox'][key]").each((t,n)=>{$(n).on("change",()=>{const t=n.getAttribute("key");const s=n.checked;e[t]=s;i(t);saveSettings(e)})});$("input[type='text'][key]").each((t,s)=>{$(s).on("change",()=>{const t=s.getAttribute("key");const o=n.getValidator(t).validate(s.value);e[t]=o;s.value=o;i(t);saveSettings(e)})})}function c(){const e={};$(`input[dependencies]`).each((t,n)=>{const i=$(n).attr("dependencies");if(i){e[$(n).attr("key")]=i}});const t=t=>{const n=t.prop("checked");for(const i in e){const s=e[i].split(" ");if(s.indexOf(t.attr("key"))!==-1){let e=true;if(n&&s.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}const t=$(`li:has(input[key='${i}'])`);const o=e?"addClass":"removeClass";t[o]("disabled");$(`input[key='${i}'][type='text']`).parent()[o]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function r(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function l(){$(".gui-settings-content ul li.category").each((e,t)=>{$(t).click()})}function u(){if(!CSS.supports("backdrop-filter","blur(24px)")&&!CSS.supports("-webkit-backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);e.blurVideoControl=false;saveSettings(e)}if(window.devicePixelRatio===1){$("input[key=harunaScale]").prop("disabled",true);e.harunaScale=false;saveSettings(e)}if(e.defaultPlayerLayout==="旧版"){const t=$("input[key=overrideNavBar]");t.prop("disabled",true).change();if(e.overrideNavBar){t.prop("checked",false).change();e.overrideNavBar=false;saveSettings(e)}}}function p(){for(const[e,t]of Object.entries(Resource.displayNames)){const n=document.querySelector(`input[key=${e}]`);if(!n){continue}switch(n.type){case"checkbox":n.nextElementSibling.nextElementSibling.innerHTML=t;break;case"text":const e=n.parentElement;if(e.classList.contains("gui-settings-textbox-container")){n.previousElementSibling.innerHTML=t}else if(e.classList.contains("gui-settings-dropdown")){e.previousElementSibling.innerHTML=t}break;default:break}}}(async()=>{t.applyStyle("guiSettingsStyle");const e=t.data.guiSettingsDom.text;$("body").append(e);new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start();o();r();s();c();a();l();u();p();const n=t.import("themeColors");(new n).setupDom();const i=t.import("settingsSearch");new i})()}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/dark-styles.min.js"] = (()=>{return(e,l)=>{if(e.useDarkStyle){l.applyStyle("scrollbarStyle");SpinQuery.any(()=>$(".custom-scrollbar"),e=>e.removeClass("custom-scrollbar"));if($("#banner_link").length===0||$("#banner_link").length>0&&e.overrideNavBar&&!e.showBanner){l.applyImportantStyle("darkStyleNavBar")}l.applyStyle("darkStyle");l.applyImportantStyle("darkStyleImportant")}else{l.removeStyle("scrollbarStyle");l.removeStyle("darkStyleNavBar");l.removeStyle("darkStyle");l.removeStyle("darkStyleImportant")}}})(); @@ -1277,7 +1277,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/expand-description.min.css"] = `.video-desc .info{height:auto!important}.video-desc .btn{display:none!important}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/expand-description.min.js"] = (()=>{return(e,p)=>{p.applyStyle("expandDescriptionStyle")}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.css"] = `.bilibili-player-video-danmaku-setting-wrap{display:none!important}`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.js"] = (()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){reutrn}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings[t]=n.checked;saveSettings(e)})}}n();a()}}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.js"] = (()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){return}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings[t]=n.checked;saveSettings(e)})}}n();a()}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/skip-charge-list.min.css"] = `.bilibili-player .bilibili-player-area .bilibili-player-electric-panel{display:none!important}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/skip-charge-list.min.js"] = (()=>{return(e,i)=>{async function n(){const e=await SpinQuery.select(()=>document.querySelector("video"));e&&e.addEventListener("ended",async()=>{const e=await SpinQuery.select(()=>document.querySelector(".bilibili-player-electric-panel-jump"));e&&e.click()})}if(Observer.videoChange){Observer.videoChange(n)}else{Observer.childList("#bofqi",n)}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-layout.min.js"] = (()=>{return(e,t)=>{(async()=>{const t=await SpinQuery.select(()=>document.querySelector(`input[key=defaultPlayerLayout]`));const s=await SpinQuery.select(()=>document.querySelector(`input[key=defaultBangumiLayout]`));const o=await SpinQuery.select(()=>document.querySelector(`input[key=overrideNavBar]`));if(!t||!s){logError("无法加载播放器布局选项.");return}class i{setCookie(e,t){document.cookie=`${e}=${t};path=/;domain=.bilibili.com;max-age=31536000`}clearCookie(e){document.cookie=`${e}=;path=/;domain=.bilibili.com;max-age=0`}getValue(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;\\s*)${e}\\s*\\=\\s*([^;]*).*$)|^.*$`),"$1")}checkSettings(){return e.useDefaultPlayerLayout}checkCookies(){if(!this.checkSettings()){return}}useNewLayout(){if(!this.checkSettings()){return}}useOldLayout(){if(!this.checkSettings()){return}}setLayout(e){if(e){this.useNewLayout()}else{this.useOldLayout()}}}class u extends i{checkCookies(){super.checkCookies();const t=this.getValue(this.cookieKey);if(t===""||parseInt(t)<0&&e.defaultPlayerLayout!=="旧版"){this.useNewLayout()}else if(e.defaultPlayerLayout!=="新版"){this.useOldLayout()}}constructor(){super();this.cookieKey="stardustvideo";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,1);o.disabled=false;$(o).change()}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,-1);if(e.overrideNavBar){o.checked=false;o.disabled=true;$(o).change();e.overrideNavBar=false;saveSettings(e);Toast.info(`已关闭搜索栏置顶功能, 因为旧版视频播放器布局不兼容此功能.`,"提示",5e3)}}}class a extends i{checkCookies(){super.checkCookies();const t=this.getValue(this.cookieKey);if(t===""||parseInt(t)<=0&&e.defaultBangumiLayout!=="旧版"){this.useNewLayout()}else if(e.defaultBangumiLayout!=="新版"){this.useOldLayout()}}constructor(){super();this.cookieKey="stardustpgcv";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,"0606")}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,0)}}const c=new u;$(t).on("input",()=>{c.setLayout(t.value==="新版")});const r=new a;$(s).on("input",()=>{r.setLayout(s.value==="新版")})})()}})(); @@ -1286,7 +1286,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/medal-helper.min.js"] = (()=>{return(e,t)=>{class i{constructor(e,t){this.isActive=e;this.id=t}static parseJson(e,{successAction:t,errorMessage:i,errorAction:a}){const s=JSON.parse(e);if(s.code!==0){logError(`${i} 错误码:${s.code} ${s.message||""}`);return a(s)}return t(s)}}class a extends i{constructor({medal_id:e,status:t,level:i,medalName:a,uname:s}){super(t===1,e);this.level=i;this.name=a;this.upName=s}static async getList(){return i.parseJson(await Ajax.getTextWithCredentials("https://api.live.bilibili.com/i/api/medal?page=1&pageSize=256"),{successAction:e=>e.data.fansMedalList.map(e=>new a(e)),errorAction:()=>[],errorMessage:"无法获取勋章列表."})}static getContainer(){return $("#medal-helper .medal-popup ul")}static getItemTemplate(e){return`
      • \n \n
      • `}async activate(){return i.parseJson(await Ajax.getTextWithCredentials(`https://api.live.bilibili.com/i/ajaxWearFansMedal?medal_id=${this.id}`),{successAction:()=>{this.isActive=true;return true},errorAction:()=>false,errorMessage:"佩戴勋章失败."})}async deactivate(){return i.parseJson(await Ajax.getTextWithCredentials(`https://api.live.bilibili.com/i/ajaxCancelWear`),{successAction:()=>{this.isActive=false;return true},errorAction:()=>false,errorMessage:"卸下勋章失败."})}}class s extends i{constructor({id:e,cid:t,wear:i,css:a,name:r,source:n}){super(i,a);this.tid=e;this.cid=t;this.name=r;this.source=n;s.getImageMap().then(e=>{this.imageUrl=e[this.id]})}static async getImageMap(){if(s.imageMap===undefined){return i.parseJson(await Ajax.getTextWithCredentials("https://api.live.bilibili.com/rc/v1/Title/webTitles"),{successAction(e){s.imageMap={};e.data.forEach(e=>{s.imageMap[e.identification]=e.web_pic_url});return s.imageMap},errorAction:()=>{return{}},errorMessage:"获取头衔图片失败."})}else{return s.imageMap}}static async getList(){return i.parseJson(await Ajax.getTextWithCredentials("https://api.live.bilibili.com/i/api/ajaxTitleInfo?page=1&pageSize=256&had=1"),{successAction:e=>e.data.list.map(e=>new s(e)),errorAction:()=>[],errorMessage:"无法获取头衔列表."})}static getContainer(){return $("#title-helper .medal-popup ul")}static getItemTemplate(e){return`
      • \n \n
      • `}async activate(){return i.parseJson(await Ajax.postTextWithCredentials(`https://api.live.bilibili.com/i/ajaxWearTitle`,`id=${this.tid}&cid=${this.cid}`),{successAction:()=>{this.isActive=true;return true},errorAction:()=>false,errorMessage:"佩戴头衔失败."})}async deactivate(){return i.parseJson(await Ajax.postTextWithCredentials(`https://api.live.bilibili.com/i/ajaxCancelWearTitle`,""),{successAction:()=>{this.isActive=false;return true},errorAction:()=>false,errorMessage:"卸下头衔失败."})}}async function r(e){const t=e.getContainer();const i=await e.getList();const a=async()=>{const i=await e.getList();i.forEach(e=>{const i=t.find(`li[data-id=${e.id}]`);if(e.isActive){i.addClass("active")}else{i.removeClass("active")}i.find(`input`).prop("checked",e.isActive)})};i.forEach(s=>{const r=$(e.getItemTemplate(s));t.append(r);const n=r.find("input")[0];r.on("click",e=>{if(e.target===n){return}if(s.isActive){s.deactivate().then(a)}else{const e=i.find(e=>e.isActive);if(e){e.isActive=false}s.activate().then(a)}})})}return{export:{Badge:i,Medal:a,Title:s},widget:{condition:()=>document.domain==="live.bilibili.com",content:t.data.medalHelperDom.text,success:()=>{$(".medal-helper").each((e,t)=>{const i=$(t);const a=i.find(".medal-popup")[0];i.on("click",e=>{if(!a.contains(e.target)){a.classList.toggle("opened")}})});r(a);s.getImageMap().then(()=>r(s))}}}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/medal-helper.min.css"] = `.medal-popup{position:absolute;top:calc(100% + 2px);transition:.16s ease-out;transform-origin:top;transform:scaleY(0) translateX(-50%);left:50%;background:#fff;box-shadow:0 3px 20px 2px #0004;z-index:100}.medal-popup.opened{transform:scaleY(1) translateX(-50%)}.medal-popup *{transition:.2s}.medal-popup ul{list-style:none;margin:0;padding:0}.medal-popup ul>li.active{box-shadow:0 0 4px 0 var(--theme-color)}.medal-popup ul>li:hover{background-color:rgba(0,0,0,.16)}.medal-popup label{display:flex;align-items:center;justify-content:center;cursor:pointer;padding:8px}.medal-popup label>*{flex-shrink:0}.medal-popup input[type=radio]{visibility:collapse;width:0;margin:0;padding:0}.medal-popup input[type=radio]~i{opacity:0;transform:scale(.8);margin:0}.medal-popup input[type=radio]~.fans-medal-item{margin:0 8px}.medal-popup input[type=radio]:checked~i{opacity:1}.title-image{display:inline-block;vertical-align:middle;height:20px}.fans-medal-item .label{width:40px;text-align:center;padding:0 2px;color:#fff}.fans-medal-item .level{width:16px;background-color:#fff;text-align:center;color:#61decb}.fans-medal-item .label,.fans-medal-item .level{position:relative;display:block;float:left}.fans-medal-item{display:inline-block;height:14px;line-height:14px;color:#fff;border:1px solid #61decb;border-left:0;white-space:nowrap;border-radius:2px;flex-shrink:0;font-size:12px}.level-1,.level-2,.level-3,.level-4{border-color:#61decb}.level-1 .label,.level-2 .label,.level-3 .label,.level-4 .label{background-color:#61decb}.level-1 .level,.level-2 .level,.level-3 .level,.level-4 .level{color:#61decb}.level-5,.level-6,.level-7,.level-8{border-color:#5896de}.level-5 .label,.level-6 .label,.level-7 .label,.level-8 .label{background-color:#5896de}.level-5 .level,.level-6 .level,.level-7 .level,.level-8 .level{color:#5896de}.level-10,.level-11,.level-12,.level-9{border-color:#a068f1}.level-10 .label,.level-11 .label,.level-12 .label,.level-9 .label{background-color:#a068f1}.level-10 .level,.level-11 .level,.level-12 .level,.level-9 .level{color:#a068f1}.level-13,.level-14,.level-15,.level-16{border-color:#ff86b2}.level-13 .label,.level-14 .label,.level-15 .label,.level-16 .label{background-color:#ff86b2}.level-13 .level,.level-14 .level,.level-15 .level,.level-16 .level{color:#ff86b2}.level-17,.level-18,.level-19,.level-20{border-color:#f6be18}.level-17 .label,.level-18 .label,.level-19 .label,.level-20 .label{background-color:#f6be18}.level-17 .level,.level-18 .level,.level-19 .level,.level-20 .level{color:#f6be18}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/medal-helper.min.html"] = `
        更换勋章
          更换头衔
            `; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/show-dead-video-title.min.js"] = (()=>{return(t,e)=>{function i(){const e=$(".fav-video-list>li.disabled").removeClass("disabled");e.each((e,i)=>{const a=$(i);const r=a.attr("data-aid");const n=a.find("img").attr("alt");const l=(()=>{if(t.useBiliplusRedirect){return`https://www.biliplus.com/video/av${r}`}else{return`//www.bilibili.com/video/av${r}`}})();a.find(".i-watchlater").css("display","none");a.find("a.cover").attr("target","_blank").attr("href",l);a.find("a.title").attr("title",n).attr("target","_blank").attr("href",l).text(n)})}SpinQuery.any(()=>$(".fav-content"),()=>{Observer.childListSubtree(".fav-content",i)})}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/show-dead-video-title.min.js"] = (()=>{return(t,e)=>{function i(){const e=$(".fav-video-list>li.disabled,.video-list>li.disabled").removeClass("disabled");e.each((e,i)=>{const a=$(i);const r=a.attr("data-aid");const s=a.find("img").attr("alt");const n=(()=>{if(t.useBiliplusRedirect){return`https://www.biliplus.com/video/av${r}`}else{return`//www.bilibili.com/video/av${r}`}})();a.find(".i-watchlater").css("display","none");a.find("a.cover").attr("target","_blank").attr("href",n);a.find("a.title").attr("title",s).attr("target","_blank").attr("href",n).text(s)})}SpinQuery.any(()=>$(".fav-content"),()=>{Observer.childListSubtree(".fav-content",i)});SpinQuery.any(()=>$("#app>.s-space"),()=>{Observer.childListSubtree("#app>.s-space",i)})}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/auto-play.min.js"] = (()=>{return(e,i)=>{SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>e&&e.paused===true,e=>e.play())}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/comment.min.js"] = (()=>{return(r,e)=>{}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/comment.min.css"] = `.comment-list .list-item{position:relative}.bb-comment .comment-list .list-item .info,.dynamic-list-item-wrap .item-detail>.info{display:flex}.bb-comment .comment-list .list-item .info .floor,.dynamic-list-item-wrap .item-detail>.info .floor{order:1}.bb-comment .comment-list .list-item .info .reply,.dynamic-list-item-wrap .item-detail>.info .reply{order:2}.bb-comment .comment-list .list-item .info .operation,.dynamic-list-item-wrap .item-detail>.info .operation{order:3;flex-grow:1;display:flex!important;justify-content:flex-end}.bb-comment .comment-list .list-item>.con>.reply-box{transform:translateX(0)}.bb-comment .comment-list .list-item>.con>.info{margin-top:4px}.bb-comment .comment-list .list-item>.con>.info>.time,.item-detail>.info>.time{position:absolute;right:8px;top:24px;margin:0;line-height:normal;color:#000}.item-detail>.info>.time{top:12px;opacity:1}.reply-box .item-user>a{margin-right:8px}.bb-comment .comment-header .tabs-order li.on:after,.bb-comment .comment-list .list-item .user-face .hot-follow,.bb-comment .comment-list .list-item>.con>.info>.plad,.bb-comment .nameplate,.comment-area .dynamic-level,.dynamic-list-item-wrap .info .plat{display:none}.bb-comment .comment-list .reply-con{position:relative}.bb-comment .comment-list .reply-con>.info>.time,.dynamic-list-item-wrap .reply-box .time{position:absolute;right:8px;top:0;margin:0;opacity:.5;line-height:normal;color:#000}.dynamic-list-item-wrap .reply-box .time{top:10px;opacity:.7}.bb-comment .comment-list .list-item .user{margin-right:120px}.reply-box .item-user .text{display:block}.bb-comment .comment-list .list-item .user .level{visibility:hidden;width:0;margin:0}.bb-comment .comment-list .list-item .info .hate>*,.bb-comment .comment-list .list-item .info .like>*,.bb-comment .comment-list .list-item .info .operation .spot,.bb-comment .comment-send .comment-emoji>*,.dynamic-hate i,.dynamic-like i{transition:.2s ease-out}.bb-comment .comment-list .list-item .info .hate i,.bb-comment .comment-list .list-item .info .like i,.bb-comment .comment-list .list-item .info .operation .spot,.bb-comment .comment-send .comment-emoji .face,.dynamic-hate i,.dynamic-like i,.dynamic-spot,.textarea-container .comm-tool .comm-emoji .icon-face{height:16px;width:16px;background-position:center!important;opacity:.5}.bb-comment .comment-list .list-item .info .hate span,.bb-comment .comment-list .list-item .info .like span,.bb-comment .comment-send .comment-emoji span{opacity:.5}.bb-comment .comment-list .list-item .info .hate span,.bb-comment .comment-list .list-item .info .hate.hated span,.bb-comment .comment-list .list-item .info .hate:hover span,.bb-comment .comment-list .list-item .info .like span,.bb-comment .comment-list .list-item .info .like.liked span,.bb-comment .comment-list .list-item .info .like:hover span,.bb-comment .comment-send .comment-emoji span{color:#000}.bb-comment .comment-list .list-item .info .hate:hover>*,.bb-comment .comment-list .list-item .info .like.hated:hover>*,.bb-comment .comment-list .list-item .info .like.hated>*,.bb-comment .comment-list .list-item .info .like.liked:hover>*,.bb-comment .comment-list .list-item .info .like.liked>*,.bb-comment .comment-list .list-item .info .like:hover>*,.bb-comment .comment-list .list-item .info .operation .spot:hover,.bb-comment .comment-send .comment-emoji.open .face,.bb-comment .comment-send .comment-emoji:hover .face,.bb-comment .comment-send .comment-emoji:hover span{opacity:.7}.bb-comment .comment-list .list-item .info .like i,.dynamic-like i{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-list .list-item .info .like.liked i,.bb-comment .comment-list .list-item .info .like.liked:hover i,.dynamic-like:hover i,.dynamic-liked i{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-list .list-item .info .hate i,.dynamic-hate i{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-list .list-item .info .hate.hated i,.bb-comment .comment-list .list-item .info .hate.hated:hover i,.dynamic-hate:hover i,.dynamic-hated i{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-list .list-item .info .operation .spot,.dynamic-spot{background:url('data:image/svg+xml;utf-8,')}.bb-comment .comment-send .comment-emoji .face,.textarea-container .comm-tool .comm-emoji .icon-face{background:url('data:image/svg+xml;utf-8,')}.bb-comment .reply-notice .notice-item{background-color:#0001;border:none;display:flex;align-items:center;padding:10px 14px}.bb-comment .reply-notice .notice-item .icon-notice{order:0;position:static;margin-right:12px}.bb-comment .reply-notice .notice-item a{order:1;flex-grow:1;color:#000}.bb-comment .reply-notice .notice-item .icon-close-notice,.bb-comment .reply-notice .notice-item .icon-notice{height:18px;width:18px;background-position:center!important;opacity:.7}.bb-comment .reply-notice .notice-item .icon-notice{background:url('data:image/svg+xml;utf-8,')}.bb-comment .reply-notice .notice-item .icon-close-notice{order:2;position:static;background:url('data:image/svg+xml;utf-8,')}`; diff --git a/min/default-danmaku-settings.min.js b/min/default-danmaku-settings.min.js index f8f383d51..278696e1d 100644 --- a/min/default-danmaku-settings.min.js +++ b/min/default-danmaku-settings.min.js @@ -1 +1 @@ -(()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){reutrn}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings[t]=n.checked;saveSettings(e)})}}n();a()}}})(); \ No newline at end of file +(()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){return}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings[t]=n.checked;saveSettings(e)})}}n();a()}}})(); \ No newline at end of file diff --git a/min/settings-tooltip.min.js b/min/settings-tooltip.min.js index 6d283b3ae..429a4a9d5 100644 --- a/min/settings-tooltip.min.js +++ b/min/settings-tooltip.min.js @@ -1 +1 @@ -(()=>{return(e,a)=>{const n={useDefaultPlayerMode:`控制是否使用默认播放器模式, 可以为常规, 宽屏网页全屏(全屏还未完成).`,defaultPlayerMode:`设置默认的播放器模式.`,applyPlayerModeOnPlay:`是否在播放时应用模式, 若选择否就会在未开始播放时就应用.`,useDefaultPlayerLayout:`设置默认的播放器布局, 尽量在相应的页面里设置(比如在番剧播放页面设置番剧播放器布局), 否则可能没有效果.\n- 旧版: 传统布局\n- 新版: 视频区默认的新版布局\n注: 旧版布局中, 很多脚本功能将不适用.`,defaultPlayerLayout:`设置视频区的布局.`,defaultBangumiLayout:`设置番剧区的布局.`,useDefaultVideoQuality:`进入视频时自动选择指定的画质, 若视频最高画质低于所选画质, 则使用视频的最高画质.`,defaultVideoQuality:`设定自动选择的视频画质.`,autoLightOff:`首次播放时, 自动进入关灯模式.`,useDefaultDanmakuSettings:`设置默认是否开启弹幕, 以及是否记住防挡字幕和智能防挡弹幕.`,enableDanmaku:`控制弹幕是否默认开启.`,rememberDanmakuSettings:`控制是否记住弹幕设置, 包括防挡字幕和智能防挡弹幕. 在播放器中改动这些设置后, 每个视频都会默认使用这些设置.`,expandDanmakuList:`新版播放页面中, 弹幕列表默认收起以显示推荐的其他视频. 启用此功能可在每次加载视频时自动展开弹幕列表.`,expandDescription:`长的视频简介默认会被折叠, 启用此功能可以强制展开完整的视频简介.`,autoPlay:`进入视频页面时自动开始播放视频.`,autoContinue:`播放视频时如果检测到历史记录信息(上次看到...消息), 则自动跳转到相应的时间播放.`,skipChargeList:`自动跳过视频结尾的充电鸣谢.`,customStyleColor:`设定顶栏(样式调整启用时)和夜间模式使用的主题色, 可以点击颜色预览的圆圈打开色板, 其中含有预定义的16种主题色, 也可以在右侧的文本框直接输入任何有效的16进制颜色值(#rrggbb#rgb).`,useNewStyle:`主要会改变顶栏的样式, 并有一些其他地方的界面微调:\n- 为播放器增加主题色投影\n- 可控制顶栏对横幅的透明度\n- 使播放器按钮垂直对齐\n- 使部分搜索栏的提示文字的颜色更清晰\n- 隐藏播放页面的"返回旧版"侧栏\n- 修复直播间一些文字初始状态不正确`,blurBackgroundOpacity:`设置顶栏对横幅的透明度(0~1), 数值越高顶栏越淡, 当横幅关闭时此选项无效.`,useDarkStyle:`夜间模式更适合光线暗的环境, 并会大量应用主题颜色.`,darkSchedule:`设置一个使用夜间模式的时间段, 进入/离开此时间段时, 会自动开启/关闭夜间模式.\n结束时间小于起始时间时将视为次日, 如18:006:00表示晚上18:00到次日6:00.`,darkScheduleStart:`设置计划时段的起始时间.`,darkScheduleEnd:`设置计划时段的结束时间.`,compactLayout:`设置首页是否使用紧凑布局, 视频的间距会减小并削去圆角, 分区栏的图标会使用高清重制版. 目前仅支持首页, 其他分区的样式后续会添加.`,useCommentStyle:`- 删除热评头像下方的关注按钮\n- 删除用户的等级标识\n- 删除发送源信息(来自安卓客户端这种)\n- 发送时间移动到右上角\n- 位图图标全部换用矢量图标, 高分屏不会模糊\n注: 关注和等级可以通过鼠标停留在头像上, 在弹出的资料卡小窗中查看. 暂不支持动态里的评论, 以后会加.`,overrideNavBar:`开启后, 在主站中总是把搜索框置于顶栏, 如果页面里没有搜索栏则不会显示.`,showBanner:`控制是否显示主站顶部的横幅`,preserveRank:`控制是否在搜索框左侧显示排行榜图标.`,blurVideoControl:`模糊视频控制栏背景, 原版的阴影效果将无效.`,customControlBackground:`给视频控制栏附上半透明的黑色, 代替原来的阴影.`,customControlBackgroundOpacity:`设置控制栏着色的黑色不透明度(0~1), 数值越大黑色越浓.`,harunaScale:`根据屏幕DPI缩放直播看板娘的大小以提高像素的清晰度.`,removeLiveWatermark:`删除观看直播时角落的水印.`,removeVideoTopMask:`删除视频里鼠标经过时出现在右上角的覆盖层.`,removeAds:`删除站内的各种广告. 包括首页的推广模块, 手机app推荐, 视频页面右侧的广告等.`,watchLaterRedirect:`将稍后再看的链接重定向为普通播放网址, 以使用新版播放页面.`,hideTopSearch:`将搜索框的推荐词替换为搜索.`,fullTweetsTitle:`在顶栏的动态预览框中, 总是展开完整的标题.`,fullPageTitle:`在视频选集列表中, 总是展开完整的标题.`,showDeadVideoTitle:`在空间的收藏夹中, 为已失效视频恢复标题和封面.`,useBiliplusRedirect:`将失效视频重定向到BiliPlus.`,touchNavBar:`删除顶栏右侧的一级链接(从大会员历史), 以方便触屏设备快速预览信息. 被删除的链接可从各预览中的查看更多进入.`,comboLike:`为素质三连(长按点赞)启用触摸支持.`,touchVideoPlayer:`增大控制栏的按钮间距, 使触摸操作更准确. 并为播放器启用触摸支持:\n- 左右滑动可调整进度\n- 上下滑动可调整音量\n- 进度调整可在左上角和右上角取消\n- 在不同位置滑动, 可以使用3档不同的灵敏度.`,touchVideoPlayerAnimation:`决定是否要对触摸调整的提示框使用出现/消失动画, 此动画可能导致掉帧.`,touchVideoPlayerDoubleTapControl:`将操作方式更改为: 单击显示/隐藏控制栏, 双击播放/暂停.`,toast:`允许在网页左下角显示来自本脚本的消息, 如更新提醒, 错误提示等.`,toastInternalError:`开启后, 错误消息将显示详细的技术性错误信息及堆栈跟踪, 这通常用于准确地确定问题发生的原因, 所以报告问题时这些信息会非常有用.`,useCache:`使用缓存以提高脚本的加载速度.`};function t(e){const a=$(e).find("input");if(a.length>0){return a.attr("key")}return null}(async()=>{a.applyStyle("settingsTooltipStyle");const e=await SpinQuery.select(()=>document.querySelector(".gui-settings-tooltip"));document.querySelectorAll(".gui-settings-content>ul>li").forEach(a=>{a.addEventListener("mouseover",()=>{const s=n[t(a)];if(s!==undefined){e.innerHTML=s;e.classList.add("show")}});a.addEventListener("mouseout",()=>{e.classList.remove("show")})})})();return{export:n}}})(); \ No newline at end of file +(()=>{return(e,a)=>{const n={useDefaultPlayerMode:`控制是否使用默认播放器模式, 可以为常规, 宽屏网页全屏(全屏还未完成).`,defaultPlayerMode:`设置默认的播放器模式.`,applyPlayerModeOnPlay:`是否在播放时应用模式, 若选择否就会在未开始播放时就应用.`,useDefaultPlayerLayout:`设置默认的播放器布局, 尽量在相应的页面里设置(比如在番剧播放页面设置番剧播放器布局), 否则可能没有效果.\n- 旧版: 传统布局\n- 新版: 视频区默认的新版布局\n注: 旧版布局中, 很多脚本功能将不适用.`,defaultPlayerLayout:`设置视频区的布局.`,defaultBangumiLayout:`设置番剧区的布局.`,useDefaultVideoQuality:`进入视频时自动选择指定的画质, 若视频最高画质低于所选画质, 则使用视频的最高画质.`,defaultVideoQuality:`设定自动选择的视频画质.`,autoLightOff:`首次播放时, 自动进入关灯模式.`,useDefaultDanmakuSettings:`设置默认是否开启弹幕, 以及是否记住防挡字幕和智能防挡弹幕.`,enableDanmaku:`控制弹幕是否默认开启.`,rememberDanmakuSettings:`控制是否记住弹幕设置, 包括防挡字幕和智能防挡弹幕. 在播放器中改动这些设置后, 每个视频都会默认使用这些设置.`,expandDanmakuList:`新版播放页面中, 弹幕列表默认收起以显示推荐的其他视频. 启用此功能可在每次加载视频时自动展开弹幕列表.`,expandDescription:`长的视频简介默认会被折叠, 启用此功能可以强制展开完整的视频简介.`,autoPlay:`进入视频页面时自动开始播放视频.`,autoContinue:`播放视频时如果检测到历史记录信息(上次看到...消息), 则自动跳转到相应的时间播放.`,skipChargeList:`自动跳过视频结尾的充电鸣谢.`,customStyleColor:`设定顶栏(样式调整启用时)和夜间模式使用的主题色, 可以点击颜色预览的圆圈打开色板, 其中含有预定义的16种主题色, 也可以在右侧的文本框直接输入任何有效的16进制颜色值(#rrggbb#rgb).`,useNewStyle:`主要会改变顶栏的样式, 并有一些其他地方的界面微调:\n- 为播放器增加主题色投影\n- 可控制顶栏对横幅的透明度\n- 使播放器按钮垂直对齐\n- 使部分搜索栏的提示文字的颜色更清晰\n- 隐藏播放页面的"返回旧版"侧栏\n- 修复直播间一些文字初始状态不正确`,blurBackgroundOpacity:`设置顶栏对横幅的透明度(0~1), 数值越高顶栏越淡, 当横幅关闭时此选项无效.`,useDarkStyle:`夜间模式更适合光线暗的环境, 并会大量应用主题颜色.`,darkSchedule:`设置一个使用夜间模式的时间段, 进入/离开此时间段时, 会自动开启/关闭夜间模式.\n结束时间小于起始时间时将视为次日, 如18:006:00表示晚上18:00到次日6:00.`,darkScheduleStart:`设置计划时段的起始时间.`,darkScheduleEnd:`设置计划时段的结束时间.`,compactLayout:`设置首页是否使用紧凑布局, 视频的间距会减小并削去圆角, 分区栏的图标会使用高清重制版. 目前仅支持首页, 其他分区的样式后续会添加.`,useCommentStyle:`- 删除热评头像下方的关注按钮\n- 删除用户的等级标识\n- 删除发送源信息(来自安卓客户端这种)\n- 发送时间移动到右上角\n- 位图图标全部换用矢量图标, 高分屏不会模糊\n注: 关注和等级可以通过鼠标停留在头像上, 在弹出的资料卡小窗中查看. 暂不支持动态里的评论, 以后会加.`,overrideNavBar:`开启后, 在主站中总是把搜索框置于顶栏, 如果页面里没有搜索栏则不会显示.`,showBanner:`控制是否显示主站顶部的横幅`,preserveRank:`控制是否在搜索框左侧显示排行榜图标.`,blurVideoControl:`模糊视频控制栏背景, 原版的阴影效果将无效.`,customControlBackground:`给视频控制栏附上半透明的黑色, 代替原来的阴影.`,customControlBackgroundOpacity:`设置控制栏着色的黑色不透明度(0~1), 数值越大黑色越浓.`,harunaScale:`根据屏幕DPI缩放直播看板娘的大小以提高像素的清晰度.`,removeLiveWatermark:`删除观看直播时角落的水印.`,removeVideoTopMask:`删除视频里鼠标经过时出现在右上角的覆盖层.`,removeAds:`删除站内的各种广告. 包括首页的推广模块, 手机app推荐, 视频页面右侧的广告等.`,watchLaterRedirect:`将稍后再看的链接重定向为普通播放网址, 以使用新版播放页面.`,hideTopSearch:`将搜索框的推荐词替换为搜索.`,fullTweetsTitle:`在顶栏的动态预览框中, 总是展开完整的标题.`,fullPageTitle:`在视频选集列表中, 总是展开完整的标题.`,showDeadVideoTitle:`在空间的收藏夹和频道中, 为已失效视频恢复标题和封面.`,useBiliplusRedirect:`将失效视频重定向到BiliPlus.`,touchNavBar:`删除顶栏右侧的一级链接(从大会员历史), 以方便触屏设备快速预览信息. 被删除的链接可从各预览中的查看更多进入.`,comboLike:`为素质三连(长按点赞)启用触摸支持.`,touchVideoPlayer:`增大控制栏的按钮间距, 使触摸操作更准确. 并为播放器启用触摸支持:\n- 左右滑动可调整进度\n- 上下滑动可调整音量\n- 进度调整可在左上角和右上角取消\n- 在不同位置滑动, 可以使用3档不同的灵敏度.`,touchVideoPlayerAnimation:`决定是否要对触摸调整的提示框使用出现/消失动画, 此动画可能导致掉帧.`,touchVideoPlayerDoubleTapControl:`将操作方式更改为: 单击显示/隐藏控制栏, 双击播放/暂停.`,toast:`允许在网页左下角显示来自本脚本的消息, 如更新提醒, 错误提示等.`,toastInternalError:`开启后, 错误消息将显示详细的技术性错误信息及堆栈跟踪, 这通常用于准确地确定问题发生的原因, 所以报告问题时这些信息会非常有用.`,useCache:`使用缓存以提高脚本的加载速度.`};function t(e){const a=$(e).find("input");if(a.length>0){return a.attr("key")}return null}(async()=>{a.applyStyle("settingsTooltipStyle");const e=await SpinQuery.select(()=>document.querySelector(".gui-settings-tooltip"));document.querySelectorAll(".gui-settings-content>ul>li").forEach(a=>{a.addEventListener("mouseover",()=>{const s=n[t(a)];if(s!==undefined){e.innerHTML=s;e.classList.add("show")}});a.addEventListener("mouseout",()=>{e.classList.remove("show")})})})();return{export:n}}})(); \ No newline at end of file diff --git a/min/show-dead-video-title.min.js b/min/show-dead-video-title.min.js index ed54ae89e..e0bad1841 100644 --- a/min/show-dead-video-title.min.js +++ b/min/show-dead-video-title.min.js @@ -1 +1 @@ -(()=>{return(t,e)=>{function i(){const e=$(".fav-video-list>li.disabled").removeClass("disabled");e.each((e,i)=>{const a=$(i);const r=a.attr("data-aid");const n=a.find("img").attr("alt");const l=(()=>{if(t.useBiliplusRedirect){return`https://www.biliplus.com/video/av${r}`}else{return`//www.bilibili.com/video/av${r}`}})();a.find(".i-watchlater").css("display","none");a.find("a.cover").attr("target","_blank").attr("href",l);a.find("a.title").attr("title",n).attr("target","_blank").attr("href",l).text(n)})}SpinQuery.any(()=>$(".fav-content"),()=>{Observer.childListSubtree(".fav-content",i)})}})(); \ No newline at end of file +(()=>{return(t,e)=>{function i(){const e=$(".fav-video-list>li.disabled,.video-list>li.disabled").removeClass("disabled");e.each((e,i)=>{const a=$(i);const r=a.attr("data-aid");const s=a.find("img").attr("alt");const n=(()=>{if(t.useBiliplusRedirect){return`https://www.biliplus.com/video/av${r}`}else{return`//www.bilibili.com/video/av${r}`}})();a.find(".i-watchlater").css("display","none");a.find("a.cover").attr("target","_blank").attr("href",n);a.find("a.title").attr("title",s).attr("target","_blank").attr("href",n).text(s)})}SpinQuery.any(()=>$(".fav-content"),()=>{Observer.childListSubtree(".fav-content",i)});SpinQuery.any(()=>$("#app>.s-space"),()=>{Observer.childListSubtree("#app>.s-space",i)})}})(); \ No newline at end of file diff --git a/utils/gui-settings/tooltip/settings-tooltip.js b/utils/gui-settings/tooltip/settings-tooltip.js index dc36c759e..103186d17 100644 --- a/utils/gui-settings/tooltip/settings-tooltip.js +++ b/utils/gui-settings/tooltip/settings-tooltip.js @@ -58,7 +58,7 @@ hideTopSearch: `将搜索框的推荐词替换为搜索.`, fullTweetsTitle: `在顶栏的动态预览框中, 总是展开完整的标题.`, fullPageTitle: `在视频选集列表中, 总是展开完整的标题.`, - showDeadVideoTitle: `在空间的收藏夹中, 为已失效视频恢复标题和封面.`, + showDeadVideoTitle: `在空间的收藏夹和频道中, 为已失效视频恢复标题和封面.`, useBiliplusRedirect: `将失效视频重定向到BiliPlus.`, touchNavBar: `删除顶栏右侧的一级链接(从大会员历史), 以方便触屏设备快速预览信息. 被删除的链接可从各预览中的查看更多进入.`, comboLike: `为素质三连(长按点赞)启用触摸支持.`, diff --git a/utils/show-dead-video-title.js b/utils/show-dead-video-title.js index c42419566..c5de3d09d 100644 --- a/utils/show-dead-video-title.js +++ b/utils/show-dead-video-title.js @@ -4,7 +4,7 @@ { function showTitle() { - const deadVideos = $(".fav-video-list>li.disabled").removeClass("disabled"); + const deadVideos = $(".fav-video-list>li.disabled,.video-list>li.disabled").removeClass("disabled"); deadVideos.each((_, it) => { const $it = $(it); @@ -37,5 +37,9 @@ { Observer.childListSubtree(".fav-content", showTitle); }); + SpinQuery.any(() => $("#app>.s-space"), () => + { + Observer.childListSubtree("#app>.s-space", showTitle); + }); }; })(); \ No newline at end of file diff --git a/video/default-danmaku-settings/default-danmaku-settings.js b/video/default-danmaku-settings/default-danmaku-settings.js index 64f364462..7ef787d1e 100644 --- a/video/default-danmaku-settings/default-danmaku-settings.js +++ b/video/default-danmaku-settings/default-danmaku-settings.js @@ -34,7 +34,7 @@ const panel = await SpinQuery.select(() => document.querySelector(".bilibili-player-video-danmaku-setting")); if (!panel) { - reutrn; + return; } await loadLazyPanel(".bilibili-player-video-danmaku-setting"); // bilibili will hides the panel after 200ms delay