User:S (usurped also)/archive/old cb tags test.js

// // User:Seed_2.0/tags_test.js // // // // // This is a test script that may break or even be removed at any time. Please feel free to use the non-sandbox version of Tabs, // which can be found at the URL above. Thanks. --Seed 2.0 // // // Tags script by Seed 2.0 - // uber-alpha hack -- sandbox script // heavily based on CleanupTab.js

//requires: //importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); //importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');

if(getValueOf('autosubmit') == 'undefined') { var autosubmit = 'false'; } if(getValueOf('minoredit') == 'undefined') { var minoredit = 'true'; } if(getValueOf('show_cwli') == 'undefined') { var showcwli = 'false'; }

function doCleanup(n) {

if (n == 1) { document.editform.wpTextbox1.value = '{' + '{' + 'Abbreviations|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as containing inappropriate abbreviations using tags'}

if (n == 2) { document.editform.wpTextbox1.value = '{' + '{' + 'confusing|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as confusing using tags'; }

if (n == 3) { document.editform.wpTextbox1.value = '{' + '{' + 'copyedit|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as requiring some copyediting using tags'; }

if (n == 4) { document.editform.wpTextbox1.value = '{' + '{' + 'context|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as providing insufficient context using tags'; }

if (n == 5) { document.editform.wpTextbox1.value = '{' + '{' + 'Cleanup|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as requiring cleanup using tags'; }

if (n == 6) { document.editform.wpTextbox1.value = '{' + '{' + 'Globalize|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as being in need of globalization using tags'; }

if (n == 7) { document.editform.wpTextbox1.value = '{' + '{' + 'Like-resume|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as being in violation of conflict of interest policy using tags'; }

if (n == 8) { document.editform.wpTextbox1.value = '{' + '{' + 'orphan|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as being orphaned using tags'; }

if (n == 9) { document.editform.wpTextbox1.value = '{' + '{' + 'Subsections' + '}' + '}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as needing subsections using tags'; }

if (n == 10) { document.editform.wpTextbox1.value = '{' + '{' + 'Trivia' + '}' + '}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as containing an inappropriate trivia section using tags'; }

if (n == 11) { document.editform.wpTextbox1.value = '{' + '{' + 'Unreferenced|date=' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}' + '}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as not properly citing its sources using tags'; }

if (n == 12) { document.editform.wpTextbox1.value = '{' + '{' + 'wikify|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked article as needing wikification using tags'; }

// this obviously needs to be either appended to the article or go before the stub and cat tags if (n == 13) { document.editform.wpTextbox1.value += '==References==\n \n \n ' + '\n'; document.editform.wpSummary.value = 'Added/wikified references using tags'; }

if (n == 14) { title = wgTitle.replace(/\s+/g,'_'); url = "http://can-we-link-it.nickj.org/suggest-links/suggester.php?page=" + unescape(title); window.location = url; }

if (minoredit == true) { document.editform.wpMinoredit.checked = true; }

if (autosubmit == true) { document.editform.submit; }}

$(function { if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "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(1)", "abbr", "abbr", "Add abbreviations template", "");  mw.util.addPortletLink("tags", "javascript:doCleanup(2)", "confusing", "confusing", "Add confusing template", "");  mw.util.addPortletLink("tags", "javascript:doCleanup(3)", "copyedit", "copyedit", "Add Copyedit template", "");  mw.util.addPortletLink("tags", "javascript:doCleanup(4)", "context", "context", "Add Context template", "");  mw.util.addPortletLink("tags", "javascript:doCleanup(5)", "cleanup", "cleanup", "Add cleanup template", "");  mw.util.addPortletLink("tags", "javascript:doCleanup(6)", "globalize", "globalize", "Add Globalize template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup(7)", "resume", "resume", "Add Like-resume template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup(8)", "orphan", "orphan", "Add orphan template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup(9)", "subsections", "subsections", "Add Subsections template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup(10)", "trivia", "trivia", "Add Trivia template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup(11)", "unreferenced", "unreferenced", "Add unreferenced template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup(12)", "wikify", "wikify", "Add wikify template", ""); mw.util.addPortletLink("tags", "javascript:doCleanup(13)", "refs", "refs", "Add references div", "");

if (show_cwli == true) { mw.util.addPortletLink("tags", "javascript:doCleanup(14)", "can we link it", "can we link it", "Can we link it", ""); }

} });

// //