Wikipedia:WikiProject User scripts/Scripts/Quick cleanup

This is an old revision of this page, as edited by Alex Bakharev (talk | contribs) at 08:24, 27 March 2007 (moved WikiProject User scripts/Scripts/Quick cleanup to Wikipedia:WikiProject User scripts/Scripts/Quick cleanup: wrong space). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

//

// <nowiki>If you are editing a page, click the cleanup button on your tab bar to add "{{cleanup|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}" to the top, set "Marked for cleanup" as the edit summary, mark it as a minor edit, and submit.</nowiki>

function doQcleanup() {
  document.editform.wpTextbox1.value = '{' + '{' + 'cleanup|' + '{' + '{' + '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();
}

addOnloadHook(function() {
  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
     // wouldn't it make more sense to just check for wgCanonicalNamespace != "", or am I missing something?
     return;
  }
  if (document.editform) {
     addPortletLink("p-cactions", "javascript:doQcleanup()", "cleanup", "ca-cleanup", "Mark for cleanup", "");
  }
});

// by [[User:Darkest Hour|Darkest Hour]]
//