User:Korath/cologneblue.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(url, name)
{
  var na = document.createElement('a');
  na.setAttribute('href', '/wiki/' + url);

  var txt = document.createTextNode(name);
  na.appendChild(txt);
  return na;
}

function vfdlink()
{
  var qb = document.getElementById("quickbar");
  var h6s = qb.getElementsByTagName('h6');
  var x;
  for (x = 0; x < h6s.length; ++x)
    if (h6s[x].firstChild.data == "My pages")
      {
        var mypages = h6s[x + 1];
        qb.insertBefore(document.createElement('br'), mypages);
        qb.insertBefore(addlink("Wikipedia:Votes_for_deletion/Log/Today", "Today's VFD entries"), mypages);
        break;
      }
}

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