注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:按 Ctrl-F5。
/**
* 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'
});
})();