Jump to content

User:Higor Douglas/monobook.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Created page with 'importScript('Wikipedia:WikiProject User scripts/Scripts/Replace');'
 
No edit summary
Line 1: Line 1:
/**** String replacement popup ****/
importScript('Wikipedia:WikiProject User scripts/Scripts/Replace');

function replace()
{
var s = prompt("Search regexp?");
if(s){
var r = prompt("Replace regexp?");
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "g"), r);
}
}

Revision as of 16:56, 11 February 2010

/**** String replacement popup ****/

function replace()
{
    var s = prompt("Search regexp?");
    if(s){
        var r = prompt("Replace regexp?");
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "g"), r);
    }
}