Add biliplus redirect

This commit is contained in:
the1812 2019-03-05 12:29:15 +08:00
parent bca5953960
commit 638d9a9f20
12 changed files with 91 additions and 17 deletions

View File

@ -71,6 +71,7 @@
- 展开选集标题: `关闭`
- 显示失效视频信息: `关闭`
- 失效视频重定向: `关闭`
- BiliPlus跳转支持: `关闭`
### 触摸
- 顶栏触摸优化: `关闭`
- 素质三连触摸支持: `关闭`
@ -255,6 +256,8 @@
在直播区(live.bilibili.com)中, 可从`附加功能`中直接切换勋章和头衔.
### 显示失效视频信息
在个人空间中, 为已失效视频恢复标题和封面. 也可以使用`失效视频重定向`转到[BiliPlus](https://biliplus.com)观看.
### BiliPlus跳转支持
在视频/番剧/空间中, 附加功能`转到BiliPlus`, 点击可以转到[BiliPlus](https://biliplus.com)上对应的页面.
## 触摸
### 顶栏

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved (Preview)
// @version 1.7.12
// @version 1.7.13
// @description Bilibili Evolved 的预览版, 可以抢先体验新功能.
// @author Grant Howard, Coulomb-G
// @copyright 2019, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)
@ -75,6 +75,7 @@ const settings = {
autoPlay: false,
showDeadVideoTitle: false,
useBiliplusRedirect: false,
biliplusRedirect: false,
useCommentStyle: true,
imageResolution: false,
toastInternalError: false,
@ -716,6 +717,12 @@ function loadResources()
imageResolution: "总是显示原图",
},
},
biliplusRedirect: {
path: "min/biliplus-redirect.min.js",
displayNames: {
biliplusRedirect: "BiliPlus跳转支持",
}
},
};
Resource.root = "https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/";
Resource.all = {};

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved
// @version 1.7.12
// @version 1.7.13
// @description 增强哔哩哔哩Web端体验: 下载视频, 封面, 弹幕; 自定义播放器的画质, 模式, 布局; 删除广告, 使用夜间模式, 修复界面瑕疵; 以及增加对触屏设备的支持等.
// @author Grant Howard, Coulomb-G
// @copyright 2019, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)
@ -75,6 +75,7 @@ const settings = {
autoPlay: false,
showDeadVideoTitle: false,
useBiliplusRedirect: false,
biliplusRedirect: false,
useCommentStyle: true,
imageResolution: false,
toastInternalError: false,
@ -716,6 +717,12 @@ function loadResources()
imageResolution: "总是显示原图",
},
},
biliplusRedirect: {
path: "min/biliplus-redirect.min.js",
displayNames: {
biliplusRedirect: "BiliPlus跳转支持",
}
},
};
Resource.root = "https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/";
Resource.all = {};

1
min/biliplus-redirect.min.js vendored Normal file
View File

@ -0,0 +1 @@
(()=>{return(i,l)=>{const c=["bilibili.com/video/av","bilibili.com/bangumi/play","bilibili.com/bangumi/media","space.bilibili.com"];return{widget:{condition:()=>{return c.some(i=>document.URL.includes(i))},content:`\n <button class="gui-settings-flat-button" id="biliplus-redirect">\n <i class="icon-biliplus"></i>\n <span>转到BiliPlus</span>\n </button>`,success:()=>{const i=document.querySelector("#biliplus-redirect");i.addEventListener("click",()=>{if(location.host==="space.bilibili.com"){const i=location.host.match(/space.bilibili.com\/([\d]+)/)[1];location.replace(`www.biliplus.com/space/${i}`)}else{location.host="www.biliplus.com"}})}}}}})();

2
min/icons.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,35 @@
const supportedUrls = [
"bilibili.com/video/av",
"bilibili.com/bangumi/play",
"bilibili.com/bangumi/media",
"space.bilibili.com"
];
export default {
widget: {
condition: () =>
{
return supportedUrls.some(url => document.URL.includes(url));
},
content: /*html*/`
<button class="gui-settings-flat-button" id="biliplus-redirect">
<i class="icon-biliplus"></i>
<span>转到BiliPlus</span>
</button>`,
success: () =>
{
const button = document.querySelector("#biliplus-redirect");
button.addEventListener("click", () =>
{
if (location.host === "space.bilibili.com")
{
const uid = location.host.match(/space.bilibili.com\/([\d]+)/)[1];
location.replace(`www.biliplus.com/space/${uid}`);
}
else
{
location.host = "www.biliplus.com";
}
});
},
}
};

View File

@ -121,4 +121,8 @@
.icons-enabled .icon-live-title::after
{
background-image: url('data:image/svg+xml;utf-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24"><g fill="black"><polygon points="8.63,15.83 7,14.89 7,9.11 12,6.23 13.63,7.17 15.9,3.25 6.95,3.25 1.89,12 6.37,19.75"/><polygon points="6.95,20.75 6.95,20.75 6.95,20.75"/><polygon points="17.63,4.25 15.37,8.17 17,9.11 17,14.89 12,17.77 10.37,16.83 8.1,20.75 17.05,20.75 22.11,12"/></g></svg>');
}
.icons-enabled .icon-biliplus::after
{
background-image: url('data:image/svg+xml;utf-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24"><g fill="black"> <path d="M3.46,7.35h4.08c1.91,0,3.29,0.29,4.14,0.86c0.85,0.57,1.28,1.47,1.28,2.68c0,0.84-0.23,1.54-0.7,2.09c-0.47,0.55-1.14,0.91-2.02,1.07v0.1c1.11,0.19,1.92,0.57,2.43,1.14s0.77,1.33,0.77,2.28c0,1.28-0.44,2.28-1.31,2.99c-0.87,0.71-2.09,1.07-3.65,1.07H3.46V7.35z M5.26,13.43H7.9c1.12,0,1.93-0.18,2.44-0.54s0.76-0.96,0.76-1.8c0-0.77-0.28-1.33-0.83-1.68C9.71,9.06,8.83,8.89,7.62,8.89H5.26V13.43z M5.26,14.93v5.18h2.88c1.15,0,2-0.22,2.55-0.67c0.55-0.45,0.83-1.12,0.83-2.01c0-0.85-0.29-1.48-0.88-1.89c-0.59-0.41-1.47-0.61-2.64-0.61H5.26z"/></g><g fill="black"><path d="M18.11,6.1h3.18v1.14h-3.18v3.3h-1.15v-3.3h-3.18V6.1h3.18V2.78h1.15V6.1z"/></g></svg>');
}

View File

@ -57,6 +57,7 @@ export const toolTips = {
fullPageTitle: `在视频选集列表中, 总是展开完整的标题.`,
showDeadVideoTitle: `在个人空间中, 为已失效视频恢复标题和封面.`,
useBiliplusRedirect: `将失效视频重定向到BiliPlus.`,
biliplusRedirect: `在视频/番剧/空间中, 附加功能<span>"转到BiliPlus"</span>, 点击可以转到BiliPlus上对应的页面.`,
touchNavBar: `删除顶栏右侧的一级链接(从<span>大会员</span>到<span>历史</span>), 以方便触屏设备快速预览信息. 被删除的链接可从各预览中的<span>查看更多</span>进入.`,
comboLike: `为素质三连(长按点赞)启用触摸支持.`,
touchVideoPlayer: `增大控制栏的按钮间距, 使触摸操作更准确. 并为播放器启用触摸支持:

View File

@ -1 +1 @@
1.7.12
1.7.13