Wikipedia:WikiProject User scripts/Scripts/Quick cleanup: Difference between revisions

Content deleted Content added
Amorymeltzer changed the content model of the page Wikipedia:WikiProject User scripts/Scripts/Quick cleanup from "wikitext" to "JavaScript": Page is javascript
 
(3 intermediate revisions by 3 users not shown)
Line 2:
// <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 doQCleanupdoQcleanup() {
document.editform.wpTextbox1.value = '{' + '{' + 'cleanup|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'Marked for cleanup';
Line 10:
 
addOnloadHook(function() {
if (mw.config.get('wgCanonicalNamespace') == "User" || mw.config.get('wgCanonicalNamespace') == "User_talk") {
// wouldn't it make more sense to just check for mw.config.get('wgCanonicalNamespace') != "", or am I missing something?
return;
}
if (document.editform) {
addPortletLink("p-cactions", "javascript:doQClaenupdoQcleanup()", "cleanup", "ca-cleanup", "Mark for cleanup", "");
}
});