Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// copied from https://commons.wikimedia.org/wiki/User:King_of_Hearts/closeudel.js// closeudel.js - written by [[User:King of Hearts]], modified from// [[User:King of Hearts/closecfd.js]] by [[User:King of Hearts]], from// [[w:User:King of Hearts/closecfd.js]] by [[User:King of Hearts]], from// [[w:Wikipedia:WikiProject User scripts/Scripts/CloseAFD.js]] by [[User:Johnleemk]]// and [[w:User:Lifebaka/closedrv.js]] by [[User:Lifebaka]]functionautoudel_result(){varclose="invalid"while(close=="invalid"){varinput=prompt("Done or not done?")if(input.charAt(0)=='d'||input.charAt(0)=='D'||input.charAt(0)=='y'||input.charAt(0)=='Y')close="done"if(input.charAt(0)=='n'||input.charAt(0)=='N')close="not done"}varreason=prompt("Closing rationale?")varf=document.editform,t=f.wpTextbox1;if(t.value.search('{{udel'+'h}}')!=-1)t.value=t.value.split('{{udel'+'h}}').join('----'+'\n'+'{{'+close+'}}'+': '+reason+' ~~'+'~~'+'\n'+'{{udel'+'f}}'+'\n'+'\n'+'{{udel'+'h}}');elset.value+='----'+'\n'+'{{'+close+'}}'+': '+reason+' ~~'+'~~'+'\n'+'{{udel'+'f}}';t.value='{{udel'+'h}}'+'\n'+t.value;f.wpSummary.value+="Closing request as "+close;}functionautoudel_add_udel_tabs(){// Only add for pages with the right string somewhere in the titleif(document.title.indexOf("Editing Commons:Undeletion requests/Current requests (section)")!=-1){mw.util.addPortletLink('p-cactions','javascript:autoudel_result()',"close");}}$(autoudel_add_udel_tabs);// [[Category:User scripts]]