Jump to content

User:Kate/myskin.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('RfA', 'WP:RFA'));
  nul.appendChild(addlink('VfD', 'WP:VFD'));
  nul.appendChild(addlink('FAC', 'WP:FAC'));
  nul.appendChild(addlink('RfC', 'WP:RFC'));
  nul.appendChild(addlink('RfAr', 'WP:RFAR'));
  nul.appendChild(addlink('MoS', 'WP:MOS'));
  nul.appendChild(addlink('ViP', 'WP:VIP'));
  nul.appendChild(addlink('VP', 'WP:VP'));

  var title=document.createElement('h5');
  title.appendChild(document.createTextNode('Shortcuts'));
  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);