User:Wytukaze/monobook.js

// add css and javascript links to personal toolbar function addTools { var myprefs = document.getElementById('pt-preferences'); var newpt; var newa;

var username = document.getElementById('pt-userpage').getElementsByTagName('a').item(0).firstChild.nodeValue; newpt = document.createElement('li'); newa = document.createElement('a'); newa.href='/w/index.php?title=User:' + username + '/monobook.css&action=edit'; newa.appendChild(document.createTextNode('css')); newpt.appendChild(newa); myprefs.parentNode.insertBefore(newpt, myprefs);

newpt = document.createElement('li'); newa = document.createElement('a'); newa.href='/w/index.php?title=User:' + username + '/monobook.js&action=edit'; newa.appendChild(document.createTextNode('js')); newpt.appendChild(newa); myprefs.parentNode.insertBefore(newpt, myprefs); }

function reformatMyPage { addTools; }

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