This commit is contained in:
the1812 2019-02-14 14:27:36 +08:00
parent cb6643647b
commit fc7a8bd643
4 changed files with 8 additions and 3 deletions

View File

@ -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 n(e,t){const n=await SpinQuery.select(()=>document.querySelector(e));if(!n){return}n.checked=t;raiseEvent(n,"change")}if(!e.enableDanmaku){n(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const n={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function i(){await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,i]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(n[t]));if(e!==null&&e.checked!==undefined&&e.checked!==i){e.click()}}}async function a(){for(const t in e.danmakuSettings){const i=await SpinQuery.select(()=>document.querySelector(n[t]));if(!i){return}i.addEventListener("click",()=>{e.danmakuSettings[t]=i.checked;saveSettings(e)})}}i();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){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/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(`已关闭<span>搜索栏置顶</span>功能, 因为旧版视频播放器布局不兼容此功能.`,"提示",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==="新版")})})()}})();

View File

@ -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 n(e,t){const n=await SpinQuery.select(()=>document.querySelector(e));if(!n){return}n.checked=t;raiseEvent(n,"change")}if(!e.enableDanmaku){n(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const n={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function i(){await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,i]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(n[t]));if(e!==null&&e.checked!==undefined&&e.checked!==i){e.click()}}}async function a(){for(const t in e.danmakuSettings){const i=await SpinQuery.select(()=>document.querySelector(n[t]));if(!i){return}i.addEventListener("click",()=>{e.danmakuSettings[t]=i.checked;saveSettings(e)})}}i();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){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/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(`已关闭<span>搜索栏置顶</span>功能, 因为旧版视频播放器布局不兼容此功能.`,"提示",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==="新版")})})()}})();

View File

@ -1 +1 @@
(()=>{return(e,t)=>{async function n(e,t){const n=await SpinQuery.select(()=>document.querySelector(e));if(!n){return}n.checked=t;raiseEvent(n,"change")}if(!e.enableDanmaku){n(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const n={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function i(){await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,i]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(n[t]));if(e!==null&&e.checked!==undefined&&e.checked!==i){e.click()}}}async function a(){for(const t in e.danmakuSettings){const i=await SpinQuery.select(()=>document.querySelector(n[t]));if(!i){return}i.addEventListener("click",()=>{e.danmakuSettings[t]=i.checked;saveSettings(e)})}}i();a()}}})();
(()=>{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()}}})();

View File

@ -31,6 +31,11 @@
};
async function applyDanmakuSettings()
{
const panel = await SpinQuery.select(() => document.querySelector(".bilibili-player-video-danmaku-setting"));
if (!panel)
{
reutrn;
}
await loadLazyPanel(".bilibili-player-video-danmaku-setting");
// bilibili will hides the panel after 200ms delay
setTimeout(() => resources.removeStyle("defaultDanmakuSettingsStyle"), 300);