Wikipedia:WikiProject User scripts/Scripts/Unwatch: Difference between revisions

Content deleted Content added
m enchanced -> enhanced
fix bug in enhanced mode
Line 14:
if (div.tagName.toLowerCase() == 'div') { // enhanced recent changes
// this is all tag soup, we just have to wade through it :-(
var pagename = "";
for (var node = div.firstChild; node; node = node.nextSibling) {
// grablocate the title of the firsthistory link on each line
if (!pagename && node.tagName &&|| node.tagName.toLowerCase() =!= 'a' || node.href.substring(node.href.length-15) != '&action=history')
pagename = node.titlecontinue;
ifvar (pagename &&= node.tagName && node.tagName.toLowerCase() == 'br')title;
var pagenameunwatch = ""document.createElement('a');
unwatch.href = "/w/index.php?title=Special:Watchlist&action=submit&remove=1&id[]="+encodeURIComponent(pagename);
// add the (unwatch) link after diff and hist (look for distinctive text node)
if (pagename && nodeunwatch.nodeTypetitle == 3 && node.nodeValue.substring(0, 5) == ")Unwatch . .") {+pagename;
var unwatch = .appendChild(document.createElementcreateTextNode('a'"unwatch"));
div.insertBefore(unwatch, node.nextSibling);
unwatch.href = "/w/index.php?title=Special:Watchlist&action=submit&remove=1&id[]="+encodeURIComponent(pagename);
unwatchdiv.title =insertBefore(document.createTextNode("; "Unwatch), "+pagenameunwatch);
unwatch.appendChild(document.createTextNode("unwatch"));
div.insertBefore(document.createTextNode("; "), node);
div.insertBefore(unwatch, node);
}
}
// XXX: might want to double check that pagename is null here, but I'll ignore it for now
}
else if (div.tagName.toLowerCase() == 'ul') { // unenhanced recent changes