User:FT2/Scripts/CSD.js

/* */ /* Adapted from ^demon's scripts:  User:^demon/csd.js */

if (wgAction == 'delete') { var csdDeleteForm = { FillSelect:function(sel, arr) { if (arr && arr.length>0) { if (arr.length>1) { var FirstOpt = new Option("Common CSD Reasons", ""); // catches stupid IE error if (FirstOpt.innerHTML != "Common CSD Reasons") { FirstOpt.innerHTML = "Common CSD Reasons"; }                   sel.appendChild(FirstOpt); sel.options[0].style.color = "gray" }               sel.disabled = false; for (var i=0;i<arr.length;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":"Own subpage - delete","display":" Own subpage"}, {"value":"","display":"GENERAL CRITERIA:"}, {"value":"CSD G1: Patent nonsense, meaningless, or incomprehensible","display":" G1 - Patent nonsense"}, {"value":"CSD G2: Page was used as a 'test page'","display":" G2 - Test Pages"}, {"value":"CSD G3: Pure vandalism","display":" G3 - Pure vandalism"}, {"value":"CSD G4: Recreation of deleted material","display":" G4 - Recreation of deleted"}, {"value":"CSD G5: Work of a banned user","display":" G5 - Added by banned user"}, {"value":"CSD G6: Housekeeping and routine (non-controversial) cleanup","display":" G6 - Non-controversial cleanup, moves, redirects"}, {"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 (and sole contributor) request"}, {"value":"CSD G8: Orphaned talk page of non-existent article","display":" G8 - Orphaned talk page"}, {"value":"CSD G9: Page deleted as an Office action","display":" G9 - Office"}, {"value":"CSD G10: Page functions substantially as an attack page to disparage or denigrate its subject","display":" G10a - Attack page (disparage or denigration)"}, {"value":"CSD G10: Entirely negative unsourced biography page in violation of WP:BLP","display":" G10b - Attack page (entirely negative unsourced BLP)"}, {"value":"CSD G11: Blatant advertising","display":" G11 - Blatent advertising"}, {"value":"CSD G12: Blatant copyright infringement","display":" G12 - Blatent copyvio (all or mostly copyvio with no evidence otherwise)"}, {"value":"","display":"ARTICLES:"}, {"value":"CSD A1: Very short article providing little or no context for its statements","display":" A1 - Short description with little or no context"}, {"value":"CSD A2: Foreign language article that already exists on another language Wikipedia","display":" A2 - Foreign language article, exists on that wiki"}, {"value":"CSD A3: No meaningful, substantive content","display":" A3 - Page lacks meaningful, substantive content (just links, tags, see also, etc)"}, {"value":"CSD A5: Has been transwikied","display":" A5 - Dicdef, or transwiki AFD  now completed"}, {"value":"CSD A7: Article on a person, group, or web content, doesn't indicate the importance or significance of its subject","display":" A7 - Person/group/web content without indication of importance/significance"}, {"value":"","display":"USER PAGES:"}, {"value":"CSD U1: User request to delete pages in own userspace","display":" U1 - User request to delete pages in own userspace"}, {"value":"CSD U2: Userpage of non-existent user","display":" U2 - Userpage of non-existent user"}, {"value":"CSD U3: Userpage is primarily a gallery of non-free or fair use images","display":"  U3 - Userpage gallery of non-free or fair use images"}, {"value":"","display":"REDIRECTS:"}, {"value":"CSD R1: Redirect to non-existent page","display":" R1 - Reedirect to non-existant target"}, {"value":"CSD R2: Redirect to Talk, User, or User_talk namespaces from mainspace","display":" R2 - redirect mainspace to user,  talk or user_talk"}, {"value":"CSD R3: Redirect from implausible typo or misnomer","display":" R3 - Redirect from implausible typo/misnomer"}, {"value":"","display":"IMAGES AND MEDIA:"}, {"value":"CSD I1: Redundant - image or media is a poorer quality copy of other media already held in the same format","display":" I1 - Redundant copy of image/media (same format, lower quality)"}, {"value":"CSD I2: Image or media is corrupted","display":" I2 - Image/media is corrupt or empty"}, {"value":"CSD I3: Improper license after May 2005","display":" I3 - Improper license after May 2005"}, {"value":"CSD I4: License, source, or copyright status information still missing after 7 days of being categorized","display":" I4 - License info still missing after 7 days categorized"}, {"value":"CSD I5: Non-free image still unused after being tagged for 7 days","display":" I5 - Non-free image still unused after 7 days tagged"}, {"value":"CSD I6: Non-free image still missing rationale after being tagged for 7 days","display":" I5 - Non-free image still missing rationale after 7 days tagged"}, {"value":"CSD I7: Non-free image still with invalid rationale after being tagged for 7 days","display":" I5 - Non-free image still with invalid rationale after 7 days tagged"}, {"value":"CSD I8: Identical copy exists on Commons","display":" I8 - Identical copy on Commons"}, {"value":"CSD I9: Blatant copyright concerns - copied from source with no evidence of valid licensing","display":" I9 - Blatent copyvio (copied from source with no evidence of valid licensing)"}, {"value":"","display":"CATEGORIES:"}, {"value":"CSD C1: Category is Empty (and has been for 4 days or more)","display":" C1 - Category empty 4 days or more"}, {"value":"CSD C2: Speedy category Rename","display":" C2 - Speedy Category Rename (typo, abbreviation, caps, etc)"}, {"value":"CSD C3: Category populated by template; template has now been deleted","display":" C3 - Category populated by template; template now deleted"}, {"value":"","display":"TEMPLATES AND PORTALS:"}, {"value":"CSD T1: Template is divisive and inflammatory","display":" T1 - Template is divisive and inflammatory"}, {"value":"CSD T2: Template blatant misrepresents established policy","display":" T2 - Template blatant misrepresents established policy"}, {"value":"CSD P1: Portal on a topic that would be speedy deleted as an article","display":" P1 - Portal on a topic that would be speedy deleted as an article"}, {"value":"CSD P2: Portal underpopulated","display":" P2 - Portal underpopulated (less than 3 non-stub articles)"}, {"value":"","display":"PROD AND xFD:"}, {"value":"AFD: Deleted after discussion at Articles for Deletion","display":" AFD close"}, {"value":"TFD: Deleted after discussion at Templates for Deletion","display":" TFD close"}, {"value":"MFD: Deleted after discussion at Miscellany for Deletion","display":" MFD close"}, {"value":"Prod uncontested for five days","display":" PROD close"}, {"value":"","display":"OTHER:"}, {"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":"Talk page of an indefinitely blocked user","display":" Blocked user"} ],

//**************************** 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; }

/* */