User:SimmeD/confirmwatchlistrollback.js

/* function confirmWatchlistRollback {	if(wgCanonicalSpecialPageName=='Watchlist' || wgCanonicalSpecialPageName=='Recentchanges') {		var rollbackNodes; if(!document.getElementsByClassName) {			rollbackNodes=getElementsByClassName(document.getElementById("bodyContent"),"span","mw-rollback-link"); }		else {			rollbackNodes=document.getElementsByClassName('mw-rollback-link'); }		var rollbackclicked=function (e) {								if(!e) {									e=window.event; }								if(!confirm("Er du sikker på, du vil rulle disse ændringer tilbage?")) {									if(e.stopPropagation) {										e.stopPropagation; e.preventDefault; }									else {										e.cancelBubble=true; e.returnValue=false; }								}							};		for (var i=0;i<rollbackNodes.length;i++) {	             rollbackNodes[i].childNodes[1].onclick=rollbackclicked; }   } } $(confirmWatchlistRollback);
 * Will pop-up a confirmation dialog when rollback link is clicked from Watchlist.
 * Hit the "cancel" button if you had clicked Rollback accidentally and the edit will not be reverted.
 * To install add importScript('User:Zvn/confirmwatchlistrollback.js'); to your monobook.js.