User:Phroziac/monobook.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure of whether the code is safe, you can ask at the help desk.
/* <pre><nowiki> */

// [[User:Lupin/popups.js]] - please include this line 

 document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// delay in seconds before popup appears
popupDelay=0.6;
// move default titles into popups so they don't interfere
removeTitles=true;

popupAdminLinks=true;

window.onload = Main;
function Main() {
    addactions();
}

function addactions() {
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    if(document.title.indexOf("Special") != 0) addlilink(tabs, '/wiki/WP:RFAr', 'cabal', 'ca-cabal');
    ta['ca-cabal'] = ['a', 'Long live the CABAL'];
    akeytt();
}

function addlilink(tabs, url, name, id) {
    var na = document.createElement('a');
    na.href = url;
    na.id = id;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(na);
    tabs.appendChild(li);
    return li;
}


function runOnloadHook(){
  urlString = document.location.href;
  if(urlString.search("newusers")>0){
    bC = document.getElementById("bodyContent");
    liArray = bC.getElementsByTagName("li");

    for(i=0;i<liArray.length;i++){
      liANode = liArray[i].childNodes[1];
      liANodeNext = liArray[i].childNodes[2];
      liA = liANode.innerHTML;
      newAtext = "http://en.wikipedia.org/w/index.php?title=Special:Blockip&action=submit&wpBlockAddress=";
      newAtext = newAtext + liA;
      newAtext = newAtext + "&wpBlockOther=infinite&wpBlockReason={{username_block}}&wpEditToken=<token>";
      xliA = liArray[i].childNodes[1].cloneNode(true);
      liArray[i].appendChild(xliA,liANodeNext);
      xliA.innerHTML = " <b>[LART]</b>";
      xliA.href = newAtext;
    }
  }
 }

// install [[User:Pilaf/Live_Preview]] page preview tool
document.write('<script type="text/javascript" src="' 
  + 'http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js' 
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

/* </nowiki></pre> */