User:Peoplelikeyou/common.js: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
Content deleted Content added
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 42: Line 42:
if(linkTarget !== undefined && linkTarget.startsWith("/wiki/User_talk:")) {
if(linkTarget !== undefined && linkTarget.startsWith("/wiki/User_talk:")) {
pageTitle = linkTarget.split("/wiki/User_talk:")
pageTitle = linkTarget.split("/wiki/User_talk:")
if(adminrights[pageTitle[1].replace("_", " ").join("%20")]==1) {
if(adminrights[pageTitle[1].replace("_", " ")]==1) {
$(this).addClass("adminrights_admin");
$(this).addClass("adminrights_admin");
$(this).css("background-color", "#BBFFFF");
$(this).css("background-color", "#BBFFFF");

Revision as of 05:19, 24 October 2022

var adminrights = {};
 
//Start of section to update
adminrights['3PPYB6']=1;
adminrights['Abuse%20filter']=1;
adminrights['AlPaD']=1;
adminrights['Brewster239']=1;
adminrights['C1K98V']=1;
//End of section to update
 
//Updating script
$( function() {
  if(location.href==mw.config.get( 'wgServer' )+ mw.config.get( 'wgScript') + "?title=Special:ListUsers&limit=5000&"+
                    "group=sysop&adminupdate=y")
  {
    var h=document.getElementById('bodyContent').innerHTML;
    var a= [];
    h=h.split(/\< *li *\>/i);
    var i=0;
    while(++i<h.length)
    {
      a[h[i].split(">")[1].split("<")[0]]=h[i].split(/\< *\/ *li *\>/i)[0];
    }
    for(i in a)
    {
      document.write("adminrights['"+
        encodeURIComponent(i).split("\\").join("\\\\").split("'").join("%27")
                             .split("(").join("%28").split(")").join("%29")
                             .split("!").join("%21").split(",").join("%2C")
                             .split("%3A").join(":")+"']=1;<BR/>");
    }
  }
});
 
$( function() {
  if( location.href.indexOf("?adminupdate") == -1 && location.href.indexOf("&adminupdate")==-1 &&
     mw.config.get( 'wgAction') != 'edit' && mw.config.get( 'wgAction') != 'submit' &&
     mw.config.get( 'wgPageName')!="Special:Preferences")
  {
  	$("#bodyContent a").each(function() {
  		linkTarget = $(this).attr("href");
  		if(linkTarget !== undefined && linkTarget.startsWith("/wiki/User_talk:")) {
  			pageTitle = linkTarget.split("/wiki/User_talk:")
	  		if(adminrights[pageTitle[1].replace("_", " ")]==1) {
	  			$(this).addClass("adminrights_admin");
	  			$(this).css("background-color", "#BBFFFF");
	  		}
  		}
  	});
  }
});