Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// Add an [edit] link to pagesaddOnloadHook(function(){// Add label to edit box if actually editingif(window.location.href.indexOf("&action=edit§ion=0")!=-1){vareditField=document.getElementById("wpSummary");if(editField)editField.value="/* Intro */ ";return;}// Don't add the link if there are no other links on the page. This avoids adding it on// history etc. pages and also if the user's edit link preference is turned off.if(!document.getElementById('bodyContent').innerHTML.match('class=\"editsection\"'))return;// get the page titlevarpageTitle=document.title.split(" - ")[0];varpageLink=pageTitle.replace(/ /g,"_");// create div and set innerHTML to linkvardivContainer=document.createElement("div");vardivStart='<div class="editsection" style="float:right;margin-left:5px;margin-right:0px;margin-top:38px;">';vardivLink='<a href="/w/index.php?title='+pageLink+'&action=edit§ion=0" title="Edit intro section: '+pageTitle+'">';divContainer.innerHTML=divStart+'['+divLink+'edit</a>]</div>';// insert divContainer into the DOM below the h1document.getElementById("content").insertBefore(divContainer,document.getElementsByTagName("h1")[0]);});//