User:Lolsimon/vector.js

// Places an extra link in the top usermenu

function ExtraLink {         //Defining the content of the wanted button: var li = document.createElement( 'li' ); li.id = 'pt-extralink'; var a = document.createElement( 'a' ); a.appendChild( document.createTextNode( 'SUL' ) ); a.href = 'http://toolserver.org/~vvv/sulutil.php?user=' + wgUserName; li.appendChild( a ); //Defines the place: var before = document.getElementById( 'pt-mycontris' ); //You can set here where you want it to place before. before.parentNode.insertBefore( li, before ); //If you want to place it at the end of the menu, replace this line with document.getElementById( 'pt-logout' ).parentNode.appendChild( li );

} if ( window.addEventListener ) window.addEventListener( 'load', ExtraLink, false ); else if ( window.attachEvent     ) window.attachEvent   ( 'onload', ExtraLink );