User:Greg Tyler/rollbackprompt.js

// This script generates a little popup box when the user clicks on the "rollback" button, checking // that they definitely want to rollback, and didn't click the button by mistake.

// Rather than executing immediately, we'll wait until the page has finished loading. addEventListener('DOMContentLoaded',function { // Now we'll search for all the "span" tags, looking for the ones in the "mw-rollback-link" class d = document.getElementsByTagName('span'); for(i=0;i= 0) d[i].getElementsByTagName('a')[0].onclick=function {if(!confirm('Are you sure you want to do a rollback?')) return false;}; } }, false);