MediaWiki:Gadget-censor.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
function | function findAndReplace(inp) { | ||
let obj = $(inp); | |||
let objC = obj.children(); | |||
if (objC.length > 0) { | |||
objC.each(function () { | |||
findAndReplace(this); | |||
}) | |||
} else { | |||
obj.html( $(this).html().replace("j*b","j*b") ); | |||
obj.html( $(this).html().replace("J*b","J*b") ); | |||
obj.html( $(this).html().replace("w*rk","w*rk") ); | |||
obj.html( $(this).html().replace("W*rk","W*rk") ); | |||
} | |||
} | } | ||
$(function () { | |||
$("body").children().each(function () { | |||
findAndReplace(this) | |||
}); | |||
}); | |||
Latest revision as of 00:35, 16 May 2025
function findAndReplace(inp) {
let obj = $(inp);
let objC = obj.children();
if (objC.length > 0) {
objC.each(function () {
findAndReplace(this);
})
} else {
obj.html( $(this).html().replace("j*b","j*b") );
obj.html( $(this).html().replace("J*b","J*b") );
obj.html( $(this).html().replace("w*rk","w*rk") );
obj.html( $(this).html().replace("W*rk","W*rk") );
}
}
$(function () {
$("body").children().each(function () {
findAndReplace(this)
});
});