//This script ([[User:ais523/highlightmyname2.js]]) highlights all instances of the//logged-in user's username on pages by giving them a bright red background. It only//checks bodyContent, not titles or sidebars, and doesn't change edit windows or//Special:Preferences.//<nowiki><pre>functionhighlightmyname(n,p)//node, parent node{while(n!=null){if(n.nodeType==3)//text node{if(n.data.toLowerCase().indexOf(mw.config.get('wgUserName').toLowerCase())!=-1){varix=n.data.toLowerCase().indexOf(mw.config.get('wgUserName').toLowerCase());vart1=ix?document.createTextNode(n.data.substr(0,ix)):null;vart2=document.createTextNode(n.data.substr(ix,mw.config.get('wgUserName').length));vart3=ix+mw.config.get('wgUserName').length==n.data.length?null:document.createTextNode(n.data.substr(ix+mw.config.get('wgUserName').length));vars1=document.createElement("SPAN");s1.style.backgroundColor="#E6E6FA";s1.appendChild(t2);vars2=document.createElement("SPAN");if(t1!=null)s2.appendChild(t1);s2.appendChild(s1);if(t3!=null)s2.appendChild(t3);p.replaceChild(s2,n);if(t3!=null)highlightmyname(t3,s2);//find remaining occurences in the new nodesn=s2.nextSibling;}elsen=n.nextSibling;}else{if(n.firstChild!=null)highlightmyname(n.firstChild,n);n=n.nextSibling;}}}$(function(){if(location.href.indexOf("?ais523")==-1&&location.href.indexOf("&ais523")==-1&&location.href.indexOf("?action=edit")==-1&&location.href.indexOf("?action=submit")==-1&&location.href.indexOf("&action=edit")==-1&&location.href.indexOf("&action=submit")==-1&&location.href.indexOf("&action=raw")==-1&&mw.config.get('wgPageName')!="Special:Preferences")highlightmyname(document.getElementById('bodyContent').firstChild,document.getElementById('bodyContent'));});//</pre></nowiki>