User:JJPMaster/Scripts/catredirector.js: Difference between revisions

Content deleted Content added
No edit summary
m JJPMaster moved page User:JJPMaster/catredirector.js to User:JJPMaster/Scripts/catredirector.js: cleaning up my userspace
 
(One intermediate revision by the same user not shown)
Line 1:
let queryString = new URLSearchParams(window.___location.search);
upperName = mw.config.get("wgPageName").toUpperCase();
if(queryString.get("redirect") !== "no") {
if (mw.config.get("wgArticleId") == 0) {
if(mw.config.get("wgPageName").toUpperCase()upperName.startsWith("CAT:")) {
window.___location.href = "/wiki/" + mw.config.get("wgFormattedNamespaces")[14] + ":" + mw.config.get("wgPageName").replace("CAT:", "");
}
else if(upperName.startsWith("P:")) {
window.___location.href = "/wiki/" + mw.config.get("wgFormattedNamespaces")[100] + ":" + mw.config.get("wgPageName").replace("P:", "");
}
else if(upperName.startsWith("H:")) {
window.___location.href = "/wiki/" + mw.config.get("wgFormattedNamespaces")[12] + ":" + mw.config.get("wgPageName").replace("H:", "");
}
}