User:Alexsanderson83/monobook.js
From Wikipedia, the free encyclopedia
If a message on your talk page led you here, please be wary of who left it. Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. If this is a .js page, the code will be executed when previewing the page.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
<source lang="javascript"> //Auto page watcher, activates the ajax-watch function after 1 second delay //Note that a delay is required as the ajax watchlist setup script loads after addOnloadHooks. //If you want to watch *all* namespaces, change wgNamespaceNumber==0 to wgNamespaceNumber!=-1 if(wgNamespaceNumber!=-1 addOnloadHook(function() { var foo = setTimeout('watchThis()',1000); //milliseconds. Increase if on a slow connection. }) function watchThis() { var wli = document.getElementById('ca-watch'); if(!wli) return; var wlink = wli.getElementsByTagName('a')[0]; //we can't .click() an href, and the .onclick is a mess, so lets clone it var wbutt = document.createElement('button'); wbutt.onclick = wlink.onclick; wbutt.style.display = 'none'; wlink.parentNode.appendChild(wbutt); wbutt.click(); } </source>