User:Ross613/monobook.js

function KateLink {   // use the "edit this page" tab to get user name var user = document.getElementById('ca-edit').getElementsByTagName('a')[0].href; // cut everything up to "title=" from the start and everything past "&action=edit" from the end user = user.substring(user.indexOf('title=') + 6, user.lastIndexOf('&action=edit')); user = user.substring(user.indexOf(':') + 1); var li = document.createElement( 'li' ); li.id = 'pt-kate'; var a = document.createElement( 'a' ); a.appendChild( document.createTextNode( 'count' ) ); // eh, the css makes the text lowercase a.href = 'http://en.wikipedia.org/wiki/User:Interiot/Tool2/code.js?username=' + user;

li.appendChild( a ); if ( ! gsKateInsertBefore ) // append to end (right) of list {      document.getElementById( 'pt-logout' ).parentNode.appendChild( li ); }   else {       var before = document.getElementById( gsKateInsertBefore ); before.appendChild( li, before ); } }

//add this if to Main or load function if (document.title.indexOf("User") != -1) KateLink; //count menu option on user pages