Fix toast appears on saveable images

This commit is contained in:
the1812 2019-09-25 20:04:53 +08:00
parent e8ada29031
commit b1ddfe36e4
8 changed files with 15 additions and 10 deletions

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved (Offline)
// @version 436.05
// @version 436.18
// @description Bilibili Evolved 的离线版, 所有功能都已内置于脚本中.
// @author Grant Howard, Coulomb-G
// @copyright 2019, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)
@ -1013,7 +1013,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/about.min.html"] = `<div class=bilibili-evolved-about><div class=about-header><i class="mdi mdi-information-outline mdi-24px"></i><span class=about-title>关于</span></div><div class=about-content><p v-if=branch class="name light"v-html=logoImage></p><p v-if=branch class="name dark"v-html=logoImageDark></p><p class=version>v{{version}} · {{clientType}}</p><p class=love><a target=_blank href=https://github.com/the1812/Bilibili-Evolved/ >Made with ❤  </a><a target=_blank href=https://github.com/the1812/Bilibili-Evolved/blob/master/donate.md>Buy me a coffee ☕</a></p><section class=authors><span class=title>Authors</span><a class=author target=_blank v-for="author of authors"v-bind:href=author.link>{{author.name}}</a></section><section class=contributors><span class=title>Contributors</span><a class=contributor target=_blank v-for="contributor of contributors"v-bind:href=contributor.link>{{contributor.name}}</a></section><section class=supporters><a class=title target=_blank href=https://github.com/the1812/Bilibili-Evolved/blob/preview/donate.md#历史>View Supporters</a></section><section class=participants><span class=title>Community Power</span><span class=fetching v-if=fetching></span><a class=participant target=_blank v-for="participant of participants"v-bind:href=participant.link>{{participant.name}}</a></section><section class=websites><span class=title>Websites</span><a class=website target=_blank v-for="website of websites"v-bind:href=website.link>{{website.name}}</a></section><section class=components><span class=title>Components</span><a class=component target=_blank v-for="component of components"v-bind:href=component.link>{{component.name}}</a></section></div></div>`;
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/about.min.js"] = (()=>{return(t,e)=>{(async()=>{const i=await e.importAsync("aboutHtml");document.body.insertAdjacentHTML("beforeend",i);dq(".bilibili-evolved-about").addEventListener("be:about-load",()=>{const e=(t,e)=>t.charCodeAt(0)-e.charCodeAt(0);const i=(t,i)=>e(t.name,i.name);const o=GM_info.script.name.match(/Bilibili Evolved \((.*)\)/);const n=o?o[1]:"Stable";new Vue({el:".bilibili-evolved-about",data:{version:t.currentVersion,clientType:n,logoImage:null,logoImageDark:null,branch:null,authors:[{name:"Grant Howard",link:"https://github.com/the1812"},{name:"Coulomb-G",link:"https://github.com/Coulomb-G"}],contributors:[{name:"PleiadeSubaru",link:"https://github.com/Etherrrr"}].sort(i),fetching:true,participants:[],websites:[{name:"GitHub",link:"https://github.com/the1812/Bilibili-Evolved/"},{name:"Greasy Fork",link:"https://greasyfork.org/zh-CN/scripts/373563-bilibili-evolved"}],components:[{name:"Vue.js",link:"https://cn.vuejs.org/index.html"},{name:"JSZip",link:"https://stuk.github.io/jszip/"},{name:"jQuery",link:"http://jquery.com/"},{name:"debounce",link:"https://github.com/component/debounce/"},{name:"Slip.js",link:"https://github.com/kornelski/slip"},{name:"MDI",link:"https://materialdesignicons.com"},{name:"Lodash",link:"https://lodash.com/"}]},mounted(){dq(".bilibili-evolved-about").addEventListener("be:about-load-community",()=>{this.init()},{once:true})},methods:{async getLogos(){this.logoImage=await Ajax.getText(`https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/bilibili-evolved-wide.svg`);this.logoImageDark=await Ajax.getText(`https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/bilibili-evolved-wide-dark.svg`)},async init(){this.branch=/Preview|Local/.test(n)?"preview":"master";this.getLogos();const t=new Set;let e=[];let o=1;do{e=await Ajax.getJson(`https://api.github.com/repos/the1812/Bilibili-Evolved/issues?state=all&direction=asc&per_page=100&page=${o}`).catch(()=>{e=[{name:"电波无法到达(´・_・`)",link:null}]});o++;for(const i of e){t.add(i.user.login)}}while(e.length>0);this.participants=[...t].map(t=>{return{name:t,link:`https://github.com/${t}`}}).filter(({link:t})=>{return!this.authors.some(e=>e.link===t)&&!this.contributors.some(e=>e.link===t)}).sort(i);this.fetching=false}}})},{once:true})})()}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-apis.min.js"] = (()=>{return(t,e)=>{class s extends EventTarget{constructor(){super(...arguments);this.cards=[]}addCard(t){if(t instanceof Element&&t.classList.contains("card")){if(t.querySelector(".skeleton")!==null){const e=Observer.childList(t,()=>{if(t.querySelector(".skeleton")===null){e.forEach(t=>t.stop());this.addCard(t)}})}else{const e=this.parseCard(t);this.cards.push(e);const s=new CustomEvent("addCard",{detail:e});this.dispatchEvent(s)}}}removeCard(t){if(t instanceof Element&&t.classList.contains("card")){const e=this.parseCard(t).id;const s=this.cards.findIndex(t=>t.id===e);const r=this.cards[s];this.cards.splice(s,1);const n=new CustomEvent("removeCard",{detail:r});this.dispatchEvent(n)}}parseCard(t){const e=e=>{if(t.querySelector(e)===null){return""}return t.querySelector(e).innerText};const s=t=>{const s=parseInt(e(t));if(isNaN(s)){return 0}return s};const r={id:t.getAttribute("data-did"),username:e(".main-content .user-name"),text:e(".card-content .text.description"),reposts:s(".button-bar .single-button:nth-child(1) .text-offset"),comments:s(".button-bar .single-button:nth-child(2) .text-offset"),likes:s(".button-bar .single-button:nth-child(3) .text-offset")};return r}async startWatching(){const t=await SpinQuery.select(".card-list .content");if(!t){return false}const e=[...t.querySelectorAll(".content>.card")];e.forEach(t=>this.addCard(t));Observer.childList(t,t=>{t.forEach(t=>{t.addedNodes.forEach(t=>this.addCard(t));t.removedNodes.forEach(t=>this.removeCard(t))})});return true}}const r=new s;return{export:{activityCardsManager:r}}}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-image-saver.min.js"] = (()=>{return(e,o)=>{(async()=>{if(document.domain!=="t.bilibili.com"){return}const e=e=>{const o=e.querySelector(".image-viewer");if(o===null){console.log(e)}else{o.addEventListener("contextmenu",()=>{Toast.success(`<img src="${o.src}" width="200">`,"解除动态存图限制")})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,o=>{o.forEach(o=>{const t=[...o.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));t.forEach(e)})})})()}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-image-saver.min.js"] = (()=>{return(e,t)=>{(async()=>{if(document.domain!=="t.bilibili.com"&&document.domain!=="space.bilibili.com"){return}const e=e=>{const t=e.querySelector(".image-viewer");if(t===null){console.log(e)}else{t.addEventListener("contextmenu",()=>{setTimeout(()=>{const e=dq(".pop-message .toast-text");if(e&&e.innerHTML.includes("作者设置了禁止保存")){Toast.success(`<img src="${t.src}" width="200">`,"解除动态存图限制")}},200)})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,t=>{t.forEach(t=>{const o=[...t.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));o.forEach(e)})})})()}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc-profile-item.vue.min.js"] = (()=>{return(e,i)=>{const t=`<div class=profile-item :class="{duplicate: duplicateName, selected}"><template v-if=!editing>{{profile.name}}</template><template v-else><input type=text v-model=name></template><icon v-if=!editing style="transform: scale(0.9)"type=mdi icon=pencil-outline title=重命名 @click.native="editing = true"></icon><icon v-if=editing type=mdi icon=check title=确定 @click.native=saveProfile()></icon></div>`;i.applyStyleFromText(`.profile-item{display:flex;align-items:center;padding:4px 8px;background-color:#8882;border-radius:4px;border:2px solid transparent;flex-shrink:0;cursor:pointer}.profile-item:not(:last-child){margin-right:8px}.profile-item.duplicate{border-color:red}.profile-item.selected:not(.duplicate){border-color:var(--theme-color)}.profile-item input[type=text]{width:5em;border:none!important;padding:0!important;margin:0!important;line-height:normal}`,"aria2-rpc-profile-item-style");return{export:Object.assign({template:t},{components:{Icon:()=>i.importAsync("icon.vue")},props:["profile","deletable","selected"],data(){return{name:this.profile.name,editing:false,duplicateName:false}},methods:{saveProfile(){if(this.name===this.profile.name){this.duplicateName=false;this.editing=false;return}if(this.name===""||e.aria2RpcOptionProfiles.some(e=>e.name===this.name)){this.duplicateName=true;return}else{this.duplicateName=false;if(e.aria2RpcOptionSelectedProfile===this.profile.name){e.aria2RpcOptionSelectedProfile=this.name}this.profile.name=this.name;this.editing=false;this.$emit("profile-update")}}}})}}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc-profiles.vue.min.js"] = (()=>{return(e,i)=>{const r=`<div class=aria2-rpc-profiles><div class=profiles-header><h2>预设</h2><div class=profile-operations><div v-if="profiles.length > 1"class="operation delete-profile"@click=deleteProfile() title=删除预设><icon type=mdi icon=trash-can-outline></icon></div><div class="operation new-profile"@click=addProfile() title=新增预设><icon type=mdi icon=plus></icon></div></div></div><div class=profiles-list><profile-item v-for="(profile, index) of profiles":key="profile.name + index"@profile-update=profileUpdate() @click.native=changeProfile(profile) :profile=profile :deletable="profiles.length > 1":selected="profile.name === selectedProfile"></profile-item></div></div>`;i.applyStyleFromText(`.aria2-rpc-profiles .profiles-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.aria2-rpc-profiles .profiles-header .profile-operations{display:flex;align-items:center}.aria2-rpc-profiles .profiles-header .profile-operations .operation{padding:4px;background-color:#8882;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer}.aria2-rpc-profiles .profiles-header .profile-operations .operation:not(:last-child){margin-right:8px}.aria2-rpc-profiles .profiles-header .profile-operations .operation:hover{background-color:#8884}.aria2-rpc-profiles .profiles-header .profile-operations .operation .mdi{margin:0}.aria2-rpc-profiles .profiles-list{display:flex;overflow:auto;scrollbar-width:none!important}.aria2-rpc-profiles .profiles-list::-webkit-scrollbar{height:0!important}`,"aria2-rpc-profiles-style");const o={name:"未命名",...e.aria2RpcOption};return{export:Object.assign({template:r},{components:{ProfileItem:()=>i.importAsync("aria2-rpc-profile-item.vue"),Icon:()=>i.importAsync("icon.vue")},data(){this.migrateOldProfiles();const i=[...e.aria2RpcOptionProfiles];if(i.length===0){i.push(o);e.aria2RpcOptionProfiles=i}return{profiles:i,selectedProfile:e.aria2RpcOptionSelectedProfile||o.name}},watch:{selectedProfile(i){if(e.aria2RpcOptionSelectedProfile!==i){e.aria2RpcOptionSelectedProfile=i}}},methods:{migrateOldProfiles(){const i=Object.getOwnPropertyNames(e.aria2RpcOption).filter(e=>!e.startsWith("_"));i.push("name");let r=false;for(const o of e.aria2RpcOptionProfiles){i.filter(e=>!(e in o)).forEach(i=>{o[i]=e.aria2RpcOption[i];console.log(`migrated profile property '${i}'`);r=true})}if(r){e.aria2RpcOptionProfiles=e.aria2RpcOptionProfiles}},profileUpdate(){e.aria2RpcOptionProfiles=this.profiles;this.selectedProfile=e.aria2RpcOptionSelectedProfile},changeProfile(e){this.selectedProfile=e.name;this.$emit("profile-change",e)},addProfile(){const i={...this.profiles.find(e=>e.name===this.selectedProfile)};i.name=i.name.replace(/[\d]+$/,"");if(this.profiles.some(e=>e.name===i.name)){let e=1;while(this.profiles.some(r=>r.name===i.name+e.toString())){e++}i.name=i.name+e.toString()}this.profiles.push(i);e.aria2RpcOptionProfiles=this.profiles;this.changeProfile(i)},deleteProfile(){const i=this.profiles.findIndex(e=>e.name===this.selectedProfile);const r=i===0?0:i-1;const o=this.profiles[r];this.profiles.splice(i,1);e.aria2RpcOptionProfiles=this.profiles;this.changeProfile(o)}}})}}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc.min.js"] = (()=>{return(t,e)=>{function o(){const e=t.aria2RpcOption;const o=e.host.match(/^http[s]?:\/\//)?e.host:"http://"+e.host;const r="aria2.addUri";return{option:e,host:o,methodName:r}}async function r(t,e=false){try{let o=await t();if(typeof o==="string"){o=JSON.parse(o)}if(o.error!==undefined){if(o.error.code===1){logError(`请求遭到拒绝, 请检查您的密钥相关设置.`)}else{logError(`请求发生错误, code = ${o.error.code}, message = ${o.error.message}`)}return false}if(!e){Toast.success(`成功发送了请求, GID = ${o.result}`,"aria2 RPC",5e3)}return true}catch(t){logError(`无法连接到RPC主机.`);return false}}async function s(t,e=false){const{option:s,host:n,methodName:a}=o();return await r(async()=>{const e=window.btoa(unescape(encodeURIComponent(JSON.stringify(t.params))));const o=`${n}:${s.port}/jsonrpc?method=${a}&id=${t.id}&params=${e}`;console.log(`RPC request:`,o);if(o.startsWith("http:")){return await new Promise((t,e)=>{GM_xmlhttpRequest({method:"GET",url:o,responseType:"json",onload:e=>t(e.response),onerror:t=>e(t)})})}else{return await Ajax.getJson(o)}},e)}async function n(t,e=false){const{option:s,host:n,methodName:a}=o();return await r(async()=>{const e=`${n}:${s.port}/jsonrpc`;const o={method:a,id:t.id,params:t.params};if(e.startsWith("http:")){return await new Promise((t,r)=>{GM_xmlhttpRequest({method:"POST",url:e,responseType:"json",data:JSON.stringify(o),onload:e=>t(e.response),onerror:t=>r(t)})})}else{return await Ajax.postJson(e,o)}},e)}async function a(e,o=false){const r=t.aria2RpcOption;for(const t of e){let e;if(r.method==="get"){e=await s(t,o)}else{e=await n(t,o)}if(o===true&&e===false){logError(`${decodeURIComponent(t.id)} 导出失败`)}}}return{export:{sendRpc:a}}}})();

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved (Preview Offline)
// @version 436.05
// @version 436.18
// @description Bilibili Evolved 的预览离线版, 可以抢先体验新功能, 并且所有功能都已内置于脚本中.
// @author Grant Howard, Coulomb-G
// @copyright 2019, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)
@ -1013,7 +1013,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/about.min.html"] = `<div class=bilibili-evolved-about><div class=about-header><i class="mdi mdi-information-outline mdi-24px"></i><span class=about-title>关于</span></div><div class=about-content><p v-if=branch class="name light"v-html=logoImage></p><p v-if=branch class="name dark"v-html=logoImageDark></p><p class=version>v{{version}} · {{clientType}}</p><p class=love><a target=_blank href=https://github.com/the1812/Bilibili-Evolved/ >Made with ❤  </a><a target=_blank href=https://github.com/the1812/Bilibili-Evolved/blob/master/donate.md>Buy me a coffee ☕</a></p><section class=authors><span class=title>Authors</span><a class=author target=_blank v-for="author of authors"v-bind:href=author.link>{{author.name}}</a></section><section class=contributors><span class=title>Contributors</span><a class=contributor target=_blank v-for="contributor of contributors"v-bind:href=contributor.link>{{contributor.name}}</a></section><section class=supporters><a class=title target=_blank href=https://github.com/the1812/Bilibili-Evolved/blob/preview/donate.md#历史>View Supporters</a></section><section class=participants><span class=title>Community Power</span><span class=fetching v-if=fetching></span><a class=participant target=_blank v-for="participant of participants"v-bind:href=participant.link>{{participant.name}}</a></section><section class=websites><span class=title>Websites</span><a class=website target=_blank v-for="website of websites"v-bind:href=website.link>{{website.name}}</a></section><section class=components><span class=title>Components</span><a class=component target=_blank v-for="component of components"v-bind:href=component.link>{{component.name}}</a></section></div></div>`;
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/about.min.js"] = (()=>{return(t,e)=>{(async()=>{const i=await e.importAsync("aboutHtml");document.body.insertAdjacentHTML("beforeend",i);dq(".bilibili-evolved-about").addEventListener("be:about-load",()=>{const e=(t,e)=>t.charCodeAt(0)-e.charCodeAt(0);const i=(t,i)=>e(t.name,i.name);const o=GM_info.script.name.match(/Bilibili Evolved \((.*)\)/);const n=o?o[1]:"Stable";new Vue({el:".bilibili-evolved-about",data:{version:t.currentVersion,clientType:n,logoImage:null,logoImageDark:null,branch:null,authors:[{name:"Grant Howard",link:"https://github.com/the1812"},{name:"Coulomb-G",link:"https://github.com/Coulomb-G"}],contributors:[{name:"PleiadeSubaru",link:"https://github.com/Etherrrr"}].sort(i),fetching:true,participants:[],websites:[{name:"GitHub",link:"https://github.com/the1812/Bilibili-Evolved/"},{name:"Greasy Fork",link:"https://greasyfork.org/zh-CN/scripts/373563-bilibili-evolved"}],components:[{name:"Vue.js",link:"https://cn.vuejs.org/index.html"},{name:"JSZip",link:"https://stuk.github.io/jszip/"},{name:"jQuery",link:"http://jquery.com/"},{name:"debounce",link:"https://github.com/component/debounce/"},{name:"Slip.js",link:"https://github.com/kornelski/slip"},{name:"MDI",link:"https://materialdesignicons.com"},{name:"Lodash",link:"https://lodash.com/"}]},mounted(){dq(".bilibili-evolved-about").addEventListener("be:about-load-community",()=>{this.init()},{once:true})},methods:{async getLogos(){this.logoImage=await Ajax.getText(`https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/bilibili-evolved-wide.svg`);this.logoImageDark=await Ajax.getText(`https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/bilibili-evolved-wide-dark.svg`)},async init(){this.branch=/Preview|Local/.test(n)?"preview":"master";this.getLogos();const t=new Set;let e=[];let o=1;do{e=await Ajax.getJson(`https://api.github.com/repos/the1812/Bilibili-Evolved/issues?state=all&direction=asc&per_page=100&page=${o}`).catch(()=>{e=[{name:"电波无法到达(´・_・`)",link:null}]});o++;for(const i of e){t.add(i.user.login)}}while(e.length>0);this.participants=[...t].map(t=>{return{name:t,link:`https://github.com/${t}`}}).filter(({link:t})=>{return!this.authors.some(e=>e.link===t)&&!this.contributors.some(e=>e.link===t)}).sort(i);this.fetching=false}}})},{once:true})})()}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-apis.min.js"] = (()=>{return(t,e)=>{class s extends EventTarget{constructor(){super(...arguments);this.cards=[]}addCard(t){if(t instanceof Element&&t.classList.contains("card")){if(t.querySelector(".skeleton")!==null){const e=Observer.childList(t,()=>{if(t.querySelector(".skeleton")===null){e.forEach(t=>t.stop());this.addCard(t)}})}else{const e=this.parseCard(t);this.cards.push(e);const s=new CustomEvent("addCard",{detail:e});this.dispatchEvent(s)}}}removeCard(t){if(t instanceof Element&&t.classList.contains("card")){const e=this.parseCard(t).id;const s=this.cards.findIndex(t=>t.id===e);const r=this.cards[s];this.cards.splice(s,1);const n=new CustomEvent("removeCard",{detail:r});this.dispatchEvent(n)}}parseCard(t){const e=e=>{if(t.querySelector(e)===null){return""}return t.querySelector(e).innerText};const s=t=>{const s=parseInt(e(t));if(isNaN(s)){return 0}return s};const r={id:t.getAttribute("data-did"),username:e(".main-content .user-name"),text:e(".card-content .text.description"),reposts:s(".button-bar .single-button:nth-child(1) .text-offset"),comments:s(".button-bar .single-button:nth-child(2) .text-offset"),likes:s(".button-bar .single-button:nth-child(3) .text-offset")};return r}async startWatching(){const t=await SpinQuery.select(".card-list .content");if(!t){return false}const e=[...t.querySelectorAll(".content>.card")];e.forEach(t=>this.addCard(t));Observer.childList(t,t=>{t.forEach(t=>{t.addedNodes.forEach(t=>this.addCard(t));t.removedNodes.forEach(t=>this.removeCard(t))})});return true}}const r=new s;return{export:{activityCardsManager:r}}}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-image-saver.min.js"] = (()=>{return(e,o)=>{(async()=>{if(document.domain!=="t.bilibili.com"){return}const e=e=>{const o=e.querySelector(".image-viewer");if(o===null){console.log(e)}else{o.addEventListener("contextmenu",()=>{Toast.success(`<img src="${o.src}" width="200">`,"解除动态存图限制")})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,o=>{o.forEach(o=>{const t=[...o.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));t.forEach(e)})})})()}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-image-saver.min.js"] = (()=>{return(e,t)=>{(async()=>{if(document.domain!=="t.bilibili.com"&&document.domain!=="space.bilibili.com"){return}const e=e=>{const t=e.querySelector(".image-viewer");if(t===null){console.log(e)}else{t.addEventListener("contextmenu",()=>{setTimeout(()=>{const e=dq(".pop-message .toast-text");if(e&&e.innerHTML.includes("作者设置了禁止保存")){Toast.success(`<img src="${t.src}" width="200">`,"解除动态存图限制")}},200)})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,t=>{t.forEach(t=>{const o=[...t.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));o.forEach(e)})})})()}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc-profile-item.vue.min.js"] = (()=>{return(e,i)=>{const t=`<div class=profile-item :class="{duplicate: duplicateName, selected}"><template v-if=!editing>{{profile.name}}</template><template v-else><input type=text v-model=name></template><icon v-if=!editing style="transform: scale(0.9)"type=mdi icon=pencil-outline title=重命名 @click.native="editing = true"></icon><icon v-if=editing type=mdi icon=check title=确定 @click.native=saveProfile()></icon></div>`;i.applyStyleFromText(`.profile-item{display:flex;align-items:center;padding:4px 8px;background-color:#8882;border-radius:4px;border:2px solid transparent;flex-shrink:0;cursor:pointer}.profile-item:not(:last-child){margin-right:8px}.profile-item.duplicate{border-color:red}.profile-item.selected:not(.duplicate){border-color:var(--theme-color)}.profile-item input[type=text]{width:5em;border:none!important;padding:0!important;margin:0!important;line-height:normal}`,"aria2-rpc-profile-item-style");return{export:Object.assign({template:t},{components:{Icon:()=>i.importAsync("icon.vue")},props:["profile","deletable","selected"],data(){return{name:this.profile.name,editing:false,duplicateName:false}},methods:{saveProfile(){if(this.name===this.profile.name){this.duplicateName=false;this.editing=false;return}if(this.name===""||e.aria2RpcOptionProfiles.some(e=>e.name===this.name)){this.duplicateName=true;return}else{this.duplicateName=false;if(e.aria2RpcOptionSelectedProfile===this.profile.name){e.aria2RpcOptionSelectedProfile=this.name}this.profile.name=this.name;this.editing=false;this.$emit("profile-update")}}}})}}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc-profiles.vue.min.js"] = (()=>{return(e,i)=>{const r=`<div class=aria2-rpc-profiles><div class=profiles-header><h2>预设</h2><div class=profile-operations><div v-if="profiles.length > 1"class="operation delete-profile"@click=deleteProfile() title=删除预设><icon type=mdi icon=trash-can-outline></icon></div><div class="operation new-profile"@click=addProfile() title=新增预设><icon type=mdi icon=plus></icon></div></div></div><div class=profiles-list><profile-item v-for="(profile, index) of profiles":key="profile.name + index"@profile-update=profileUpdate() @click.native=changeProfile(profile) :profile=profile :deletable="profiles.length > 1":selected="profile.name === selectedProfile"></profile-item></div></div>`;i.applyStyleFromText(`.aria2-rpc-profiles .profiles-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.aria2-rpc-profiles .profiles-header .profile-operations{display:flex;align-items:center}.aria2-rpc-profiles .profiles-header .profile-operations .operation{padding:4px;background-color:#8882;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer}.aria2-rpc-profiles .profiles-header .profile-operations .operation:not(:last-child){margin-right:8px}.aria2-rpc-profiles .profiles-header .profile-operations .operation:hover{background-color:#8884}.aria2-rpc-profiles .profiles-header .profile-operations .operation .mdi{margin:0}.aria2-rpc-profiles .profiles-list{display:flex;overflow:auto;scrollbar-width:none!important}.aria2-rpc-profiles .profiles-list::-webkit-scrollbar{height:0!important}`,"aria2-rpc-profiles-style");const o={name:"未命名",...e.aria2RpcOption};return{export:Object.assign({template:r},{components:{ProfileItem:()=>i.importAsync("aria2-rpc-profile-item.vue"),Icon:()=>i.importAsync("icon.vue")},data(){this.migrateOldProfiles();const i=[...e.aria2RpcOptionProfiles];if(i.length===0){i.push(o);e.aria2RpcOptionProfiles=i}return{profiles:i,selectedProfile:e.aria2RpcOptionSelectedProfile||o.name}},watch:{selectedProfile(i){if(e.aria2RpcOptionSelectedProfile!==i){e.aria2RpcOptionSelectedProfile=i}}},methods:{migrateOldProfiles(){const i=Object.getOwnPropertyNames(e.aria2RpcOption).filter(e=>!e.startsWith("_"));i.push("name");let r=false;for(const o of e.aria2RpcOptionProfiles){i.filter(e=>!(e in o)).forEach(i=>{o[i]=e.aria2RpcOption[i];console.log(`migrated profile property '${i}'`);r=true})}if(r){e.aria2RpcOptionProfiles=e.aria2RpcOptionProfiles}},profileUpdate(){e.aria2RpcOptionProfiles=this.profiles;this.selectedProfile=e.aria2RpcOptionSelectedProfile},changeProfile(e){this.selectedProfile=e.name;this.$emit("profile-change",e)},addProfile(){const i={...this.profiles.find(e=>e.name===this.selectedProfile)};i.name=i.name.replace(/[\d]+$/,"");if(this.profiles.some(e=>e.name===i.name)){let e=1;while(this.profiles.some(r=>r.name===i.name+e.toString())){e++}i.name=i.name+e.toString()}this.profiles.push(i);e.aria2RpcOptionProfiles=this.profiles;this.changeProfile(i)},deleteProfile(){const i=this.profiles.findIndex(e=>e.name===this.selectedProfile);const r=i===0?0:i-1;const o=this.profiles[r];this.profiles.splice(i,1);e.aria2RpcOptionProfiles=this.profiles;this.changeProfile(o)}}})}}})();
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc.min.js"] = (()=>{return(t,e)=>{function o(){const e=t.aria2RpcOption;const o=e.host.match(/^http[s]?:\/\//)?e.host:"http://"+e.host;const r="aria2.addUri";return{option:e,host:o,methodName:r}}async function r(t,e=false){try{let o=await t();if(typeof o==="string"){o=JSON.parse(o)}if(o.error!==undefined){if(o.error.code===1){logError(`请求遭到拒绝, 请检查您的密钥相关设置.`)}else{logError(`请求发生错误, code = ${o.error.code}, message = ${o.error.message}`)}return false}if(!e){Toast.success(`成功发送了请求, GID = ${o.result}`,"aria2 RPC",5e3)}return true}catch(t){logError(`无法连接到RPC主机.`);return false}}async function s(t,e=false){const{option:s,host:n,methodName:a}=o();return await r(async()=>{const e=window.btoa(unescape(encodeURIComponent(JSON.stringify(t.params))));const o=`${n}:${s.port}/jsonrpc?method=${a}&id=${t.id}&params=${e}`;console.log(`RPC request:`,o);if(o.startsWith("http:")){return await new Promise((t,e)=>{GM_xmlhttpRequest({method:"GET",url:o,responseType:"json",onload:e=>t(e.response),onerror:t=>e(t)})})}else{return await Ajax.getJson(o)}},e)}async function n(t,e=false){const{option:s,host:n,methodName:a}=o();return await r(async()=>{const e=`${n}:${s.port}/jsonrpc`;const o={method:a,id:t.id,params:t.params};if(e.startsWith("http:")){return await new Promise((t,r)=>{GM_xmlhttpRequest({method:"POST",url:e,responseType:"json",data:JSON.stringify(o),onload:e=>t(e.response),onerror:t=>r(t)})})}else{return await Ajax.postJson(e,o)}},e)}async function a(e,o=false){const r=t.aria2RpcOption;for(const t of e){let e;if(r.method==="get"){e=await s(t,o)}else{e=await n(t,o)}if(o===true&&e===false){logError(`${decodeURIComponent(t.id)} 导出失败`)}}}return{export:{sendRpc:a}}}})();

View File

@ -1012,7 +1012,7 @@ onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/m
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/about.min.html"] = `<div class=bilibili-evolved-about><div class=about-header><i class="mdi mdi-information-outline mdi-24px"></i><span class=about-title>关于</span></div><div class=about-content><p v-if=branch class="name light"v-html=logoImage></p><p v-if=branch class="name dark"v-html=logoImageDark></p><p class=version>v{{version}} · {{clientType}}</p><p class=love><a target=_blank href=https://github.com/the1812/Bilibili-Evolved/ >Made with ❤  </a><a target=_blank href=https://github.com/the1812/Bilibili-Evolved/blob/master/donate.md>Buy me a coffee ☕</a></p><section class=authors><span class=title>Authors</span><a class=author target=_blank v-for="author of authors"v-bind:href=author.link>{{author.name}}</a></section><section class=contributors><span class=title>Contributors</span><a class=contributor target=_blank v-for="contributor of contributors"v-bind:href=contributor.link>{{contributor.name}}</a></section><section class=supporters><a class=title target=_blank href=https://github.com/the1812/Bilibili-Evolved/blob/preview/donate.md#历史>View Supporters</a></section><section class=participants><span class=title>Community Power</span><span class=fetching v-if=fetching></span><a class=participant target=_blank v-for="participant of participants"v-bind:href=participant.link>{{participant.name}}</a></section><section class=websites><span class=title>Websites</span><a class=website target=_blank v-for="website of websites"v-bind:href=website.link>{{website.name}}</a></section><section class=components><span class=title>Components</span><a class=component target=_blank v-for="component of components"v-bind:href=component.link>{{component.name}}</a></section></div></div>`;
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/about.min.js"] = (()=>{return(t,e)=>{(async()=>{const i=await e.importAsync("aboutHtml");document.body.insertAdjacentHTML("beforeend",i);dq(".bilibili-evolved-about").addEventListener("be:about-load",()=>{const e=(t,e)=>t.charCodeAt(0)-e.charCodeAt(0);const i=(t,i)=>e(t.name,i.name);const o=GM_info.script.name.match(/Bilibili Evolved \((.*)\)/);const n=o?o[1]:"Stable";new Vue({el:".bilibili-evolved-about",data:{version:t.currentVersion,clientType:n,logoImage:null,logoImageDark:null,branch:null,authors:[{name:"Grant Howard",link:"https://github.com/the1812"},{name:"Coulomb-G",link:"https://github.com/Coulomb-G"}],contributors:[{name:"PleiadeSubaru",link:"https://github.com/Etherrrr"}].sort(i),fetching:true,participants:[],websites:[{name:"GitHub",link:"https://github.com/the1812/Bilibili-Evolved/"},{name:"Greasy Fork",link:"https://greasyfork.org/zh-CN/scripts/373563-bilibili-evolved"}],components:[{name:"Vue.js",link:"https://cn.vuejs.org/index.html"},{name:"JSZip",link:"https://stuk.github.io/jszip/"},{name:"jQuery",link:"http://jquery.com/"},{name:"debounce",link:"https://github.com/component/debounce/"},{name:"Slip.js",link:"https://github.com/kornelski/slip"},{name:"MDI",link:"https://materialdesignicons.com"},{name:"Lodash",link:"https://lodash.com/"}]},mounted(){dq(".bilibili-evolved-about").addEventListener("be:about-load-community",()=>{this.init()},{once:true})},methods:{async getLogos(){this.logoImage=await Ajax.getText(`https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/bilibili-evolved-wide.svg`);this.logoImageDark=await Ajax.getText(`https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/bilibili-evolved-wide-dark.svg`)},async init(){this.branch=/Preview|Local/.test(n)?"preview":"master";this.getLogos();const t=new Set;let e=[];let o=1;do{e=await Ajax.getJson(`https://api.github.com/repos/the1812/Bilibili-Evolved/issues?state=all&direction=asc&per_page=100&page=${o}`).catch(()=>{e=[{name:"电波无法到达(´・_・`)",link:null}]});o++;for(const i of e){t.add(i.user.login)}}while(e.length>0);this.participants=[...t].map(t=>{return{name:t,link:`https://github.com/${t}`}}).filter(({link:t})=>{return!this.authors.some(e=>e.link===t)&&!this.contributors.some(e=>e.link===t)}).sort(i);this.fetching=false}}})},{once:true})})()}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/activity-apis.min.js"] = (()=>{return(t,e)=>{class s extends EventTarget{constructor(){super(...arguments);this.cards=[]}addCard(t){if(t instanceof Element&&t.classList.contains("card")){if(t.querySelector(".skeleton")!==null){const e=Observer.childList(t,()=>{if(t.querySelector(".skeleton")===null){e.forEach(t=>t.stop());this.addCard(t)}})}else{const e=this.parseCard(t);this.cards.push(e);const s=new CustomEvent("addCard",{detail:e});this.dispatchEvent(s)}}}removeCard(t){if(t instanceof Element&&t.classList.contains("card")){const e=this.parseCard(t).id;const s=this.cards.findIndex(t=>t.id===e);const r=this.cards[s];this.cards.splice(s,1);const n=new CustomEvent("removeCard",{detail:r});this.dispatchEvent(n)}}parseCard(t){const e=e=>{if(t.querySelector(e)===null){return""}return t.querySelector(e).innerText};const s=t=>{const s=parseInt(e(t));if(isNaN(s)){return 0}return s};const r={id:t.getAttribute("data-did"),username:e(".main-content .user-name"),text:e(".card-content .text.description"),reposts:s(".button-bar .single-button:nth-child(1) .text-offset"),comments:s(".button-bar .single-button:nth-child(2) .text-offset"),likes:s(".button-bar .single-button:nth-child(3) .text-offset")};return r}async startWatching(){const t=await SpinQuery.select(".card-list .content");if(!t){return false}const e=[...t.querySelectorAll(".content>.card")];e.forEach(t=>this.addCard(t));Observer.childList(t,t=>{t.forEach(t=>{t.addedNodes.forEach(t=>this.addCard(t));t.removedNodes.forEach(t=>this.removeCard(t))})});return true}}const r=new s;return{export:{activityCardsManager:r}}}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/activity-image-saver.min.js"] = (()=>{return(e,o)=>{(async()=>{if(document.domain!=="t.bilibili.com"){return}const e=e=>{const o=e.querySelector(".image-viewer");if(o===null){console.log(e)}else{o.addEventListener("contextmenu",()=>{Toast.success(`<img src="${o.src}" width="200">`,"解除动态存图限制")})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,o=>{o.forEach(o=>{const t=[...o.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));t.forEach(e)})})})()}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/activity-image-saver.min.js"] = (()=>{return(e,t)=>{(async()=>{if(document.domain!=="t.bilibili.com"&&document.domain!=="space.bilibili.com"){return}const e=e=>{const t=e.querySelector(".image-viewer");if(t===null){console.log(e)}else{t.addEventListener("contextmenu",()=>{setTimeout(()=>{const e=dq(".pop-message .toast-text");if(e&&e.innerHTML.includes("作者设置了禁止保存")){Toast.success(`<img src="${t.src}" width="200">`,"解除动态存图限制")}},200)})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,t=>{t.forEach(t=>{const o=[...t.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));o.forEach(e)})})})()}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/aria2-rpc-profile-item.vue.min.js"] = (()=>{return(e,i)=>{const t=`<div class=profile-item :class="{duplicate: duplicateName, selected}"><template v-if=!editing>{{profile.name}}</template><template v-else><input type=text v-model=name></template><icon v-if=!editing style="transform: scale(0.9)"type=mdi icon=pencil-outline title=重命名 @click.native="editing = true"></icon><icon v-if=editing type=mdi icon=check title=确定 @click.native=saveProfile()></icon></div>`;i.applyStyleFromText(`.profile-item{display:flex;align-items:center;padding:4px 8px;background-color:#8882;border-radius:4px;border:2px solid transparent;flex-shrink:0;cursor:pointer}.profile-item:not(:last-child){margin-right:8px}.profile-item.duplicate{border-color:red}.profile-item.selected:not(.duplicate){border-color:var(--theme-color)}.profile-item input[type=text]{width:5em;border:none!important;padding:0!important;margin:0!important;line-height:normal}`,"aria2-rpc-profile-item-style");return{export:Object.assign({template:t},{components:{Icon:()=>i.importAsync("icon.vue")},props:["profile","deletable","selected"],data(){return{name:this.profile.name,editing:false,duplicateName:false}},methods:{saveProfile(){if(this.name===this.profile.name){this.duplicateName=false;this.editing=false;return}if(this.name===""||e.aria2RpcOptionProfiles.some(e=>e.name===this.name)){this.duplicateName=true;return}else{this.duplicateName=false;if(e.aria2RpcOptionSelectedProfile===this.profile.name){e.aria2RpcOptionSelectedProfile=this.name}this.profile.name=this.name;this.editing=false;this.$emit("profile-update")}}}})}}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/aria2-rpc-profiles.vue.min.js"] = (()=>{return(e,i)=>{const r=`<div class=aria2-rpc-profiles><div class=profiles-header><h2>预设</h2><div class=profile-operations><div v-if="profiles.length > 1"class="operation delete-profile"@click=deleteProfile() title=删除预设><icon type=mdi icon=trash-can-outline></icon></div><div class="operation new-profile"@click=addProfile() title=新增预设><icon type=mdi icon=plus></icon></div></div></div><div class=profiles-list><profile-item v-for="(profile, index) of profiles":key="profile.name + index"@profile-update=profileUpdate() @click.native=changeProfile(profile) :profile=profile :deletable="profiles.length > 1":selected="profile.name === selectedProfile"></profile-item></div></div>`;i.applyStyleFromText(`.aria2-rpc-profiles .profiles-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.aria2-rpc-profiles .profiles-header .profile-operations{display:flex;align-items:center}.aria2-rpc-profiles .profiles-header .profile-operations .operation{padding:4px;background-color:#8882;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer}.aria2-rpc-profiles .profiles-header .profile-operations .operation:not(:last-child){margin-right:8px}.aria2-rpc-profiles .profiles-header .profile-operations .operation:hover{background-color:#8884}.aria2-rpc-profiles .profiles-header .profile-operations .operation .mdi{margin:0}.aria2-rpc-profiles .profiles-list{display:flex;overflow:auto;scrollbar-width:none!important}.aria2-rpc-profiles .profiles-list::-webkit-scrollbar{height:0!important}`,"aria2-rpc-profiles-style");const o={name:"未命名",...e.aria2RpcOption};return{export:Object.assign({template:r},{components:{ProfileItem:()=>i.importAsync("aria2-rpc-profile-item.vue"),Icon:()=>i.importAsync("icon.vue")},data(){this.migrateOldProfiles();const i=[...e.aria2RpcOptionProfiles];if(i.length===0){i.push(o);e.aria2RpcOptionProfiles=i}return{profiles:i,selectedProfile:e.aria2RpcOptionSelectedProfile||o.name}},watch:{selectedProfile(i){if(e.aria2RpcOptionSelectedProfile!==i){e.aria2RpcOptionSelectedProfile=i}}},methods:{migrateOldProfiles(){const i=Object.getOwnPropertyNames(e.aria2RpcOption).filter(e=>!e.startsWith("_"));i.push("name");let r=false;for(const o of e.aria2RpcOptionProfiles){i.filter(e=>!(e in o)).forEach(i=>{o[i]=e.aria2RpcOption[i];console.log(`migrated profile property '${i}'`);r=true})}if(r){e.aria2RpcOptionProfiles=e.aria2RpcOptionProfiles}},profileUpdate(){e.aria2RpcOptionProfiles=this.profiles;this.selectedProfile=e.aria2RpcOptionSelectedProfile},changeProfile(e){this.selectedProfile=e.name;this.$emit("profile-change",e)},addProfile(){const i={...this.profiles.find(e=>e.name===this.selectedProfile)};i.name=i.name.replace(/[\d]+$/,"");if(this.profiles.some(e=>e.name===i.name)){let e=1;while(this.profiles.some(r=>r.name===i.name+e.toString())){e++}i.name=i.name+e.toString()}this.profiles.push(i);e.aria2RpcOptionProfiles=this.profiles;this.changeProfile(i)},deleteProfile(){const i=this.profiles.findIndex(e=>e.name===this.selectedProfile);const r=i===0?0:i-1;const o=this.profiles[r];this.profiles.splice(i,1);e.aria2RpcOptionProfiles=this.profiles;this.changeProfile(o)}}})}}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/aria2-rpc.min.js"] = (()=>{return(t,e)=>{function o(){const e=t.aria2RpcOption;const o=e.host.match(/^http[s]?:\/\//)?e.host:"http://"+e.host;const r="aria2.addUri";return{option:e,host:o,methodName:r}}async function r(t,e=false){try{let o=await t();if(typeof o==="string"){o=JSON.parse(o)}if(o.error!==undefined){if(o.error.code===1){logError(`请求遭到拒绝, 请检查您的密钥相关设置.`)}else{logError(`请求发生错误, code = ${o.error.code}, message = ${o.error.message}`)}return false}if(!e){Toast.success(`成功发送了请求, GID = ${o.result}`,"aria2 RPC",5e3)}return true}catch(t){logError(`无法连接到RPC主机.`);return false}}async function s(t,e=false){const{option:s,host:n,methodName:a}=o();return await r(async()=>{const e=window.btoa(unescape(encodeURIComponent(JSON.stringify(t.params))));const o=`${n}:${s.port}/jsonrpc?method=${a}&id=${t.id}&params=${e}`;console.log(`RPC request:`,o);if(o.startsWith("http:")){return await new Promise((t,e)=>{GM_xmlhttpRequest({method:"GET",url:o,responseType:"json",onload:e=>t(e.response),onerror:t=>e(t)})})}else{return await Ajax.getJson(o)}},e)}async function n(t,e=false){const{option:s,host:n,methodName:a}=o();return await r(async()=>{const e=`${n}:${s.port}/jsonrpc`;const o={method:a,id:t.id,params:t.params};if(e.startsWith("http:")){return await new Promise((t,r)=>{GM_xmlhttpRequest({method:"POST",url:e,responseType:"json",data:JSON.stringify(o),onload:e=>t(e.response),onerror:t=>r(t)})})}else{return await Ajax.postJson(e,o)}},e)}async function a(e,o=false){const r=t.aria2RpcOption;for(const t of e){let e;if(r.method==="get"){e=await s(t,o)}else{e=await n(t,o)}if(o===true&&e===false){logError(`${decodeURIComponent(t.id)} 导出失败`)}}}return{export:{sendRpc:a}}}})();

View File

@ -1012,7 +1012,7 @@ onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/mi
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/about.min.html"] = `<div class=bilibili-evolved-about><div class=about-header><i class="mdi mdi-information-outline mdi-24px"></i><span class=about-title>关于</span></div><div class=about-content><p v-if=branch class="name light"v-html=logoImage></p><p v-if=branch class="name dark"v-html=logoImageDark></p><p class=version>v{{version}} · {{clientType}}</p><p class=love><a target=_blank href=https://github.com/the1812/Bilibili-Evolved/ >Made with ❤  </a><a target=_blank href=https://github.com/the1812/Bilibili-Evolved/blob/master/donate.md>Buy me a coffee ☕</a></p><section class=authors><span class=title>Authors</span><a class=author target=_blank v-for="author of authors"v-bind:href=author.link>{{author.name}}</a></section><section class=contributors><span class=title>Contributors</span><a class=contributor target=_blank v-for="contributor of contributors"v-bind:href=contributor.link>{{contributor.name}}</a></section><section class=supporters><a class=title target=_blank href=https://github.com/the1812/Bilibili-Evolved/blob/preview/donate.md#历史>View Supporters</a></section><section class=participants><span class=title>Community Power</span><span class=fetching v-if=fetching></span><a class=participant target=_blank v-for="participant of participants"v-bind:href=participant.link>{{participant.name}}</a></section><section class=websites><span class=title>Websites</span><a class=website target=_blank v-for="website of websites"v-bind:href=website.link>{{website.name}}</a></section><section class=components><span class=title>Components</span><a class=component target=_blank v-for="component of components"v-bind:href=component.link>{{component.name}}</a></section></div></div>`;
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/about.min.js"] = (()=>{return(t,e)=>{(async()=>{const i=await e.importAsync("aboutHtml");document.body.insertAdjacentHTML("beforeend",i);dq(".bilibili-evolved-about").addEventListener("be:about-load",()=>{const e=(t,e)=>t.charCodeAt(0)-e.charCodeAt(0);const i=(t,i)=>e(t.name,i.name);const o=GM_info.script.name.match(/Bilibili Evolved \((.*)\)/);const n=o?o[1]:"Stable";new Vue({el:".bilibili-evolved-about",data:{version:t.currentVersion,clientType:n,logoImage:null,logoImageDark:null,branch:null,authors:[{name:"Grant Howard",link:"https://github.com/the1812"},{name:"Coulomb-G",link:"https://github.com/Coulomb-G"}],contributors:[{name:"PleiadeSubaru",link:"https://github.com/Etherrrr"}].sort(i),fetching:true,participants:[],websites:[{name:"GitHub",link:"https://github.com/the1812/Bilibili-Evolved/"},{name:"Greasy Fork",link:"https://greasyfork.org/zh-CN/scripts/373563-bilibili-evolved"}],components:[{name:"Vue.js",link:"https://cn.vuejs.org/index.html"},{name:"JSZip",link:"https://stuk.github.io/jszip/"},{name:"jQuery",link:"http://jquery.com/"},{name:"debounce",link:"https://github.com/component/debounce/"},{name:"Slip.js",link:"https://github.com/kornelski/slip"},{name:"MDI",link:"https://materialdesignicons.com"},{name:"Lodash",link:"https://lodash.com/"}]},mounted(){dq(".bilibili-evolved-about").addEventListener("be:about-load-community",()=>{this.init()},{once:true})},methods:{async getLogos(){this.logoImage=await Ajax.getText(`https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/images/bilibili-evolved-wide.svg`);this.logoImageDark=await Ajax.getText(`https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/images/bilibili-evolved-wide-dark.svg`)},async init(){this.branch=/Preview|Local/.test(n)?"preview":"master";this.getLogos();const t=new Set;let e=[];let o=1;do{e=await Ajax.getJson(`https://api.github.com/repos/the1812/Bilibili-Evolved/issues?state=all&direction=asc&per_page=100&page=${o}`).catch(()=>{e=[{name:"电波无法到达(´・_・`)",link:null}]});o++;for(const i of e){t.add(i.user.login)}}while(e.length>0);this.participants=[...t].map(t=>{return{name:t,link:`https://github.com/${t}`}}).filter(({link:t})=>{return!this.authors.some(e=>e.link===t)&&!this.contributors.some(e=>e.link===t)}).sort(i);this.fetching=false}}})},{once:true})})()}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-apis.min.js"] = (()=>{return(t,e)=>{class s extends EventTarget{constructor(){super(...arguments);this.cards=[]}addCard(t){if(t instanceof Element&&t.classList.contains("card")){if(t.querySelector(".skeleton")!==null){const e=Observer.childList(t,()=>{if(t.querySelector(".skeleton")===null){e.forEach(t=>t.stop());this.addCard(t)}})}else{const e=this.parseCard(t);this.cards.push(e);const s=new CustomEvent("addCard",{detail:e});this.dispatchEvent(s)}}}removeCard(t){if(t instanceof Element&&t.classList.contains("card")){const e=this.parseCard(t).id;const s=this.cards.findIndex(t=>t.id===e);const r=this.cards[s];this.cards.splice(s,1);const n=new CustomEvent("removeCard",{detail:r});this.dispatchEvent(n)}}parseCard(t){const e=e=>{if(t.querySelector(e)===null){return""}return t.querySelector(e).innerText};const s=t=>{const s=parseInt(e(t));if(isNaN(s)){return 0}return s};const r={id:t.getAttribute("data-did"),username:e(".main-content .user-name"),text:e(".card-content .text.description"),reposts:s(".button-bar .single-button:nth-child(1) .text-offset"),comments:s(".button-bar .single-button:nth-child(2) .text-offset"),likes:s(".button-bar .single-button:nth-child(3) .text-offset")};return r}async startWatching(){const t=await SpinQuery.select(".card-list .content");if(!t){return false}const e=[...t.querySelectorAll(".content>.card")];e.forEach(t=>this.addCard(t));Observer.childList(t,t=>{t.forEach(t=>{t.addedNodes.forEach(t=>this.addCard(t));t.removedNodes.forEach(t=>this.removeCard(t))})});return true}}const r=new s;return{export:{activityCardsManager:r}}}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-image-saver.min.js"] = (()=>{return(e,o)=>{(async()=>{if(document.domain!=="t.bilibili.com"){return}const e=e=>{const o=e.querySelector(".image-viewer");if(o===null){console.log(e)}else{o.addEventListener("contextmenu",()=>{Toast.success(`<img src="${o.src}" width="200">`,"解除动态存图限制")})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,o=>{o.forEach(o=>{const t=[...o.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));t.forEach(e)})})})()}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/activity-image-saver.min.js"] = (()=>{return(e,t)=>{(async()=>{if(document.domain!=="t.bilibili.com"&&document.domain!=="space.bilibili.com"){return}const e=e=>{const t=e.querySelector(".image-viewer");if(t===null){console.log(e)}else{t.addEventListener("contextmenu",()=>{setTimeout(()=>{const e=dq(".pop-message .toast-text");if(e&&e.innerHTML.includes("作者设置了禁止保存")){Toast.success(`<img src="${t.src}" width="200">`,"解除动态存图限制")}},200)})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,t=>{t.forEach(t=>{const o=[...t.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));o.forEach(e)})})})()}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc-profile-item.vue.min.js"] = (()=>{return(e,i)=>{const t=`<div class=profile-item :class="{duplicate: duplicateName, selected}"><template v-if=!editing>{{profile.name}}</template><template v-else><input type=text v-model=name></template><icon v-if=!editing style="transform: scale(0.9)"type=mdi icon=pencil-outline title=重命名 @click.native="editing = true"></icon><icon v-if=editing type=mdi icon=check title=确定 @click.native=saveProfile()></icon></div>`;i.applyStyleFromText(`.profile-item{display:flex;align-items:center;padding:4px 8px;background-color:#8882;border-radius:4px;border:2px solid transparent;flex-shrink:0;cursor:pointer}.profile-item:not(:last-child){margin-right:8px}.profile-item.duplicate{border-color:red}.profile-item.selected:not(.duplicate){border-color:var(--theme-color)}.profile-item input[type=text]{width:5em;border:none!important;padding:0!important;margin:0!important;line-height:normal}`,"aria2-rpc-profile-item-style");return{export:Object.assign({template:t},{components:{Icon:()=>i.importAsync("icon.vue")},props:["profile","deletable","selected"],data(){return{name:this.profile.name,editing:false,duplicateName:false}},methods:{saveProfile(){if(this.name===this.profile.name){this.duplicateName=false;this.editing=false;return}if(this.name===""||e.aria2RpcOptionProfiles.some(e=>e.name===this.name)){this.duplicateName=true;return}else{this.duplicateName=false;if(e.aria2RpcOptionSelectedProfile===this.profile.name){e.aria2RpcOptionSelectedProfile=this.name}this.profile.name=this.name;this.editing=false;this.$emit("profile-update")}}}})}}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc-profiles.vue.min.js"] = (()=>{return(e,i)=>{const r=`<div class=aria2-rpc-profiles><div class=profiles-header><h2>预设</h2><div class=profile-operations><div v-if="profiles.length > 1"class="operation delete-profile"@click=deleteProfile() title=删除预设><icon type=mdi icon=trash-can-outline></icon></div><div class="operation new-profile"@click=addProfile() title=新增预设><icon type=mdi icon=plus></icon></div></div></div><div class=profiles-list><profile-item v-for="(profile, index) of profiles":key="profile.name + index"@profile-update=profileUpdate() @click.native=changeProfile(profile) :profile=profile :deletable="profiles.length > 1":selected="profile.name === selectedProfile"></profile-item></div></div>`;i.applyStyleFromText(`.aria2-rpc-profiles .profiles-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.aria2-rpc-profiles .profiles-header .profile-operations{display:flex;align-items:center}.aria2-rpc-profiles .profiles-header .profile-operations .operation{padding:4px;background-color:#8882;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer}.aria2-rpc-profiles .profiles-header .profile-operations .operation:not(:last-child){margin-right:8px}.aria2-rpc-profiles .profiles-header .profile-operations .operation:hover{background-color:#8884}.aria2-rpc-profiles .profiles-header .profile-operations .operation .mdi{margin:0}.aria2-rpc-profiles .profiles-list{display:flex;overflow:auto;scrollbar-width:none!important}.aria2-rpc-profiles .profiles-list::-webkit-scrollbar{height:0!important}`,"aria2-rpc-profiles-style");const o={name:"未命名",...e.aria2RpcOption};return{export:Object.assign({template:r},{components:{ProfileItem:()=>i.importAsync("aria2-rpc-profile-item.vue"),Icon:()=>i.importAsync("icon.vue")},data(){this.migrateOldProfiles();const i=[...e.aria2RpcOptionProfiles];if(i.length===0){i.push(o);e.aria2RpcOptionProfiles=i}return{profiles:i,selectedProfile:e.aria2RpcOptionSelectedProfile||o.name}},watch:{selectedProfile(i){if(e.aria2RpcOptionSelectedProfile!==i){e.aria2RpcOptionSelectedProfile=i}}},methods:{migrateOldProfiles(){const i=Object.getOwnPropertyNames(e.aria2RpcOption).filter(e=>!e.startsWith("_"));i.push("name");let r=false;for(const o of e.aria2RpcOptionProfiles){i.filter(e=>!(e in o)).forEach(i=>{o[i]=e.aria2RpcOption[i];console.log(`migrated profile property '${i}'`);r=true})}if(r){e.aria2RpcOptionProfiles=e.aria2RpcOptionProfiles}},profileUpdate(){e.aria2RpcOptionProfiles=this.profiles;this.selectedProfile=e.aria2RpcOptionSelectedProfile},changeProfile(e){this.selectedProfile=e.name;this.$emit("profile-change",e)},addProfile(){const i={...this.profiles.find(e=>e.name===this.selectedProfile)};i.name=i.name.replace(/[\d]+$/,"");if(this.profiles.some(e=>e.name===i.name)){let e=1;while(this.profiles.some(r=>r.name===i.name+e.toString())){e++}i.name=i.name+e.toString()}this.profiles.push(i);e.aria2RpcOptionProfiles=this.profiles;this.changeProfile(i)},deleteProfile(){const i=this.profiles.findIndex(e=>e.name===this.selectedProfile);const r=i===0?0:i-1;const o=this.profiles[r];this.profiles.splice(i,1);e.aria2RpcOptionProfiles=this.profiles;this.changeProfile(o)}}})}}})();
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/aria2-rpc.min.js"] = (()=>{return(t,e)=>{function o(){const e=t.aria2RpcOption;const o=e.host.match(/^http[s]?:\/\//)?e.host:"http://"+e.host;const r="aria2.addUri";return{option:e,host:o,methodName:r}}async function r(t,e=false){try{let o=await t();if(typeof o==="string"){o=JSON.parse(o)}if(o.error!==undefined){if(o.error.code===1){logError(`请求遭到拒绝, 请检查您的密钥相关设置.`)}else{logError(`请求发生错误, code = ${o.error.code}, message = ${o.error.message}`)}return false}if(!e){Toast.success(`成功发送了请求, GID = ${o.result}`,"aria2 RPC",5e3)}return true}catch(t){logError(`无法连接到RPC主机.`);return false}}async function s(t,e=false){const{option:s,host:n,methodName:a}=o();return await r(async()=>{const e=window.btoa(unescape(encodeURIComponent(JSON.stringify(t.params))));const o=`${n}:${s.port}/jsonrpc?method=${a}&id=${t.id}&params=${e}`;console.log(`RPC request:`,o);if(o.startsWith("http:")){return await new Promise((t,e)=>{GM_xmlhttpRequest({method:"GET",url:o,responseType:"json",onload:e=>t(e.response),onerror:t=>e(t)})})}else{return await Ajax.getJson(o)}},e)}async function n(t,e=false){const{option:s,host:n,methodName:a}=o();return await r(async()=>{const e=`${n}:${s.port}/jsonrpc`;const o={method:a,id:t.id,params:t.params};if(e.startsWith("http:")){return await new Promise((t,r)=>{GM_xmlhttpRequest({method:"POST",url:e,responseType:"json",data:JSON.stringify(o),onload:e=>t(e.response),onerror:t=>r(t)})})}else{return await Ajax.postJson(e,o)}},e)}async function a(e,o=false){const r=t.aria2RpcOption;for(const t of e){let e;if(r.method==="get"){e=await s(t,o)}else{e=await n(t,o)}if(o===true&&e===false){logError(`${decodeURIComponent(t.id)} 导出失败`)}}}return{export:{sendRpc:a}}}})();

View File

@ -1 +1 @@
(()=>{return(e,o)=>{(async()=>{if(document.domain!=="t.bilibili.com"){return}const e=e=>{const o=e.querySelector(".image-viewer");if(o===null){console.log(e)}else{o.addEventListener("contextmenu",()=>{Toast.success(`<img src="${o.src}" width="200">`,"解除动态存图限制")})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,o=>{o.forEach(o=>{const t=[...o.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));t.forEach(e)})})})()}})();
(()=>{return(e,t)=>{(async()=>{if(document.domain!=="t.bilibili.com"&&document.domain!=="space.bilibili.com"){return}const e=e=>{const t=e.querySelector(".image-viewer");if(t===null){console.log(e)}else{t.addEventListener("contextmenu",()=>{setTimeout(()=>{const e=dq(".pop-message .toast-text");if(e&&e.innerHTML.includes("作者设置了禁止保存")){Toast.success(`<img src="${t.src}" width="200">`,"解除动态存图限制")}},200)})}};[...document.body.children].filter(e=>e.classList.contains("photo-imager-container")).forEach(e);Observer.childList(document.body,t=>{t.forEach(t=>{const o=[...t.addedNodes].filter(e=>e instanceof Element&&e.classList.contains("photo-imager-container"));o.forEach(e)})})})()}})();

View File

@ -3,7 +3,7 @@
"about.min.html": "E44CC2091973A839E5A533B397EF8C78DD573DAB9AF0C4D19E63748DCB9450DB",
"about.min.js": "112689A1206CFA88EFA9AB144D6F0806E8D66C198B39EBC939F9721F9DB99391",
"activity-apis.min.js": "459D26DB0BB447FEFE6F1842541A119E67C63573A800E56AD7FEC71D20087CEF",
"activity-image-saver.min.js": "EE0CF060D747C3D4AD8ACAA9BE9AACD2E04B8BB54A738B456C5CFF6325CC7247",
"activity-image-saver.min.js": "92C4CF9A70836EA93FA6C7188F89ABF567C04E24656CD64C59FA254F167AD71C",
"aria2-rpc-profile-item.vue.min.js": "806B769E75FF3E0B29C5A618812CA1BC4D6D285798582E297E609A4F398F8DAB",
"aria2-rpc-profiles.vue.min.js": "CBF3D159566A694BC543EAB5B9E743A13B571743EBDDB8C558AE036483E3AF5A",
"aria2-rpc.min.js": "B13E731DDD503A645A19BB243FF0148BEAC313F0A54454752A07387176F04046",

Binary file not shown.

View File

@ -1,5 +1,5 @@
(async () => {
if (document.domain !== 't.bilibili.com') {
if (document.domain !== 't.bilibili.com' && document.domain !== 'space.bilibili.com') {
return
}
const unlock = (container: Element) => {
@ -8,7 +8,12 @@
console.log(container)
} else {
image.addEventListener('contextmenu', () => {
Toast.success(/*html*/`<img src="${image.src}" width="200">`, '解除动态存图限制')
setTimeout(() => {
const popupMessage = dq('.pop-message .toast-text')
if (popupMessage && popupMessage.innerHTML.includes('作者设置了禁止保存')) {
Toast.success(/*html*/`<img src="${image.src}" width="200">`, '解除动态存图限制')
}
}, 200)
})
}
}