User:Moydow/Scripts.js

// //Common library functions used by many of the scripts below (Ryan Schmidt, StrategyWiki) //This must be at the top of this page. importScript('User:Ryan Schmidt/Scripts/library.js'); //

//A collection of scripts which some users may find useful. //Content derived from zeldawiki:MediaWiki:Admin.js //and User:Ryan_Schmidt/Scripts, and each script //is credited to its respective source. //To use this script, add this line to your personal .js page: //importScript('User:Moydow/Scripts.js'); //and the following to your .css page: //.ais523_adminrights_admin {background-color: #E0FFFF !important}; //- //Rights: zeldawiki:MediaWiki:Admin.js //Sets a variable "rights" which will return "false" if the //currently logged in user is a bureaucrat, administrator or autoconfirmed user. It will return true otherwise. //it also defines variables which may be used elsewhere in scripts. //-

var rights_isAdmin = (wgUserGroups.toString.indexOf('sysop') != -1); var rights_isAuto = (wgUserGroups.toString.indexOf('autoconfirmed') != -1); var rights_isCrat = (wgUserGroups.toString.indexOf('bureaucrat') != -1); var rights = true; if (rights_isCrat || rights_isAdmin || rights_isAuto) {rights=false} // // // adminrights.js        zeldawiki, (adapted from http://en.wikipedia.org/wiki/User:Ais523/adminrights.js) // This script changes the color of links to admins' userpages in the bodyContent of Special, History pages, diff pages, // and old page revisions. // ("bodyContent" being everything but the tabs,personal links at the top of the screen and sidebar). //

var adminrights=new Array; importScript('User:Moydow/Adminlist.js'); //Highlighting script. Based on wp:User:ais523/highlightmyname.js. function highlightadmins(n,p) //node, parent node { while(n!=null) {   if(n.nodeType==1&&n.tagName.toLowerCase=="a") //anchor {     if(n.href.indexOf("/User:")!=-1) {       var u=n.href.split("/User:")[1]; if(adminrights[u.split("_").join("%20")]==1) {         n.style.color="#008000"; if(n.className==null||n.className=="") n.className="ais523_adminrights_admin"; else n.className+="ais523_adminrights_admin"; }       n=n.nextSibling; }     else if(n.href.indexOf("/index.php?title=User:")!=-1) {       var u=n.href.split("/index.php?title=User:")[1]; if(adminrights[u.split("_").join("%20")]==1) {         n.style.color="#008000"; if(n.className==null||n.className=="") n.className="ais523_adminrights_admin"; else n.className+=" ais523_adminrights_admin"; }       n=n.nextSibling; }     else {       if(n.firstChild!=null) highlightadmins(n.firstChild,n); n=n.nextSibling; }   }    else {     if(n.firstChild!=null) highlightadmins(n.firstChild,n); n=n.nextSibling; } } }

if (wgCanonicalNamespace == 'Special' || wgAction == 'history' || document.URL.indexOf('diff=') > 0 || document.URL.indexOf('oldid=') > 0) { addOnloadHook(function {   highlightadmins(document.getElementById('bodyContent').firstChild, document.getElementById('bodyContent')); }); } //

// //Add section edit link for the top section (Ryan Schmidt, StrategyWiki) // importScript('User:Ryan Schmidt/Scripts/TopSection.js'); //

// //AJAX Patrol (Ryan Schmidt, StrategyWiki) //Automatically patrols the opened diff, and //loads the next diff when [Mark as patrolled] is clicked, //speeding up patrolling. Thus, only usable by sysops. // AjaxPatrolAutoNext = true; importScript('User:Ryan Schmidt/Scripts/AjaxPatrol.js'); //

// //Find and replace script //by Zocky // importScript('User:Ryan Schmidt/Scripts/SearchBox.js'); //