User:Norm/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
function addlink(name, url) {
  var na = document.createElement('a');
  na.setAttribute('href', '/wiki/' + url);  
  var txt = document.createTextNode(name);
  na.appendChild(txt);
  var nli = document.createElement('li');
  nli.setAttribute('class', 'p-newlinks');
  nli.appendChild(na);
  return nli;
}

function morelinks() {
  var ndivportlet = document.createElement('div');
  var ndivpbody = document.createElement('div');
  var colone = document.getElementById('column-one');
  ndivportlet.setAttribute('class', 'portlet');
  ndivportlet.setAttribute('id', 'p-newlinks');
  ndivpbody.setAttribute('class', 'pBody');
  var nul = document.createElement('ul');
  nul.setAttribute('id', 'p-newlinks');
  nul.appendChild(addlink('Adrian Pingstone', 'Special:Contributions/Arpingstone'));
  nul.appendChild(addlink('Fvw', 'Special:Log/block'));
  nul.appendChild(addlink('Village pump', 'WP:VP'));
  nul.appendChild(addlink('Featured candidates', 'WP:FAC'));
  nul.appendChild(addlink('Sandbox', 'User:Norm/Sandbox'));
  nul.appendChild(addlink('To do', 'User:Norm/to_do'));
  nul.appendChild(addlink('Cleanup', 'WP:CU'));
  nul.appendChild(addlink('Expansion', 'WP:RFE'));
  nul.appendChild(addlink('Bias', 'WP:Bias'));
  nul.appendChild(addlink(':-)', 'WP:-)'));
  nul.appendChild(addlink('New pages', 'Special:Newpages'));
  nul.appendChild(addlink('New images', 'Special:Newimages'));


  var title=document.createElement('h5');
  title.appendChild(document.createTextNode('Links'));
  ndivportlet.appendChild(title);
  ndivpbody.appendChild(nul);
  ndivportlet.appendChild(ndivpbody);
  colone.appendChild(ndivportlet);
}

function do_onload() {
  morelinks();
}

if (window.addEventListener) 
  window.addEventListener("load", do_onload, false);
else if (window.attachEvent) 
  window.attachEvent("onload", do_onload);

// Live Preview customization,
// edit this to your own liking.


wpUserName   = 'Norm';   // User name to display in signatures

wpShowImages = true;      // Enable downloading and displaying of images


// Include Live Preview...


document.write('<script type="text/javascript" src="/w/index.php?title=User:Pilaf/livepreview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');


// Now set everything up


window.onload = Main;


function Main()
{

 LivePreviewInstall();

 // You may include here other "extensions"

}


/* This is to keep track of who is using the Live Preview: [[User:Pilaf/livepreview.js]] */