User:Chairboy/csdhelper.greasemonkey.js

Simple script to add a click-menu to the article delete screen for administrators to make it easy to leave useful speedy delete criteria. Saves time and is friendlier to the article authors who may not get meaningful information out of 'a7' or 'db-context' as the specified reason.

Image:Csdhelper-screen.JPG

To use this in Greasemonkey, just copy the code below into a file named csdhelper.user.js on your computer, then drag the file into your browser. Greasemonkey should offer to install it.

// CSD helper script

// Help with wikipedia article deletion

// 2007-04-24

// GFDL

// Ben Hallert

//

// ==UserScript==

// @name CSDHelper

// @namespace http://hallert.net/

// @description Provide a dropdown menu of CSD criteria in delete pages on Wikipedia. Admins only.

// @include http://en.wikipedia.org/*

// ==/UserScript==

if (document.getElementById('deleteconfirm'))

{

var parent_form = document.getElementById('deleteconfirm');

var par = document.getElementById('wpReason');

var newhelper = document.createElement('select');

newhelper.setAttribute('id','csdhelper');

newhelper.setAttribute('onChange','document.getElementById(\'wpReason\').value = document.getElementById(\'csdhelper\').value;');

newhelper.innerHTML = ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ ""

+ "";

if(parent_form)

{

var firsttable = parent_form.getElementsByTagName('table')[0];

if(firsttable)

{

var firsttbody = firsttable.getElementsByTagName('tbody')[0];

if(firsttbody)

{

var firstrow = firsttbody.getElementsByTagName('tr')[0];

if(firstrow)

{

var newcell = firstrow.insertCell(0);

newcell.setAttribute('rowspan','3');

newcell.appendChild(newhelper);

newhelper.setAttribute('size','24');

}

}

}

}

}

void 0