Wikipedia:WikiProject User scripts/Scripts/CleanupTab.js

This article seeks to address different aspects related to Wikipedia:WikiProject User scripts/Scripts/CleanupTab.js, with the aim of providing the reader with a holistic view of this topic. Along these lines, the importance of Wikipedia:WikiProject User scripts/Scripts/CleanupTab.js in various spheres will be analyzed, as well as its implications in today's society. Different perspectives and approaches will be explored to fully understand the relevance of Wikipedia:WikiProject User scripts/Scripts/CleanupTab.js, as well as its impact on the contemporary world. Through this article, the aim is to provide a complete overview that allows the reader to reflect and form an informed opinion about Wikipedia:WikiProject User scripts/Scripts/CleanupTab.js.
// <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.

function doCleanup() {
  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();
}

addOnloadHook(function() {
  if (mw.config.get('wgCanonicalNamespace') == "User" || mw.config.get('wgCanonicalNamespace') == "User_talk") {
     return;
  }
  if (document.editform) {
     addPortletLink("p-cactions", "javascript:doCleanup()", "cleanup", "ca-cleanup", "Mark for cleanup", "");
  }
});

// </pre>