Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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?
[Corion]: Meh. There is no nice way to have "old" CGI (3) forward compatible with "new" CGI (4) with regards to ->param() in list context, is there? I could (and have) monkeypatch CGI to have *CGI::multi_param ||= \&CGI::param;, but maybe there is ...
[Corion]: ... a better approach?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2018-06-24 18:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?