Jump to content
Wikimedia Meta-Wiki

User:ImprovedWikiImprovment/sidebar.js: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
Line 10: Line 10:
mw.util.addPortletLink("p-navigation", "//meta.wikimedia.org/wiki/Special:EmailUser/Emergency", "Emergency", "n-t4fsidebar-emerg", "Contact Emergency");
mw.util.addPortletLink("p-navigation", "//meta.wikimedia.org/wiki/Special:EmailUser/Emergency", "Emergency", "n-t4fsidebar-emerg", "Contact Emergency");
mw.util.addPortletLink("p-navigation", "//meta.wikimedia.org/wiki/Steward_requests/Global", "SRG", "n-t4fsidebar-srg", "Go to SRG");
mw.util.addPortletLink("p-navigation", "//meta.wikimedia.org/wiki/Steward_requests/Global", "SRG", "n-t4fsidebar-srg", "Go to SRG");
document.querySelector("#n-t4fsidebar-lwcu > a").addEventListener("click", goLWCU);
}


if ( mw.config.get("wgRelevantUserName") !== null ) {
return;
var relUser = mw.config.get("wgRelevantUserName");
if (relUser !== null) {
if (!mw.util.isIPAddress(relUser)) {
if ( mw.config.get("wgCanonicalSpecialPageName") != "CentralAuth" ) {
mw.util.addPortletLink("p-navigation", "//meta.wikimedia.org/wiki/Special:CentralAuth/" + relUser, "CentralAuth This", "n-t4fsidebar-cat", "Go to CentralAuth for this user", null, "#n-t4fsidebar-gb");
}
}
else {
if (/steward/.test(mw.config.get("wgGlobalGroups"))) {
mw.util.addPortletLink("p-navigation", "//meta.wikimedia.org/wiki/Special:GlobalBlock/" + relUser, "GlobalBlock this", "n-t4fsidebar-gbt", "Globally block this IP", null, "#n-t4fsidebar-guc");
}
mw.util.addPortletLink("p-navigation", "//ipcheck.toolforge.org/index.php?ip=" + relUser, "IPCheck this", "n-t4fsidebar-pxyt", "Check if this IP is a proxy", null, "#n-t4fsidebar-spur");
mw.util.addPortletLink("p-navigation", "//spur.us/context/" + relUser, "Spur this", "n-t4fsidebar-spurt", "Check if this IP belongs to a VPN", null, "#n-t4fsidebar-spurapi");
mw.util.addPortletLink("p-navigation", "//en.wikipedia.org/wiki/User:GeneralNotability/SpurLookup?address=" + relUser, "Spur API this", "n-t4fsidebar-spurapit", "Check if this IP belongs to a VPN", null, "#n-t4fsidebar-bullseye");
mw.util.addPortletLink("p-navigation", "//bullseye.toolforge.org/ip/" + relUser, "Bullseye this", "n-t4fsidebar-bullseyet", "Check info for this IP", null, "#n-t4fsidebar-whois");
mw.util.addPortletLink("p-navigation", "//whois-referral.toolforge.org/gateway.py?lookup=true&ip=" + relUser, "WHOIS this", "n-t4fsidebar-whoist", "Get WHOIS information of this IP", null, "#n-t4fsidebar-rngblk");
if (!mw.util.isIPv6Address(relUser)){
mw.util.addPortletLink("p-navigation", "//rangeblockfinder.toolforge.org/?ip=" + relUser, "Rangeblock finder this", "n-t4fsidebar-rngblkt", "Find rangeblocks for this IP", null, "#n-t4fsidebar-bgp");
}
else {
mw.util.addPortletLink("p-navigation", "//rangeblockfinder.toolforge.org/?ip=" + relUser + "&excludelow", "Rangeblock finder this", "n-t4fsidebar-rngblkt", "Find rangeblocks for this IP", null, "#n-t4fsidebar-bgp");
}
mw.util.addPortletLink("p-navigation", "//bgp.he.net/ip/" + relUser, "BGP This", "n-t4fsidebar-bgpt", "Lookup BGP information for this IP", null, "#n-t4fsidebar-lwcu")
}
mw.util.addPortletLink("p-navigation", "//guc.toolforge.org/?user=" + relUser + "&blocks=true", "GUC This", "n-t4fsidebar-guct", "Check the global contributions of this user/IP", null, "#n-t4fsidebar-guc2");
mw.util.addPortletLink("p-navigation", "//xtools.wmflabs.org/globalcontribs/" + relUser, "GUC 2 This", "n-t4fsidebar-guc2t", "Check the global contributions of this user/IP", null, "#n-t4fsidebar-pxy");
if (/steward/.test(mw.config.get("wgGlobalGroups"))) {
mw.util.addPortletLink("p-navigation", "//login.wikimedia.org/w/index.php?title=Special:CheckUser&user=" + relUser, "LWCU This", "n-t4fsidebar-lwcut", "Check this user/IP at loginwiki");
}
}
(追記) (追記ここまで) return;
}
}
});
});

Revision as of 08:56, 12 February 2023

 //
 (function(){

 $(document).ready(function(){
 mw.loader.using(['mediawiki.util'],function(){
 // show shortcuts if not editing
 if(!mw.config.get('wgEditMessage')){
 mw.util.addPortletLink("p-navigation","https://simple.wikipedia.org/wiki/Special:RecentChanges","simplewiki");
 mw.util.addPortletLink("p-navigation","https://en.wikipedia.org/wiki/Special:RecentChanges","enwiki");
 mw.util.addPortletLink("p-navigation","//meta.wikimedia.org/wiki/Special:EmailUser/Emergency","Emergency","n-t4fsidebar-emerg","Contact Emergency");
 mw.util.addPortletLink("p-navigation","//meta.wikimedia.org/wiki/Steward_requests/Global","SRG","n-t4fsidebar-srg","Go to SRG");
 document.querySelector("#n-t4fsidebar-lwcu > a").addEventListener("click",goLWCU);
 }

 if(mw.config.get("wgRelevantUserName")!==null){
 varrelUser=mw.config.get("wgRelevantUserName");
 if(relUser!==null){
 if(!mw.util.isIPAddress(relUser)){
 if(mw.config.get("wgCanonicalSpecialPageName")!="CentralAuth"){
 mw.util.addPortletLink("p-navigation","//meta.wikimedia.org/wiki/Special:CentralAuth/"+relUser,"CentralAuth This","n-t4fsidebar-cat","Go to CentralAuth for this user",null,"#n-t4fsidebar-gb");
 }
 }
 else{
 if(/steward/.test(mw.config.get("wgGlobalGroups"))){
 mw.util.addPortletLink("p-navigation","//meta.wikimedia.org/wiki/Special:GlobalBlock/"+relUser,"GlobalBlock this","n-t4fsidebar-gbt","Globally block this IP",null,"#n-t4fsidebar-guc");
 }
 mw.util.addPortletLink("p-navigation","//ipcheck.toolforge.org/index.php?ip="+relUser,"IPCheck this","n-t4fsidebar-pxyt","Check if this IP is a proxy",null,"#n-t4fsidebar-spur");
 mw.util.addPortletLink("p-navigation","//spur.us/context/"+relUser,"Spur this","n-t4fsidebar-spurt","Check if this IP belongs to a VPN",null,"#n-t4fsidebar-spurapi");
 mw.util.addPortletLink("p-navigation","//en.wikipedia.org/wiki/User:GeneralNotability/SpurLookup?address="+relUser,"Spur API this","n-t4fsidebar-spurapit","Check if this IP belongs to a VPN",null,"#n-t4fsidebar-bullseye");
 mw.util.addPortletLink("p-navigation","//bullseye.toolforge.org/ip/"+relUser,"Bullseye this","n-t4fsidebar-bullseyet","Check info for this IP",null,"#n-t4fsidebar-whois");
 mw.util.addPortletLink("p-navigation","//whois-referral.toolforge.org/gateway.py?lookup=true&ip="+relUser,"WHOIS this","n-t4fsidebar-whoist","Get WHOIS information of this IP",null,"#n-t4fsidebar-rngblk");
 if(!mw.util.isIPv6Address(relUser)){
 mw.util.addPortletLink("p-navigation","//rangeblockfinder.toolforge.org/?ip="+relUser,"Rangeblock finder this","n-t4fsidebar-rngblkt","Find rangeblocks for this IP",null,"#n-t4fsidebar-bgp");
 }
 else{
 mw.util.addPortletLink("p-navigation","//rangeblockfinder.toolforge.org/?ip="+relUser+"&excludelow","Rangeblock finder this","n-t4fsidebar-rngblkt","Find rangeblocks for this IP",null,"#n-t4fsidebar-bgp");
 }
 mw.util.addPortletLink("p-navigation","//bgp.he.net/ip/"+relUser,"BGP This","n-t4fsidebar-bgpt","Lookup BGP information for this IP",null,"#n-t4fsidebar-lwcu")
 }
 mw.util.addPortletLink("p-navigation","//guc.toolforge.org/?user="+relUser+"&blocks=true","GUC This","n-t4fsidebar-guct","Check the global contributions of this user/IP",null,"#n-t4fsidebar-guc2");
 mw.util.addPortletLink("p-navigation","//xtools.wmflabs.org/globalcontribs/"+relUser,"GUC 2 This","n-t4fsidebar-guc2t","Check the global contributions of this user/IP",null,"#n-t4fsidebar-pxy");
 if(/steward/.test(mw.config.get("wgGlobalGroups"))){
 mw.util.addPortletLink("p-navigation","//login.wikimedia.org/w/index.php?title=Special:CheckUser&user="+relUser,"LWCU This","n-t4fsidebar-lwcut","Check this user/IP at loginwiki");
 }
 }
 return;
 }
 });
 });
 }());

AltStyle によって変換されたページ (->オリジナル) /