MediaWiki:Gadget-mwPanel.js
跳到导航
跳到搜索
注意:这类代码页面在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- 按住
CTRL+SHIFT+DEL 或 ⌘-Shift-R来清除缓存! - 或尝试在地址栏的地址最后添加代码
?_=1来访问最新页面。 - 你还可以在设置中勾选小工具在页面右上角添加清除缓存按钮!
// <pre>
$(function() {
var items = {
"#t-upload": {
"t-expandtemplates": '<li id="t-expandtemplates"><a href="' + mw.config.get("wgServer") + mw.config.get("wgScriptPath") + '/index.php?title=Special:%E5%B1%95%E5%BC%80%E6%A8%A1%E6%9D%BF&wpRemoveComments=1&wpInput={{' + mw.config.get("wgPageName") + '}}">展开模板</a></li>',
"t-Prefixindex": '<li id="t-Prefixindex"><a href="' + mw.config.get("wgServer") + mw.config.get("wgScriptPath") + '/index.php?title=Special%3A前缀索引&prefix=' + mw.config.get("wgTitle") + '&namespace=' + mw.config.get("wgNamespaceNumber") + '">查看子页面</a></li>',
"t-pagelog": '<li id="t-pagelog"><a href="' + mw.config.get("wgServer") + mw.config.get("wgScriptPath") + '/index.php?title=Special:%E6%97%A5%E5%BF%97&page=' + mw.config.get("wgPageName") + '">页面日志</a></li>',
"t-replacetext": '<li id="t-replacetext" class="sysop-show"><a href="/Special:替换文本">替换文本</a></li>'
}
};
for (var t in items) {
var target = $(t);
for (var i in items[t]) {
if (!document.getElementById(i)) {
target.after(items[t][i]);
}
}
}
mw.loader.addStyleTag("#t-expandtemplates, #t-userlog, .ns-2 #t-pagelog, .ns-3 #t-pagelog, .ns--1 #t-pagelog {display:none;}.ns-10 #t-expandtemplates, .ns-2 #t-userlog, .ns-3 #t-userlog {display:list-item!important;}");
$('#t-log a').text("用户日志");
});
// </pre>