Wikipedia:WikiProject User scripts/Scripts/CleanupTab.js
Appearance
From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by SD0001 (talk | contribs) at 14:40, 17 September 2025 (addPortletLink -> mw.util.addPortletLink). The present address (URL) is a permanent link to this version.Revision as of 14:40, 17 September 2025 by SD0001 (talk | contribs) (addPortletLink -> mw.util.addPortletLink)
// <pre> // CleanupTab.js // // This script adds a "cleanup" tab to the top of article pages // when in edit mode. It is disabled for the User namespace. functiondoCleanup(){ document.editform.wpTextbox1.value='{'+'{'+'Cleanup|date='+'{'+'{'+'subst:CURRENTMONTHNAME}} '+'{'+'{'+'subst:CURRENTYEAR}}}}\n\n'+document.editform.wpTextbox1.value; document.editform.wpSummary.value='Marked for cleanup.'; document.editform.wpMinoredit.checked=true; document.editform.submit(); } $.when($.ready,mw.loader.using('mediawiki.util')).then(function(){ if(mw.config.get('wgCanonicalNamespace')=="User"||mw.config.get('wgCanonicalNamespace')=="User_talk"){ return; } if(document.editform){ mw.util.addPortletLink("p-cactions","javascript:doCleanup()","cleanup","ca-cleanup","Mark for cleanup",""); } }); // </pre>