MCBBS Wiki欢迎您共同参与编辑!在参与编辑之前请先阅读Wiki方针

如果在编辑的过程中遇到了什么问题,可以去讨论板提问。

为了您能够无阻碍地参与编辑 未验证/绑定过邮箱的用户,请尽快绑定/验证

MCBBS Wiki GitHub群组已上线!

您可以在回声洞中发表吐槽!

服务器状态监控。点击进入

本站由MCBBS用户自行搭建,与MCBBS及东银河系漫游指南(北京)科技有限公司没有从属关系。点此了解 MCBBS Wiki 不是什么>>

MediaWiki:Gadget-VectorThemeLoader.js:修订间差异

跳到导航 跳到搜索
(新的主题切换功能)
 
(区分新旧版vector皮肤)
//! https://github.com/mcbbs-wiki/mcbbs-wiki-widget-repo/tree/master/widget/VectorThemeLoader
addStyle(widget_t_default);
var isLegacy = document.body.classList.contains("skin-vector-legacy");
var themeMap = isLegacy ? {
book: {
name: "仿MCBBS书页风格",
common: "MediaWiki:Vector-Legacy-Book.css",
default: {
name: "夏季主题",
nether: { name: "下界主题", css: "MediaWiki:Vector-Book-Nether.css" },
winter: { name: "冬季主题", css: "MediaWiki:Vector-Book-Winter.css" }
},
legacy: {
name: "",
common: "MediaWiki:Vector-Legacy-Book.css",
default: { name: "夏季主题", css: "MediaWiki:Vector-Book-Summer.css" },
other: {
nether: { name: "下界主题", css: "MediaWiki:Vector-Book-Nether.css" },
winter: { name: "冬季主题", css: "MediaWiki:Vector-Book-Winter.css" }
}
}
},
} : {
otherv4: {
name: "仿MCBBS v4风格",
common: "MediaWiki:Vector-Legacy-BookV4.css",
default: { name: "夏季主题默认风格", css: "MediaWiki:Vector-Book-SummerV4.css" },
legacyother: {}
}
};
var defaultStyle = Object.keys(themeMap)[0];
var isLegacy = document.body.classList.contains("skin-vector-legacy");
var styleKey = isLegacy ? "mcbbs-wiki-skin-vector-legacy-style" : "mcbbs-wiki-skin-vector-style";
var themeKey = isLegacy ? "mcbbs-wiki-skin-vector-legacy-theme" : "mcbbs-wiki-skin-vector-theme";
var loadThemeStyle = (style, theme) => {
const _styleMapstyleMap = themeMap[style] || themeMap[defaultStyle];
const styleMap = isLegacy ? _styleMap.legacy || _styleMap : _styleMap;
const currentCommonStyle = styleMap.common;
loadWikiStyle(currentCommonStyle, "salt-wiki-style-common");
};
var initTheme = () => {
const current = { style: "book"defaultStyle, theme: "default" };
const [style] = readAndListen({
key: styleKey,
defaultValue: "book"defaultStyle,
listener: (ev) => {
if (ev.newValue) {