Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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.

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 avoiding work at the Monastery: (5)
As of 2016-08-26 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (366 votes). Check out past polls.