MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

//Replaces with the Username of the reader $(function replaceusername { var spantags = document.getElementsByTagName("span");  for (i=0; i<spantags.length; i++) {    if (spantags[i].className=="insertusername") {      if (wgUserName==null) {        spantags[i].innerHTML="buddy";      } else {        spantags[i].innerHTML=wgUserName;      }    }  } });

/*Creates Costum User-Tags and renames others*/ window.UserTagsJS = { modules: {}, tags: { //global 'vstf': { u: 'VSTF', link:'Help:VSTF', title: 'This user is a member of the Volunteer Spam Task Force'}, 'council': {link:'Help:Council', title: 'This is a Wikia Beta tester'}, 'helper': { u: 'Helper', link:'http://community.wikia.com/wiki/Community_Central:International', title: 'This user is a Helper'}, 'notautoconfirmed': {u: 'New Account', order: 21, title: 'This account is new'}, 'bot-global':{u:'Global Bot', order: 1, title: 'This is a global Bot'}, //local 'bureaucrat': { u: 'Bureaucrat', order: 10 ,}, 'founder': { u: 'Founder', order:10 }, 'sysop': { u: 'Admin', order: 10, link:'Ranks#Admins', title: 'This User is an Admin'}, 'supermoderator' :{ u: 'Super-Moderator', order: 11, link:'Ranks#Super_Moderators', title: 'This User is a Super Moderator'}, 'content-moderator': { u: 'Content-Moderator', order: 12, link:'Ranks#Content_Moderators',}, 'threadmoderator': { u: 'Discussion-Moderator', order: 13, link:'Ranks#Discussion_Moderators',title:'This user is a Discussion Moderator'}, 'chatmoderator': { u: 'Chat-Moderator', order: 14, link:'Ranks#Chat_Moderators', title: 'This user is a Chat Moderator'}, 'rollback': { u: 'Rollback', order: 15, link:'Ranks#Rollbacks', title: 'This user is a Rollback'}, 'bot': { u: 'Bot-Account', order: 16, link:'Help:Bots', title: 'This is a Bot Account'}, //special auto 'inactive': { u: 'Inactive',order: 1, link:'Ranks#Inactive', title: 'This user has not edited in the last 21 days'}, 'bannedfromchat': { u: 'Banned from Chat', order : 2, link:'Block', title: 'This user is currently banned from the chat.'}, 'newuser': {u:'New User', order: 20, title: 'This user is new on this Wiki. Welcome!'}, 'nonuser': {u:'Has not edited', order: 1/0, title: 'This user has not edited yet'}, //special manu 'semiactive': { u: 'Semiactive', title: 'This user is currently not very active on the Wiki'}, 'legend': { u: 'LEGEND', order: 10, title: 'This user is a legend!'}, 'monthuser': { u: 'User of the month', order: 3, title: 'This user is the User of the Month!'}, 'ideauser':{u: 'Idea Creator of the month', order: 4, title: 'This user is the Idea Creator of the Month!'}, 'rankinguser':{u: 'Ranking Editor of the month', order: 5, title: 'This user is the Ranking Editor of the Month!'}, 'topcontrib':{u: 'Top Contributor', order: 16, title: 'This user is a Top Contributor'}, 'accontrib': {u: 'Active Contributor', order: 17, title: 'This user is an Active Contributor'}, } }; /*Inactive users*/ UserTagsJS.modules.inactive = { days: 16 // Inactive after 16 days }

a[href="/wiki/User:Inactive"], a[href$=":Inactive_User"], a[href$="Special:Contributions/:Category:Inactive_Users"], a[href$="Special:Block/Category:Inactive_Users"] { color: #999966; font-weight:inherit} /* New users*/ UserTagsJS.modules.newuser = { days: 5, // Must have been on the Wiki for 5 days edits: 20, // And have at least 20 edits to remove the tag };

/*Merges two groups to another one */ UserTagsJS.modules.implode = { 'supermoderator': ['threadmoderator', 'content-moderator'] }; /*Adds another group when user is in these groups (disabled)*/ /*UserTagsJS.modules.explode = { 'vandal-patrol': ['rollback', 'patroller'] // Adds 'vandal-patrol' group BUT does NOT remove rollback or patroller };*/ /*Adds MediaWiki groups*/ UserTagsJS.modules.mwGroups = [ 'bureaucrat', 'chatmoderator', 'wikimoderator', 'rollback', 'sysop', 'bannedfromchat', 'bot', 'bot-global', 'vstf', 'content-moderator' ];

/* Removes Groups from users*/ UserTagsJS.modules.userfilter = { 'FranceSwitzerland': ['bureaucrat', 'inactive'], 'Werner der Champ': ['bureaucrat', 'inactive'], 'Pagehoofd': ['bureaucrat'], };

/*Removes tags from specific groups*/ UserTagsJS.modules.metafilter = { 'semiactive': ['inactive'], 'inactive' : ['topcontrib', 'accontrib'], }; /*Costum tags*/ UserTagsJS.modules.custom = { 'FranceSwitzerland': ['legend'], 'Werner der Champ': ['semiactive'], 'Wasdernoob':['accontrib'], 'TTigerTT':['monthuser'], 'Phillydan25':['ideauser'], 'Highdipo':['rankinguser'] }; UserTagsJS.modules.nonuser = true; // Tags for Users with 0 edits UserTagsJS.modules.autoconfirmed = true; // Tags newly created accounts

/*AjaxRG to refresh Wiki Activity*/ ajaxPages = ['Special:WikiActivity','Special:RecentChanges']; AjaxRCRefreshText = 'Auto-Refresh'; window.ajaxRefresh = 60000; //every 60 seconds AjaxRCRefreshHoverText = 'Automatically refresh the page (every 60 seconds)';

/*UserRightsRecord*/ importArticles({   type: 'script',    articles: [        'u:dev:UserRightsRecord/code.js'    ] }); /*MessageBlock*/ var MessageBlock = { title : 'Block', message : 'You have been blocked for $2 because of the following reason: $1', autocheck : true }; importArticles({   type: 'script',    articles: [        'u:dev:MessageBlock/code.js'    ] }); /*RevealAnonIP*/ // http://dev.wikia.com/wiki/RevealAnonIP window.RevealAnonIP = { permissions : ['user'] }; importArticles({   type: "script",    articles: [        "w:c:dev:RevealAnonIP/code.js"    ] });

/*Making it work together*/ ajaxCallAgain = ['MediaWiki:UserRightsRecord/code.js', 'MediaWiki:MessageBlock/code.js', 'MediaWiki:RevealAnonIP/code.js', RevealAnonIP.reveal];