User:Chairboy/protecthelper.greasemonkey.js

Simple helper script to easily populate the protect rationale when protecting pages. Lists a few common reasons, if you can think of more, let me know. It doesn't do anything cool like pre-check boxes yet, but I'll see if I can figure out an efficient way to do that soon. // Protect helper script // Help with wikipedia article protection // 2007-03-15 // GFDL // Ben Hallert // // ==UserScript== // @name       ProtectHelper // @namespace  http://hallert.net/ // @description Provide a dropdown menu of common page protection rationale on Wikipedia. Admins only. // @include    http://en.wikipedia.org/* // ==/UserScript==

if (document.getElementById('mwProtect-reason')) {	var protect_table	= document.getElementById('mwProtectSet'); var par		= document.getElementById('mwProtect-reason'); var newhelper  = document.createElement('select'); newhelper.setAttribute('id','protecthelper'); newhelper.setAttribute('onChange','document.getElementById(\'mwProtect-reason\').value = document.getElementById(\'protecthelper\').value;'); newhelper.innerHTML = "Select a protect reason " + "Salting a page " + "Full protection " + "Move protection " + "Cascading protection " + "Semi protection " + "--- " + "Unprotecting ";

if(protect_table) {		var firsttbody = protect_table.getElementsByTagName('tbody')[0]; if(firsttbody) {                               var firstrow    = firsttbody.getElementsByTagName('tr')[0]; if(firstrow) {                                       var newcell     = firstrow.insertCell(0); newcell.setAttribute('rowspan','1'); newcell.setAttribute('colspan','3'); newcell.appendChild(newhelper); newhelper.setAttribute('size','8'); }                       }

}

} void 0