User:King of Hearts/closemfd.js

// closemfd.js - written by User:King of Hearts, modified from // WikiProject User scripts/Scripts/CloseAFD.js by User:Johnleemk // and User:Lifebaka/closedrv.js by User:Lifebaka

function automfd_result {	var close = prompt("Result of debate?") var f = document.editform, t = f.wpTextbox1;

t.value = "" + close + "." + "\n" + "\n" + t.value; if (t.value.length > 0) {		t.value += '\n'; }	t.value += ""; f.wpSummary.value += "Closing debate; result was " + close; }

function automfd_add_mfd_tabs {	// Only add for pages with the right string somewhere in the title if ((document.title.indexOf("Editing Wikipedia:Miscellany for deletion/") != -1) && (document.title.indexOf("(section)") != -1)) {		mw.util.addPortletLink('p-cactions', 'javascript:automfd_result', "close"); } } addOnloadHook(automfd_add_mfd_tabs);