Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Language Filter

by ambrus (Abbot)
on Mar 17, 2010 at 10:59 UTC ( #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.


Comment on Re: Language Filter
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-08-29 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls