Wikipedia:WikiProject User scripts/Scripts/Watchlist since: Difference between revisions

Content deleted Content added
major rewrite, works with tabbed browsing too
tweaks and bugfixes
Line 1:
// Adds a "Changes since last load" link to your watchlist. <pre><nowiki>
 
addOnloadHook(function () {
Line 5:
 
// just one little ID attribute would be _so_ nice...
var wlNoteParansSelectForm = document.getElementsByTagNamegetElementById('hrnamespace')[0];
while (wlNoteParansSelectForm && !(wlNoteParansSelectForm.tagName && wlNoteParansSelectForm.tagName.toLowerCase() == 'pform'))
wlNotePara nsSelectForm = wlNoteParansSelectForm.nextSiblingparentNode;
if (!wlNoteParansSelectForm) return;
 
var link = document.createElement('a');
Line 27:
link.onmousedown = fixLinkHref; // react to middle clicks too
 
wlNotePara.appendChild(var frag = document.createElementcreateDocumentFragment('br'));
wlNoteParafrag.appendChild(linkdocument.createTextNode(' | '));
frag.appendChild(link);
link.appendChild(document.createTextNode('Changes'));
wlNoteParafrag.appendChild(document.createTextNode(' since last load.'));
nsSelectForm.parentNode.insertBefore(frag, nsSelectForm);
});
 
//</nowiki></pre>