User:StonedChipmunk/usermessagechanger.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.
topaz.usermessagechanger = new Object(); /* configuration */ // this will replace the old message topaz.usermessagechanger.newmessage = 'You have <a href="/w/index.php?title=User_talk:'+topaz.wputil.username()+'&redirect=no" title="User talk:'+topaz.wputil.username()+'">new spam</a> (<a href="/w/index.php?title=User_talk:'+topaz.wputil.username()+'&diff=cur" title="User talk:'+topaz.wputil.username()+'">last change</a>).'; /* end configuration */ topaz.usermessagechanger.oldonload = window.onload; window.onload = function() { if (typeof topaz.usermessagechanger.oldonload == "function") topaz.usermessagechanger.oldonload(); var divlist = topaz.util.getobj("bodyContent").getElementsByTagName("div"); var divid; if (divlist[1] && divlist[1].className=="usermessage" && (divid=1) || divlist[2] && divlist[0].className=="tz-primarySection" && divlist[2].className=="usermessage" && (divid=2)) { divlist[divid].innerHTML = topaz.usermessagechanger.newmessage; } };