User:TheLimbicOne/monobook.js

/* */

addOnloadHook(editTopLink); addOnloadHook(KateLink);

//if ( window.addEventListener ) window.addEventListener( 'load', KateLink, false ); // else if ( window.attachEvent     ) window.attachEvent   ( 'onload', KateLink );

// This will add an [edit intro] link at the top of all pages except preview pages // by User:Pile0nades

function editTopLink { if(window.location.href.indexOf("&action=edit&section=0") != -1) document.getElementById("wpSummary").value = "/* Intro */ ";

// if this is preview page or generated page, stop if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// get the page title var pageTitle = document.title.split(" - ")[0].replace(" ", "_");

// create div and set innerHTML to link var divContainer = document.createElement("div"); divContainer.innerHTML = ' [edit intro] ';

// insert divContainer into the DOM before the h1 if(window.location.href.indexOf("&action=edit") == -1) document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);

}

// Add a "Kate" link to your monobook "personal menu" list at the very // top of the page. // function KateLink {  //where "Kate" appears: before pt-userpage, pt-mytalk, pt-preferences, pt-watchlist, pt-mycontris, or pt-logout gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout" var user = document.getElementById( 'pt-userpage' ).firstChild.firstChild.data; var li = document.createElement( 'li' ); li.id = 'pt-kate'; var a = document.createElement( 'a' ); a.appendChild( document.createTextNode( 'Kate' ) ); // eh, the css makes the text lowercase a.href = 'http://tools.wikimedia.de/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + 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 ); } }

/* */