User:Nucleosynth/tags.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:Nucleosynth/tags. |
// <pre>
// [[User:S/tags.js]]
// <nowiki>
//
// Tags script by S (formerly known as Seed 2.0) -
// uber-alpha hack
// heavily based on CleanupTab.js
// My thanks and major props go to AzaToth.
//requires:
//importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
//importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
if(typeof(autosubmit) == 'undefined') { var autosubmit = 'false'; }
if(typeof(minoredit) == 'undefined') { var minoredit = 'true'; }
if(typeof(show_cwli) == 'undefined') { var showcwli = 'false'; }
Date.monthNames = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ];
Date.prototype.getMonthName = function() { return Date.monthNames[ this.getMonth() ]; }
Date.prototype.getUTCMonthName = function() { return Date.monthNames[ this.getUTCMonth() ]; }
function doCleanup(n) {
text = document.editform.wpTextbox1.value;
date = new Date();
switch(n) {
case 'abbr':
text = '{' + '{' + 'Abbreviations|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as containing inappropriate abbreviations using [[User:S/tags|tags]]';
break;
case 'confusing':
text = '{' + '{' + 'confusing|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as confusing using [[User:S/tags|tags]]';
break;
case 'copyedit':
text = '{' + '{' + 'copyedit|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as requiring some copyediting using [[User:S/tags|tags]]';
break;
case 'context':
text = '{' + '{' + 'context|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as providing insufficient context using [[User:S/tags|tags]]';
break;
case 'cleanup':
text = '{' + '{' + 'Cleanup|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as requiring cleanup using [[User:S/tags|tags]]';
break;
case 'globalize':
text = '{' + '{' + 'Globalize|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as being in need of globalization using [[User:S/tags|tags]]';
break;
case 'resume':
text = '{' + '{' + 'Like-resume|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as possibly being in violation of [[WP:COI|conflict of interest policy]] using [[User:S/tags|tags]]';
break;
case 'orphan':
text = '{' + '{' + 'orphan|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as being orphaned using [[User:S/tags|tags]]';
break;
case 'subsections':
text = '{' + '{' + 'Subsections' + '}' + '}\n\n' + text;
summary = 'Marked article as needing subsections using [[User:S/tags|tags]]';
break;
case 'trivia':
text = '{' + '{' + 'Trivia' + '}' + '}\n\n' + text;
summary = 'Marked article as containing an inappropriate trivia section using [[User:S/tags|tags]]';
break;
case 'unreferenced':
text = '{' + '{' + 'Unreferenced|date=' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as not properly citing its sources using [[User:S/tags|tags]]';
break;
case 'wikify':
text = '{' + '{' + 'wikify|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as needing wikification using [[User:S/tags|tags]]';
break;
case 'can we link it':
window.location = "http://can-we-link-it.nickj.org/suggest-links/suggester.php?page=" + encodeURIComponent( mw.config.get('wgPageName') );
break;
}
document.editform.wpSummary.value = summary;
document.editform.wpTextbox1.value = text;
if (minoredit == true) {
document.editform.wpMinoredit.checked = true;
}
if (autosubmit == true) {
document.editform.submit();
}
}
$(function() {
if ( mw.config.get('wgCanonicalNamespace') in { "User":'', "User_talk":'' } ) {
return;
}
if ( document.editform ) {
var tabs = document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0];
addlimenu(tabs, "tags", "tags" );
mw.util.addPortletLink("tags", "javascript:doCleanup('abbr')", "abbr", "abbr", "Uses abbreviations that may be confusing or ambiguous", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('confusing')", "confusing", "confusing", "May be confusing or unclear for some readers", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('copyedit')", "copyedit", "copyedit", "Needs copy editing for grammar, style, cohesion, tone and/or spelling", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('context')", "context", "context", "Introduction requires insufficient context for those unfamiliar with the subject matter", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('cleanup')", "cleanup", "cleanup", "May require cleanup to meet quality standards", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('globalize')", "globalize", "globalize", "The examples and perspective may not reprepresent a worldwide view of the subject", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('resume')", "resume", "resume", "Biographical article or section written like a resume", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('orphan')", "orphan", "orphan", "Very few other articles that link to this one", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('subsections')", "subsections", "subsections", "This section needs subsections", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('trivia')", "trivia", "trivia", "Article contains a trivia section", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('unreferenced')", "unreferenced", "unreferenced", "Does not cite any references or sources", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('wikify')", "wikify", "wikify", "Needs wikilinks, reformatting, section layout changes, HTML changed to wikitext, and/or math markup", "");
if ( show_cwli == true ) {
mw.util.addPortletLink("tags", "javascript:doCleanup('can we link it')", "can we link it", "can we link it", "Can we link it", "");
}
}
});
// </nowiki>
// </pre>