Jump to content

User:Btilm/aw.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>
//[[User:Btilm/Unreviewed Article Tag Remover]]

function rep() {
var encode=encodeURIComponent(mw.config.get('wgPageName'))
document.location=mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + encode + "&action=edit&aw=yes";
}
 
addOnloadHook(function() {
mw.util.addPortletLink("p-cactions", "javascript:rep()", "-uat", "ca-rep", "Remove new unreviewed article tag.", "");

if (location.href.indexOf("&action=edit&aw=yes") == -1) return;
var txt = document.editform.wpTextbox1;
  txt.value = txt.value.replace(/{{(New unreviewed article|Userspace draft).*}}\n(\n)?/gim, "");
document.editform.wpSummary.value = 'Removed new unreviewed article tag using [[User:Btilm/Unreviewed Article Tag Remover|Unreviewed Article Tag Remover]].';
document.editform.wpMinoredit.checked = false;
document.editform.submit();
});
// </nowiki>