User:RealFakeKim/Scripts/pageInfo.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | This user script seems to have a documentation page at User:RealFakeKim/Scripts/pageInfo. |
const pagename = mw.config.get( 'wgPageName' );
const pagenameProcessed = encodeURIComponent(
mw.config
.get("wgPageName")
.replace(/_/g, " ")
.split("/")[0]
);
if (mw.config.get("wgNamespaceNumber") === 0) {
//mainspace
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") +
"/w/index.php?title=Special%3AAllPages&from=Articles+for+deletion%2F" +
pagenameProcessed +
"&to=Articles+for+deletion%2F" +
pagenameProcessed +
"+%28z&namespace=4",
"AfD discussions",
"t-afd-discussions-tool",
""
);
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") +
"/w/index.php?title=Special%3AAllPages&from=" +
pagenameProcessed +
"%2FGA1&to=" +
pagenameProcessed +
"%2FGAz&namespace=1",
"GA nominations",
"t-GA-nominations-tool",
""
);
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") +
"/w/index.php?title=Special%3AAllPages&from=Good article reassessment%2F" +
pagenameProcessed +
"%2F1&to=Good article reassessment%2F" +
pagenameProcessed +
"%2Fz&namespace=4",
"GA reassesments",
"t-GA-reassesments-tool",
""
);
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") +
"/w/index.php?title=Special%3AAllPages&from=Featured article candidates%2F" +
pagenameProcessed +
"&to=Featured article candidates%2F" +
pagenameProcessed +
"%2Farchivez&namespace=4",
"FA nominations",
"t-FA-nominations-tool",
""
);
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") +
"/w/index.php?title=Special%3AAllPages&from=Featured article review%2F" +
pagenameProcessed +
"&to=Featured article review%2F" +
pagenameProcessed +
"%2Farchivez&namespace=4",
"FA reviews",
"t-FA-reviews-tool",
""
);
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") +
"/w/index.php?title=Special%3AAllPages&from=Peer review%2F" +
pagenameProcessed +
"&to=Peer review%2F" +
pagenameProcessed +
"%2Farchivez&namespace=4",
"Peer reviews",
"t-Peer-reviews-tool",
""
);
}
if (
mw.config.get("wgNamespaceNumber") === 2 ||
mw.config.get("wgNamespaceNumber") === 3
) {
// User and user talk
const username = pagenameProcessed
.replace("User%3A", "")
.replace("User%20talk%3A", "");
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") +
"/w/index.php?title=Special%3AAllPages&from=Requests+for+adminship%2F" +
username +
"&to=Requests+for+adminship%2F" +
username +
"%20z&namespace=4",
"Requests for adminship",
"t-RFA-tool",
`Requests for adminship by ${username}`,
null,
'#t-RFB-tool'
);
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") + "/w/index.php?title=Special%3AAllPages&from=Requests+for+bureaucratship%2F" + username + "&to=Requests+for+bureaucratship%2F" + username + "%20z&namespace=4",
"Requests for bureaucratship",
"t-RFB-tool",
`Requests for bureaucratship by ${username}`,
null,
'#t-upload'
);
}
// all pages
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") + "/wiki/Special:Log?type=protect&user=&page=" + pagename,
"Protection log",
"t-Protection-log-tool",
`Protection log of ${pagename}`,
null,
'#t-subpages'
);
mw.util.addPortletLink(
"p-tb",
mw.config.get("wgServer") + "/w/index.php?title=Special:WhatLinksHere/" + pagename + "&hidelinks=1&hidetrans=1&limit=500",
"What redirects here",
"t-redirects-here-tool",
`Redirects to ${pagename}`,
null,
'#t-recentchangeslinked'
);
mw.util.addPortletLink(
'p-tb',
mw.util.getUrl( 'Special:PrefixIndex/' ) + pagename + '/',
'Subpages',
't-subpages',
`Subpages of ${pagename}`,
null,
'#t-userrights'
);