-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmwpanel.js
More file actions
28 lines (28 loc) · 1.58 KB
/
mwpanel.js
File metadata and controls
28 lines (28 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//fork from https://github.com/MoegirlPediaInterfaceAdmins/MoegirlPediaInterfaceCodes/blob/master/src/gadgets/mwPanel/Gadget-mwPanel.js
//only use vector-2022
// <pre>
"use strict";
$(() => {
const wgPageName = mw.config.get("wgRelevantPageName");
const items = {
"#t-upload": {
"t-expandtemplates": `<li id="t-expandtemplates" class="mw-list-item"><a href="/Special:展开模板?wpRemoveComments=1&wpInput={{${wgPageName}}}">${wgULS("展开模板", "展開模板")}</a></li>`,
"t-prefixindex": `<li id="t-prefixindex class="mw-list-item"><a href="/Special:前缀索引?prefix=${wgPageName}">${wgULS("前缀页面", "按詞頭查詢頁面")}</a></li>`,
"t-pagelog": `<li id="t-pagelog" class="mw-list-item"><a href="/Special:日志?page=${wgPageName}">${wgULS("页面日志", "頁面日誌")}</a></li>`,
},
"#n-recentchanges": {
"n-log": `<li id="n-log" class="mw-list-item"><a href="/Special:日志" title="所有日志">${wgULS("所有日志", "所有日誌")}</a></li>`,
},
};
for (const t in items) {
const target = $(t);
for (const 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(wgULS("用户日志", "使用者日誌", null, null, "用戶日誌"));
});
// </pre>