mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Merge branch 'preview' into preview
This commit is contained in:
commit
cf8206d5a6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1978,6 +1978,8 @@ class ResourceManager
|
||||
|
||||
try
|
||||
{
|
||||
Vue.config.productionTip = false;
|
||||
Vue.config.devtools = false;
|
||||
setupAjaxHook();
|
||||
const events = {};
|
||||
for (const name of ["init", "styleLoaded", "scriptLoaded"])
|
||||
|
||||
@ -1978,6 +1978,8 @@ class ResourceManager
|
||||
|
||||
try
|
||||
{
|
||||
Vue.config.productionTip = false;
|
||||
Vue.config.devtools = false;
|
||||
setupAjaxHook();
|
||||
const events = {};
|
||||
for (const name of ["init", "styleLoaded", "scriptLoaded"])
|
||||
|
||||
@ -41,6 +41,8 @@ import { ResourceManager } from './resource-manager';
|
||||
|
||||
try
|
||||
{
|
||||
Vue.config.productionTip = false;
|
||||
Vue.config.devtools = false;
|
||||
setupAjaxHook();
|
||||
const events = {};
|
||||
for (const name of ["init", "styleLoaded", "scriptLoaded"])
|
||||
|
||||
2
min/dark.min.css
vendored
2
min/dark.min.css
vendored
File diff suppressed because one or more lines are too long
2
min/i18n.ja-JP.min.js
vendored
2
min/i18n.ja-JP.min.js
vendored
File diff suppressed because one or more lines are too long
2
min/i18n.min.css
vendored
2
min/i18n.min.css
vendored
@ -1 +1 @@
|
||||
.up-info .up-focus-btn{width:auto!important;padding:0 4px!important}.primary-menu .nav-menu .nav-name{white-space:pre!important}.dynamic-m .dyn_menu .line{display:none!important}.tag-panel .more-button{width:44px!important}.link-navbar .main-ctnr .nav-logo{width:70px!important}
|
||||
.textarea-container .comm-tool .comm-emoji,.textarea-container .comm-tool .comm-submit,.up-info .up-focus-btn{width:auto!important;padding:0 4px!important}.bb-comment .comment-send .comment-emoji{width:max-content!important;padding:0 4px!important}.primary-menu .nav-menu .nav-name{white-space:pre!important}.dynamic-m .dyn_menu .line{display:none!important}.tag-panel .more-button{width:44px!important}.link-navbar .main-ctnr .nav-logo{width:70px!important}.bili-header-m .profile-m .grade .bar{width:160px!important}.link-navbar .main-ctnr{width:90%!important}.n .n-data{width:auto!important;padding:10px 8px!important}.user-panel-ctnr .user-panel .content-ctnr .ctrl-btn:nth-child(2n){padding-left:8px!important}
|
||||
2
min/i18n.min.js
vendored
2
min/i18n.min.js
vendored
@ -1 +1 @@
|
||||
(()=>{return(e,t)=>{const a={"日本語":"ja-JP",English:"en-US",Deutsch:"de-DE"};class s{accepts(e){return e.nodeType===Node.ELEMENT_NODE}getValue(e){return e.nodeValue}setValue(e,t){e.nodeValue=t}getElement(e){return e}translate(e){const t=this.getValue(e);if(!t||typeof t!=="string"||t==="*"){return}const a=s.map.get(t.trim());if(a===undefined){return}if(typeof a==="string"){this.setValue(e,a)}else if(Array.isArray(a)){let t=null;for(const s of a){if(typeof s==="string"){t=s}else{const{text:a,selector:r,not:n}=s;if(this.getElement(e).matches(r)!==Boolean(n)){t=a}}}if(t!==null){this.setValue(e,t)}}else{const{text:t,selector:s,not:r}=a;if(this.getElement(e).matches(s)!==Boolean(r)){this.setValue(e,t)}}}static walk(e,t){const a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,false);let s=a.nextNode();while(s){t(s);s=a.nextNode()}}static translate(e){if(e.nodeType===Node.TEXT_NODE){s.textNode.translate(e);return}s.walk(e,e=>{for(const t of s.allTranslators){if(t.accepts(e)){t.translate(e)}}})}static translateCssMatches(){const e=s.map.get("*");if(!e){return}for(const{selector:t,text:a}of e){const e=document.querySelector(t);if(e){[...e.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).forEach(e=>e.nodeValue=a)}}}}class r extends s{accepts(e){return e.nodeType===Node.TEXT_NODE}getElement(e){return e.parentElement}}class n extends s{getValue(e){return e.getAttribute("title")}setValue(e,t){e.setAttribute("title",t)}}class l extends s{accepts(e){return e.nodeName==="INPUT"&&e.type.toUpperCase()==="TEXT"||e.nodeName==="TEXTAREA"}getValue(e){return e.getAttribute("placeholder")}setValue(e,t){e.setAttribute("placeholder",t)}}s.textNode=new r;s.title=new n;s.placeholder=new l;s.allTranslators=[s.textNode,s.title,s.placeholder];(async()=>{const{map:r}=await t.importAsync(`i18n.${a[e.i18nLanguage]}`);s.map=r;s.translate(document.body);s.translateCssMatches();Observer.childListSubtree("body",e=>{e.forEach(e=>{if(e.addedNodes.length>0){s.translateCssMatches()}e.addedNodes.forEach(e=>{s.translate(e)})})})})();return{export:{Translator:s,TextNodeTranslator:r,TitleTranslator:n,PlaceholderTranslator:l}}}})();
|
||||
(()=>{return(e,t)=>{const s={"日本語":"ja-JP",English:"en-US",Deutsch:"de-DE"};class a{accepts(e){return e.nodeType===Node.ELEMENT_NODE}getValue(e){return e.nodeValue}setValue(e,t){e.nodeValue=t}getElement(e){return e}translate(e){const t=this.getValue(e);if(!t||typeof t!=="string"||t==="*"){return}const s=a.map.get(t.trim());if(s===undefined){return}if(typeof s==="string"){this.setValue(e,s)}else if(Array.isArray(s)){let t=null;for(const a of s){if(typeof a==="string"){t=a}else{const{text:s,selector:r,not:l}=a;if(this.getElement(e).matches(r)!==Boolean(l)){t=s}}}if(t!==null){this.setValue(e,t)}}else{const{text:t,selector:a,not:r}=s;if(this.getElement(e).matches(a)!==Boolean(r)){this.setValue(e,t)}}}static walk(e,t){const s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,false);let a=s.nextNode();while(a){t(a);a=s.nextNode()}}static translate(e){if(e.nodeType===Node.TEXT_NODE){a.textNode.translate(e);return}a.walk(e,e=>{for(const t of a.allTranslators){if(t.accepts(e)){t.translate(e)}}})}static translateCssMatches(){const e=a.map.get("*");if(!e){return}for(const{selector:t,text:s}of e){const e=document.querySelector(t);if(e){[...e.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).forEach(e=>e.nodeValue=s)}}}}class r extends a{accepts(e){return e.nodeType===Node.TEXT_NODE}getElement(e){return e.parentElement}}class l extends a{getValue(e){return e.getAttribute("title")}setValue(e,t){e.setAttribute("title",t)}}class n extends a{getValue(e){return e.getAttribute("placeholder")}setValue(e,t){e.setAttribute("placeholder",t)}}a.textNode=new r;a.title=new l;a.placeholder=new n;a.allTranslators=[a.textNode,a.title,a.placeholder];(async()=>{const{map:r}=await t.importAsync(`i18n.${s[e.i18nLanguage]}`);a.map=r;a.translate(document.body);a.translateCssMatches();Observer.childListSubtree("body",e=>{e.forEach(e=>{if(e.addedNodes.length>0){a.translateCssMatches()}e.addedNodes.forEach(e=>{a.translate(e)})})})})();return{export:{Translator:a,TextNodeTranslator:r,TitleTranslator:l,PlaceholderTranslator:n}}}})();
|
||||
@ -37,7 +37,7 @@
|
||||
background-image: none !important;
|
||||
} */
|
||||
.rank-cntr .rank-list-ctnr .tip a,
|
||||
.live-skin-coloration-area.p-relative.rank-list-section.z-rank-list .rank-list-ctnr,
|
||||
.p-relative.rank-list-section.z-rank-list .rank-list-ctnr,
|
||||
.live-skin-coloration-area.p-relative.rank-list-section.z-rank-list .rank-list-ctnr .more,
|
||||
.live-skin-coloration-area.p-relative.rank-list-section.z-rank-list .rank-list-ctnr a:hover,
|
||||
.list-container .list-info-block .right-side .col .split-line,
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
.up-info .up-focus-btn
|
||||
.up-info .up-focus-btn,
|
||||
.textarea-container .comm-tool .comm-emoji,
|
||||
.textarea-container .comm-tool .comm-submit
|
||||
{
|
||||
width: auto !important;
|
||||
padding: 0 4px !important;
|
||||
}
|
||||
.bb-comment .comment-send .comment-emoji
|
||||
{
|
||||
width: max-content !important;
|
||||
padding: 0 4px !important;
|
||||
}
|
||||
.primary-menu .nav-menu .nav-name
|
||||
{
|
||||
white-space: pre !important;
|
||||
@ -18,4 +25,21 @@
|
||||
.link-navbar .main-ctnr .nav-logo
|
||||
{
|
||||
width: 70px !important;
|
||||
}
|
||||
.bili-header-m .profile-m .grade .bar
|
||||
{
|
||||
width: 160px !important;
|
||||
}
|
||||
.link-navbar .main-ctnr
|
||||
{
|
||||
width: 90% !important;
|
||||
}
|
||||
.n .n-data
|
||||
{
|
||||
width: auto !important;
|
||||
padding: 10px 8px !important;
|
||||
}
|
||||
.user-panel-ctnr .user-panel .content-ctnr .ctrl-btn:nth-child(2n)
|
||||
{
|
||||
padding-left: 8px !important;
|
||||
}
|
||||
@ -76,8 +76,8 @@ export const map = new Map([
|
||||
[`绘画`,`絵画`],
|
||||
[`热门话题`,`人気話題`],
|
||||
[`热门排行`,`人気ランキング`],
|
||||
[`我关注的话题`,`私のタグ`],
|
||||
[`有新动态,点击查看`,`新しい情報がある、クリックして見る`],
|
||||
[`我关注的话题`,`私の話題`],
|
||||
[`有新动态,点击查看`,`新しい情報がある、クリックして見る`],
|
||||
[`刚刚`,`さっき`],
|
||||
[`转发动态`,`転送した`],
|
||||
[`转发`,`転送`],
|
||||
@ -120,6 +120,7 @@ export const map = new Map([
|
||||
[`话题`,`話題`],
|
||||
[`活动`,`活動`],
|
||||
[`活动`,`活動中心`],
|
||||
[`有什么想和大家分享的?`,`何をみんなと共有したいのですか`],
|
||||
[`动画`, {
|
||||
selector: `.elevator-module .nav-list .item`,
|
||||
not: true,
|
||||
|
||||
@ -92,7 +92,7 @@ export class TitleTranslator extends Translator {
|
||||
}
|
||||
}
|
||||
export class PlaceholderTranslator extends Translator {
|
||||
accepts(node) { return node.nodeName === "INPUT" && node.type.toUpperCase() === "TEXT" || node.nodeName === "TEXTAREA"; }
|
||||
// accepts(node: Node) { return node.nodeName === "INPUT" && (node as HTMLInputElement).type.toUpperCase() === "TEXT" || node.nodeName === "TEXTAREA"; }
|
||||
getValue(node) { return node.getAttribute("placeholder"); }
|
||||
setValue(node, value) {
|
||||
node.setAttribute("placeholder", value);
|
||||
|
||||
@ -127,7 +127,7 @@ export class TitleTranslator extends Translator
|
||||
}
|
||||
export class PlaceholderTranslator extends Translator
|
||||
{
|
||||
accepts(node: Node) { return node.nodeName === "INPUT" && (node as HTMLInputElement).type.toUpperCase() === "TEXT" || node.nodeName === "TEXTAREA"; }
|
||||
// accepts(node: Node) { return node.nodeName === "INPUT" && (node as HTMLInputElement).type.toUpperCase() === "TEXT" || node.nodeName === "TEXTAREA"; }
|
||||
getValue(node: Node) { return (node as Element).getAttribute("placeholder"); }
|
||||
setValue(node: Node, value: string)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user