User:Quarenon/massrollback.js

//Mass rollback function //Written by John254 //Adapted from User:Mr.Z-man/rollbackSummary.js //Instructions: Selecting the "rollback all" tab when viewing a user's contributions history //will open all rollback links displayed there. (Use with caution)

// Adapted to work for Monaco // Original source: http://en.wikipedia.org/wiki/User:John254/mass_rollback.js

function rollbackEverythingButton { var hasRollback = getElementsByClassName(document, "span", "mw-rollback-link"); if (hasRollback[0] && (document.title.indexOf("User contributions") != -1) ) { var list = null;

if (skin == 'monobook') { list = document.getElementById('p-tb').getElementsByTagName('ul')[0]; } else { var lists = document.getElementById('link_box').getElementsByTagName('ul'); if (lists[0].getElementsByTagName('li').length <= lists[1].getElementsByTagName('li').length) { list = lists[0]; } else { list = lists[1]; }		}

var li = document.createElement('li'); var a = document.createElement('a'); a.href = 'javascript:rollbackEverything'; a.appendChild(document.createTextNode('Rollback all')); a.title = 'Rollback all edits displayed here.'; li.appendChild(a); list.insertBefore(li, list.firstChild); } } addOnloadHook(rollbackEverythingButton); function rollbackEverything { for (var i in document.links) { if (document.links[i].href.indexOf('action=rollback') != -1) { window.open(document.links[i].href); }   	} }