Aurora Lemon(讨论 | 贡献) 小无编辑摘要 |
Aurora Lemon(讨论 | 贡献) 无编辑摘要 |
||
第1行: | 第1行: | ||
const pageScripts | /** | ||
* HydCraft Wiki MediaWiki Common JavaScript | |||
* @description If you are interested in us, feel free to add us as a friend and chat with us~ | |||
* @description 如果您对我们有兴趣,欢迎和我们加个好友聊聊天喵~ | |||
*/ | |||
(function() { | |||
/** | |||
* 为特定元素添加 translate 属性 | |||
* | |||
* @param {void} | |||
*/ | |||
} | function addTranslateAttribute() { | ||
$(".mw-logo-wordmark, .footer-belong__hydrlab").attr("translate", "no"); | |||
} | |||
/** | |||
* 加载页面对应的脚本 | |||
* | |||
* @param {Object} pageScripts - 包含页面名称和对应脚本路径的映射对象 | |||
*/ | |||
function loadPageScript(pageScripts) { | |||
const currentPageName = mw.config.get('wgPageName'); | |||
const scriptToImport = pageScripts[currentPageName]; | |||
if (scriptToImport) | |||
importScript(scriptToImport); | |||
} | |||
addTranslateAttribute(); | |||
loadPageScript({ | |||
'首页': 'MediaWiki:Mainpage.js', | |||
'首页副本': 'MediaWiki:Mainpage.js', | |||
'玩家列表': 'MediaWiki:Playerlist.js', | |||
'HydCraft_Wiki:仪表盘': 'MediaWiki:LoadDH.js', | |||
'HydCraft_Wiki:玩家档案': 'MediaWiki:LoadDH.js', | |||
'HydCraft_Wiki:统计': 'MediaWiki:LoadDH.js', | |||
'HydCraft_Wiki:信息申报': 'MediaWiki:LoadDH.js', | |||
'HydCraft_Wiki:查询': 'MediaWiki:LoadDH.js', | |||
'HydCraft_Wiki:组织关系': 'MediaWiki:LoadDH.js', | |||
'Topic:一码通恒': 'MediaWiki:LoadYHECode.js' | |||
}); | |||
})(); |
2024年3月17日 (日) 21:22的版本
/**
* HydCraft Wiki MediaWiki Common JavaScript
* @description If you are interested in us, feel free to add us as a friend and chat with us~
* @description 如果您对我们有兴趣,欢迎和我们加个好友聊聊天喵~
*/
(function() {
/**
* 为特定元素添加 translate 属性
*
* @param {void}
*/
function addTranslateAttribute() {
$(".mw-logo-wordmark, .footer-belong__hydrlab").attr("translate", "no");
}
/**
* 加载页面对应的脚本
*
* @param {Object} pageScripts - 包含页面名称和对应脚本路径的映射对象
*/
function loadPageScript(pageScripts) {
const currentPageName = mw.config.get('wgPageName');
const scriptToImport = pageScripts[currentPageName];
if (scriptToImport)
importScript(scriptToImport);
}
addTranslateAttribute();
loadPageScript({
'首页': 'MediaWiki:Mainpage.js',
'首页副本': 'MediaWiki:Mainpage.js',
'玩家列表': 'MediaWiki:Playerlist.js',
'HydCraft_Wiki:仪表盘': 'MediaWiki:LoadDH.js',
'HydCraft_Wiki:玩家档案': 'MediaWiki:LoadDH.js',
'HydCraft_Wiki:统计': 'MediaWiki:LoadDH.js',
'HydCraft_Wiki:信息申报': 'MediaWiki:LoadDH.js',
'HydCraft_Wiki:查询': 'MediaWiki:LoadDH.js',
'HydCraft_Wiki:组织关系': 'MediaWiki:LoadDH.js',
'Topic:一码通恒': 'MediaWiki:LoadYHECode.js'
});
})();