Jump to content

User:Btilm/remex.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.
function remex() {
var encode=encodeURIComponent(mw.config.get('wgPageName'))
document.location=mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + encode + "&action=edit&remex";
}
 
$(function() {
mw.util.addPortletLink("p-cactions", "javascript:remex()", "-ex", "ca-ex", "Remove example.com.", "");
stub()

if (location.href.indexOf('&action=edit&remex') == -1) return;
document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(/\n\* \[http:\/\/www\.example.com\/ example.com\]/gim,"");
document.editform.wpSummary.value = 'Removed example.com.';
document.editform.wpMinoredit.checked = false;
document.editform.submit();
});