User:Skittleys/not-underpopulated.js

// My code to remove the "underpopulated" banner from categories that are NOT underpopulated! // Very loosely based on the stubtagtab2 and stubremove scripts addOnloadHook(function {      mw.util.addPortletLink('p-cactions', 'http://en.wikipedia.org/w/index.php?title=' + wgPageName + '&action=edit&not-up=1', "pop'd", 'ca-populated', 'Remove the underpopulated banner from a category.');  });

if (window.location.href.indexOf('action=edit') != -1 && window.location.href.indexOf('not-up=1') != -1) { function upremove { var contents = document.getElementById('wpTextbox1').value; //collect everything currently in article var newcontents = contents.replace(/\{\{(orphancat|popcat|populate|popstub)\}\}/gi,""); //find banner, blank it   document.getElementById('wpTextbox1').value = newcontents; //put all the contents back document.getElementById('wpSummary').value = "Removing banner from populated category."; //edit summary document.getElementById('wpDiff').click; } addOnloadHook(function{ up-remove; }); }