User:Malcolm/monobook.js

// User:Lupin/popups.js

mw.loader.load(

'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'

+ '&action=raw&ctype=text/javascript&dontcountme=s');

popupOnEditSelection=false;

// Admin tools

mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Voice of All/adminnolupin/monobook.js'

+ '&action=raw&ctype=text/javascript');

// CSD AutoReason

/*

 */

if (wgAction == 'delete') {

var csdDeleteForm = {

FillSelect:function(sel, arr){

if(arr && arr.length>0){

if(arr.length>1){

var FirstOpt = new Option("CSD Reasons", "");

// catches stupid IE error

if(FirstOpt.innerHTML != "CSD Reasons"){

FirstOpt.innerHTML = "CSD Reasons";

}

sel.appendChild(FirstOpt);

sel.options[0].style.color = "gray"

}

sel.disabled = false;

for(var i=0;i

var opt = new Option(arr[i].display, arr[i].value);

// catches stupid IE error

if(opt.innerHTML != arr[i].display){

opt.innerHTML = arr[i].display;

}

sel.appendChild(opt);

}

}else{

sel.options[0] = new Option("No Options Available", "");

// catches stupid IE error

if(sel.options[0].innerHTML != "No Options Available"){

sel.options[0].innerHTML = "No Options Available";

}

sel.disabled = true;

return false;

}

return true;

},

ValueArray:[

{"value":"CSD G1: Patent nonsense","display":"G1 - Nonsense"},

{"value":"CSD G2: Test page Pages","display":"G2 - Test"},

{"value":"CSD G3: Pure vandalism","display":"G3 - Vandalism"},

{"value":"CSD G4: Recreation of deleted material","display":"G4 - Recreated deleted"},

{"value":"CSD G5: Created by Banned user","display":"G5 - Banned user"},

{"value":"CSD G6: Housekeeping","display":"G6 - Housekeeping"},

{"value":"CSD G7: Only one editor has made substantial edits to this page and he or she has requested its deletion or blanked the page","display":"G7 - Author Request"},

{"value":"CSD G8: Talk page of non-existent or deleted article","display":"G8 - Talk page"},

{"value":"CSD G9: Office actions","display":"G9 - Office actions"},

{"value":"CSD G10: Attack page","display":"G10 - Attack pages"},

{"value":"CSD G11: Blatant Advertising","display":"G11 - Advertising"},

{"value":"CSD G12: Blatant copyright infringement","display":"G12 - Copyright infringement"},

{"value":"CSD A1: Very short article providing little or no context","display":"A1 - No context"},

{"value":"CSD A2: Foreign language article that exists on another Wikipedia","display":"A2 - Foreign language"},

{"value":"CSD A3: No meaningful content","display":"A3 - No content"},

{"value":"CSD A5: Has been transwikied","display":"A5 - Transwikied"},

{"value":"CSD A7 (Bio): Biographical article that does not assert significance","display":"A7 - Unremarkable bio"},

{"value":"CSD A7 (Group): Article about a club or group that does not assert significance","display":"A7 - Unremarkable group"},

{"value":"CSD A7 (Band): Article about a band that does not assert significance","display":"A7 - Unremarkable band"},

{"value":"CSD A7 (Corp): Article about a company that does not assert significance","display":"A7 - Unremarkable company"},

{"value":"CSD A7 (Web): Article about a web site that does not assert significance","display":"A7 - Unremarkable web content"},

{"value":"CSD A7: Article about subject that does not assert significance.","display":"A7 - Other"},

{"value":"CSD R1: Redirect to non-existent page","display":"R1 - Bad target"},

{"value":"CSD R2: Redirect to User/User talk namespaces from mainspace","display":"R2 - Cross-namespace"},

{"value":"CSD R3: Implausible typo or misnomer","display":"R3 - Bad typo"},

{"value":"CSD I1: Redundant to another image","display":"I1 - Redundant"},

{"value":"CSD I2: Image is corrupted","display":"I2 - Corrupt/Empty"},

{"value":"CSD I3: Improper license","display":"I3 - Improper License"},

{"value":"CSD I4: No license or no source Information","display":"I4 - Lack of license"},

{"value":"CSD I5: Image is unused and not free","display":"I5 - Unused unfree"},

{"value":"CSD I6: No justification given for fair use","display":"I6 - No fair use"},

{"value":"CSD I7: Bad justification given for fair use","display":"I7 - Invalid fair use"},

{"value":"CSD I8: Image exists on the Commons","display":"I8 - On Commons"},

{"value":"CSD C1: Category is empty (and has been for four days or more)","display":"C1 - Empty"},

{"value":"CSD C2: Speedy renaming","display":"C2 - Speedy rename"},

{"value":"CSD C3: Corresponding template was deleted","display":"C3 - Template"},

{"value":"CSD U1: User requested deletion","display":"U1 - User request"},

{"value":"CSD U2: Userpage of non-existent user","display":"U2 - No user"},

{"value":"CSD U3: Userpage that is primarily a gallery of fair use images","display":"U3 - Fair use gallery"},

{"value":"CSD T1: Template that is divisive and inflammatory.","display":"T1 - Divisive"},

{"value":"CSD P2: Underpopulated","display":"P2 - Underpopulated"},

{"value":"Wikipedia is not a place for cool ideas or neologisms","display":"WP:NOT#OR"},

{"value":"Wikipedia is not a bureaucracy","display":"WP:NOT#BUREAUCRACY"},

{"value":"Wikipedia is not MySpace or any other social networking site","display":"WP:NOT#SOCIAL"},

{"value":"Wikipedia is not a game guide","display":"WP:NOT#GUIDE"},

{"value":"Wikipedia is not an indiscriminate collection of information","display":"WP:NOT#INFO"},

{"value":"Talk page of an indefinitely blocked user","display":"Blocked user"},

{"value":"AFD: Deleted after discussion at Articles for deletion","display":"AFD close"},

{"value":"Prod left uncontested for five days.","display":"Prod close"}

],

//**************************** attaching function *****************************************

// got thIS super handi function from http://www.scottandrew.com he is pretty dang smart **

//*****************************************************************************************

addEvent:function(obj, evType, fn, useCapture){

//alert(obj);

if (obj.addEventListener){

obj.addEventListener(evType, fn, useCapture);

return true;

} else if (obj.attachEvent){

var r = obj.attachEvent("on"+evType, fn);

return r;

} else {

alert("Handler could not be attached");

}

}

}

function addSelectAfter(){

var obj = document.getElementById('wpReason') || document.getElementById('wpComment');

// create select using included array

var sel = document.createElement("SELECT");

csdDeleteForm .FillSelect(sel, csdDeleteForm .ValueArray);

// name it

sel.name = "csdOptions";

sel.id = "csdOptions";

sel.style.marginLeft = "10px";

csdDeleteForm .addEvent(sel, "change", csdChangeBox, false);

// check for next sibling and insert before it or at the end

if(obj.nextSibling){

obj.parentNode.insertBefore(sel,obj.nextSibling);

}else{

obj.parentNode.appendChild(sel);

}

}

try{

// add one on load

csdDeleteForm.addEvent(window, "load", addSelectAfter, false);

}catch(err){}

}

function csdChangeBox() {

var obj = document.getElementById('wpReason') || document.getElementById('wpComment');

obj.value = document.getElementById('csdOptions').value;

}

/*

 */