User:Philwelch/monobook.js

//  //  Add a "Kate" link to your monobook "personal menu" list at the very // top of the page. //  //  Indicate where you would like "Kate" to appear: //   pt-userpage, pt-mytalk, pt-preferences, //   pt-watchlist, pt-mycontris, pt-logout // gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout" // function KateLink {  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( 'interiot' ) ); // eh, the css makes the text lowercase a.href = 'http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=Philwelch&dbname=enwiki_p'; 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 ); } }   if ( window.addEventListener ) window.addEventListener( 'load', KateLink, false ); else if ( window.attachEvent     ) window.attachEvent   ( 'onload', KateLink );

function addForceSummary {   if(!/&action=edit/.test(window.location.href) && !/&action=submit/.test(window.location.href)) return; if(/&section=new/.test(window.location.href)) return; if(!document.forms.editform) return; document.forms.editform.wpSave.onclick = forceSummary; document.forms.editform.wpSave.onfocus = forceSummary; }

function forceSummary {   if(!document.forms.editform.wpSummary.value.replace(/^(?:\/\\*.*\\*\/)? *(.*) *$/,'$1'))   {        var r = prompt('Are you sure you want to submit without adding a summary?\nTo add a summary, type it in the box below:',document.forms.editform.wpSummary.value); if(r == null) { return false; } document.forms.editform.wpSummary.value = r;   } return true; }

addOnloadFunction(addForceSummary);

var addOnloadFunction=function(f) { if (window.addEventListener) window.addEventListener("load",f,false); else if (window.attachEvent) window.attachEvent("onload",f); else { var oldOnload='_old_onload_'+addOnloadFunction.uid; addOnloadFunction[oldOnload] = window.onload ? window.onload : function {}; window.onload = function { addOnloadFunction[oldOnload]; f; } ++addOnloadFunction.uid; } } addOnloadFunction.uid=0;

// This script is at http://en.wikipedia.org/w/index.php?title=User:Bblackmoor/monobook.js&action=raw&ctype=text/javascript&dontcountme=s

// Signature fix. function sigFix { document.getElementById("toolbar").innerHTML=document.getElementById("toolbar").innerHTML.replace('--' + '','-- BBlackmoor (talk), -- T  Z'); }

function reformatMyPage { sigFix; }

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