Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>// There are instructions on [[User:Deryck Chan/closerfd]]!// closerfd.js - written by [[User:Deryck Chan]], modelled upon// [[User:King of Hearts/closerfd.js]] by [[User:King of Hearts]]// [[Wikipedia:WikiProject User scripts/Scripts/CloseAFD.js]] by [[User:Johnleemk]]// and [[User:Lifebaka/closedrv.js]] by [[User:Lifebaka]]functionautorfd_result(){varf=document.editform,t=f.wpTextbox1;varwikitext_split=t.value.split("====");t.value="===="+wikitext_split[1]+"===="+"\n{{sub"+"st:rfdt| }} ~~"+"~~"+wikitext_split[2]+"\n{{sub"+"st:rfdb}}";f.wpSummary.value+=" closing as ";}functionautorfd_relist(){varf=document.editform,t=f.wpTextbox1;varwikitext_split=t.value.split("====");t.value="===="+wikitext_split[1]+"====\n{{sub"+"st:Rfdr|"+wikitext_split[1]+"}}\n";f.wpSummary.value+=" relisting";}functionautorfd_scrub(){varf=document.editform,t=f.wpTextbox1;varwikitext_split=t.value.split("<!-- End of RFD message. Don't edit anything above here, but feel free to edit below here. -->|content=\n");if(wikitext_split.length==2)wikitext_edited=wikitext_split[1];t.value=wikitext_edited.replace("\n<!-- Don't add anything after this line. -->\n}}","");}//This approach scrubs everything above the RfD template but preserves content (e.g. draft disambigs) below the RfD templatefunctionautorfd_result_test(){varf=document.editform,t=f.wpTextbox1;varwikitext_split=t.value.split("====");t.value="===="+wikitext_split[1]+"===="+"\n{{sub"+"st:rfd top/sandbox| }} ~~"+"~~"+wikitext_split[2]+"\n{{sub"+"st:rfd bottom/sandbox}}";f.wpSummary.value+=" closing as with new template, comments welcome on [[WT:RFD]]";}// Create portlet linksif((document.title.indexOf("Editing Wikipedia:Redirects for discussion/Log/")!=-1)&&(document.title.indexOf("(section)")!=-1)){varportletLinkResult=mw.util.addPortletLink('p-cactions','#','Close RfD','ca-rfd-result','Click here to insert RfD closure templates');// Bind click handler$(portletLinkResult).click(function(e){e.preventDefault();autorfd_result();});varportletLinkTest=mw.util.addPortletLink('p-cactions','#','Relist RfD','ca-relist','Copy discussion content first, then click here to insert RfD relisting template');// Bind click handler$(portletLinkTest).click(function(e){e.preventDefault();autorfd_relist();});}if((document.title.indexOf("Editing ")!=-1)&&(document.editform.wpSummary.value.split("Wikipedia:Redirects for discussion").length>1)){varportletLinkScrub=mw.util.addPortletLink('p-cactions','#','Scrub RfD','ca-rfd-result','Click here to remove RfD nomination templates and restore a redirect');// Bind click handler$(portletLinkScrub).click(function(e){e.preventDefault();autorfd_scrub();});}// </nowiki>