User:Retired username/monobook.js

function addDeleteLink { var targetSpan = document.getElementById('specialDeleteTarget'); var linkSpan = document.getElementById('specialDeleteLink'); if (targetSpan == null || linkSpan == null) return;

var targetLink = targetSpan.getElementsByTagName("A")[0]; if (targetLink == null) return;

var targetTitle = targetLink.childNodes[0].data;

var deleteHref = "http://en.wikipedia.org/w/index.php?action=delete&title=" + escape(targetTitle);

var deleteSpan = null; with (easyDom) { deleteSpan = span({ "class": "plainlinks" }, " (", a({ "href": deleteHref, "class": "external text" }, "delete"), ")"); }

linkSpan.appendChild(deleteSpan); } addOnloadHook(addDeleteLink);

document.write(' ');

// CSD AutoReason importScript('User:^demon/csd.js');

importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');

// // User:S/tags.js // // // Tags script by S (formerly known as Seed 2.0) - // uber-alpha hack // heavily based on CleanupTab.js // My thanks and major props go to AzaToth. //requires: //importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); //importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css'); if(typeof(autosubmit) == 'undefined') { var autosubmit = 'false'; } if(typeof(minoredit) == 'undefined') { var minoredit = 'true'; } if(typeof(show_cwli) == 'undefined') { var showcwli = 'false'; } Date.monthNames = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ]; Date.prototype.getMonthName = function { return Date.monthNames[ this.getMonth ]; } Date.prototype.getUTCMonthName = function { return Date.monthNames[ this.getUTCMonth ]; } function doCleanup(n) { text = document.editform.wpTextbox1.value; date = new Date; switch(n) { case 'abbr': text = '{' + '{' + 'Abbreviations|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as containing inappropriate abbreviations using tags'; break; case 'confusing': text = '{' + '{' + 'confusing|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as confusing using tags'; break; case 'copyedit': text = '{' + '{' + 'copyedit|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as requiring some copyediting using tags'; break; case 'context': text = '{' + '{' + 'context|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as providing insufficient context using tags'; break; case 'cleanup': text = '{' + '{' + 'Cleanup|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as requiring cleanup using tags'; break; case 'globalize': text = '{' + '{' + 'Globalize|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as being in need of globalization using tags'; break; case 'resume': text = '{' + '{' + 'Like-resume|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as possibly being in violation of conflict of interest policy using tags'; break; case 'orphan': text = '{' + '{' + 'orphan|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as being orphaned using tags'; break; case 'subsections': text = '{' + '{' + 'Subsections' + '}' + '}\n\n' + text; summary = 'Marked article as needing subsections using tags'; break; case 'uncategorized': text = '{' + '{' + 'uncategorized|date=' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as needed categorization using tags'; break; case 'unreferenced': text = '{' + '{' + 'Unreferenced|date=' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as not properly citing its sources using tags'; break; case 'wikify': text = '{' + '{' + 'wikify|' + date.getUTCMonthName + ' ' + date.getUTCFullYear + '}}\n\n' + text; summary = 'Marked article as needing wikification using tags'; break; case 'can we link it': window.location = "http://can-we-link-it.nickj.org/suggest-links/suggester.php?page=" + encodeURIComponent( wgPageName ); break; }	document.editform.wpSummary.value = summary; document.editform.wpTextbox1.value = text; if (minoredit == true) { document.editform.wpMinoredit.checked = true; }	if (autosubmit == true) { document.editform.submit; } } addOnloadHook(function {		if ( wgCanonicalNamespace in { "User":, "User_talk": } ) {			return;		}		if ( document.editform ) {			var tabs = document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0];			addlimenu(tabs, "tags", "tags" );			mw.util.addPortletLink("tags", "javascript:doCleanup('abbr')", "abbr", "abbr", "Add abbreviations template", "");			mw.util.addPortletLink("tags", "javascript:doCleanup('confusing')", "confusing", "confusing", "Add confusing template", "");			mw.util.addPortletLink("tags", "javascript:doCleanup('copyedit')", "copyedit", "copyedit", "Add Copyedit template", "");			mw.util.addPortletLink("tags", "javascript:doCleanup('context')", "context", "context", "Add Context template", "");			mw.util.addPortletLink("tags", "javascript:doCleanup('cleanup')", "cleanup", "cleanup", "Add cleanup template", "");			mw.util.addPortletLink("tags", "javascript:doCleanup('globalize')", "globalize", "globalize", "Add Globalize template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup('resume')", "resume", "resume", "Add Like-resume template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup('orphan')", "orphan", "orphan", "Add orphan template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup('subsections')", "subsections", "subsections", "Add Subsections template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup('uncategorized')", "uncategorized", "uncategorized", "Add uncategorized template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup('unreferenced')", "unreferenced", "unreferenced", "Add unreferenced template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup('wikify')", "wikify", "wikify", "Add wikify template", ""); if ( show_cwli == true ) { mw.util.addPortletLink("tags", "javascript:doCleanup('can we link it')", "can we link it", "can we link it", "Can we link it", ""); }		}	}); // //

show_cwli=true;

//this helps automate AfD closing by adding a 'close' tab to AfD debates //written by User:Johnleemk based on WikiProject User scripts/Scripts/test-n.js by User:Celestianpower

function autoafd_result { var close = prompt("Result of debate?") var f = document.editform, t = f.wpTextbox1; t.value = t.value.split('{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD').join('{{ns:0'); t.value = "{{subst:" + "at" + "}} " + close + ". " + "~" + "~" + "~" + "~" + '\n' + '\n' + t.value; if (t.value.length > 0) t.value += '\n'; t.value += "{{subst:" + "ab" + "}}"; f.wpSummary.value = "Closing debate; result was " + close; }

function autoafd_relist { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += "{{subst:" + "relist" + "|~" + "~" + "~" + "~}}"; f.wpSummary.value = "Relisting debate"; }

function autoafd_keep { var date = prompt("Nomination was made when?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1;

// If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; }

t.value = "{{subst:" + "oldafdfull" + "|date=" + date + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "Article survived AfD"; }

function autoafd_no_consensus { var date = prompt("Nomination was made when?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1;

// If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; }

t.value = "{{subst:" + "oldafdfull" + "|date=" + date + "|result=no consensus|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "Article survived AfD with no consensus"; }

function autoafd_redirect { var date = prompt("Nomination was made when?") var redirect = prompt("Redirect to?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1;

// If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; }

t.value = "{{subst:" + "oldafdfull" + "|date=" + date + "|result=redirect to " + redirect + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "Article redirected to " + redirect + " as per AfD"; }

function autoafd_merge { var date = prompt("Nomination was made when?") var redirect = prompt("Merge and redirect to?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1;

// If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; }

t.value = "{{subst:" + "oldafdfull" + "|date=" + date + "|result=merge and redirect to " + redirect + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "Article merged and redirected to " + redirect + " as per AfD"; }

function autoafd_other { var date = prompt("Nomination was made when?") var result = prompt("Result was?") var votepage = prompt("Vote page is? (Enter 'd' for default.)") var f = document.editform, t = f.wpTextbox1;

// If default votepage... if (votepage=="d") {       var temp = document.editform.action.split("/w/index.php?title="); var temp = temp[1].split("&action=submit"); var temp = temp[0].substring(5); var votepage = temp; }

t.value = "{{subst:" + "oldafdfull" + "|date=" + date + "|result=" + result + "|votepage=" + votepage + "}}" + '\n' + '\n' + t.value; f.wpSummary.value = "AfDed; result was " + result; }

function autoafd_add_afd_tabs { // Only add for pages with the right string somewhere in the title if (document.title.indexOf("Editing Wikipedia:Articles for deletion/") != -1) {     mw.util.addPortletLink('p-cactions', 'javascript:autoafd_result', "close"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_relist', "relist"); } if (document.title.indexOf("Editing Talk:") != -1) {     mw.util.addPortletLink('p-cactions', 'javascript:autoafd_keep', "keep"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_no_consensus', "no consensus"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_redirect', "redirect"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_merge', "merge"); mw.util.addPortletLink('p-cactions', 'javascript:autoafd_other', "other"); } }

addOnloadHook(autoafd_add_afd_tabs);

//end AfD closing script