Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Language Filter

by ambrus (Abbot)
on Mar 17, 2010 at 10:59 UTC ( [id://829137]=note: print w/replies, xml ) Need Help??


in reply to Language Filter

Try adding the following code to your Free Nodelet Settings, and enable your Free Nodelet in Nodelet Settings. Then you'll have a link in your Free Nodelet that filters language on the current page when you clikc on it.

One could also set this to run after every page load, but note that this may break things, because it filters text inside script or style tags too.

<p> <script type="text/javascript" defer><!-- function langfilter() { function r(x) { if(Node.TEXT_NODE == x.nodeType){ var s=x.nodeValue; v +ar n=s.replace(/\b(f)u(?:c)k/ig, function(c0,c1){return c1+"---"}); i +f(s!=n){ x.nodeValue=n; } }; var t; if(t=x.firstChild)r(t); if(t=x.ne +xtSibling)r(t); }; r(document.documentElement) }; //--></script> <a href="javascript:langfilter()">Watch your tongue!</a>

Below is some dirty words so that you can easily test that this feature works.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://829137]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-19 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found