Wikipedia:WikiProject User scripts/Scripts/Quick wikify

From Wikipedia, the free encyclopedia

//

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

function doQwikify() {
  document.editform.wpTextbox1.value = '{' + '{' + 'Wikify|date=' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'Marked for wikification';
  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:doQwikify()", "wikify", "ca-wikify", "Mark for wikification", "");
  }
});

// by [[User:Raylu|raylu]]
//