mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
971 B
JavaScript
1 line
971 B
JavaScript
(()=>{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.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()}}})(); |