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.
// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxReplace()
{
    var s = prompt("Search regexp:");
    if(s){
        var r = prompt("Replace /"+s+"/ with:");
        if(!r && r !== '') return;
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "mg"), r);
    }
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
    if (document.forms.editform) {
        mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxReplace()', 'replace', 'ca-replace',
                       'Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
    }
});

// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxFooReplace()
{
    var s = "foo";
    if(s){
        var r = prompt("Replace /"+s+"/ with:");
	        if(!r && r !== '') return;
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "mg"), r);
    }
}	
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
    if (document.forms.editform) {
        mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxFooReplace()', 'foo replace', 'ca-replace',
                       'foo Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
    }
});

// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxFooianReplace()
{
    var s = "Fooian";
    if(s){
        var r = prompt("Replace /"+s+"/ with:");
	        if(!r && r !== '') return;
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "mg"), r);
    }
}	
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
    if (document.forms.editform) {
        mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxFooianReplace()', 'Fooian replace', 'ca-replace',
                       'Fooian Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
    }
});

// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxIrishReplace()
{
	    var s = "Irish";
    if(s){
        var r = prompt("Replace /"+s+"/ with:");
        if(!r && r !== '') return;
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "mg"), r);
    }
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
    if (document.forms.editform) {
        mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxIrishReplace()', 'Irish replace', 'ca-replace',
                       'Irish Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
    }
});

// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxIrelandReplace()
{
	var s = "Ireland";
    if(s){
        var r = prompt("Replace /"+s+"/ with:");
        if(!r && r !== '') return;
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "mg"), r);
    }
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
    if (document.forms.editform) {
        mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxIrelandReplace()', 'Ireland replace', 'ca-replace',
                       'Ireland Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
    }
});

function wpConvertCatsToLinks()
{
    var txt = document.editform.wpTextbox1;
    txt.value = txt.value.replace(/\[\[[Cc]ategory:/g, "[[:Category:");

}	
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
    if (document.forms.editform) {
        mw.util.addPortletLink('p-cactions', 'javascript:wpConvertCatsToLinks()', 'Cats to links', 'ca-replace',
                       'Convert Cats To Links', 'R', document.getElementById('ca-history'));
    }
});

// User:BrownHairedGirl/metadata.js - displays WikiProject assessments
// [[User:Outriggr/metadatatest.js]] <nowiki>
// importScript('User:BrownHairedGirl/metadatatest.js'); 
// assessmentMyTemplateCode = ["{{WikiProject Ireland |class= |importance= |attention= |peer-review= |old-peer-review= |image-needed= |needs-infobox= |listas= }}", "{{WPNI |class= |importance= |attention= |image-needed=yes }}", "{{WPBiography\n|small = \n|living = \n|class = \n|priority = \n|core = \n|attention = \n|past-collaboration = \n|peer-review = \n|old-peer-review = \n|needs-infobox = \n|a&e-work-group = \n|politician-work-group = \n|activepol = \n|british-royalty = \n|royalty-work-group = \n|military-work-group = \n|sports-work-group = \n|s&a-work-group = \n|musician-work-group = \n|peerage-work-group = \n|baronets-work-group = \n|filmbio-work-group = \n|non-bio = \n|removal = \n|listas =\n|needs-photo = \n}}", "{{GaelicGamesProject}}", "{{WikiProject Wales | class= }}", "{{WikiProject Scotland | class = }}", ];
// assessmentDefaultProject = "WikiProject Ireland";
// 	assessmentMarkAsMinor = true;
// </nowiki>