Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Free Nodelet Hack: Toggle bodies of Old Replies

by oha (Friar)
on Sep 28, 2007 at 16:50 UTC ( #641573=note: print w/ replies, xml ) Need Help??


in reply to Free Nodelet Hack: Toggle bodies of Old Replies
in thread Node parents shown while viewing a node

ty both very much!

i tried it and found the Free Nodelet Setting eat up the square brackets on js, so i patched it to work, as in Re^3: Free Nodelet freed.

here it is

<!-- the HTML: --> Hide old replies: <input name="hide_old_replies" id="hide_old_replies" type="checkbox" onClick="toggle_old_replies()" / +> <!-- the JS: --> <script language="javascript"><!-- function toggle_old_replies(){ var chk = document.getElementById('hide_old_replies'); var state = chk.checked ? 'none' : 'table-cell'; var allelems = document.all ? document.all : document.getElement +sByTagName("*"); var inc = 0; for ( i = 0; i < allelems.length; i++ ) { var elem = eval("allelems\x5Bi]"); if ( elem.className == "reply-body" ) { elem.style.display = state; } } } //--></script>

Oha


Comment on Re: Free Nodelet Hack: Toggle bodies of Old Replies
Download Code
Re^2: Free Nodelet Hack: Toggle bodies of Old Replies
by ikegami (Pope) on Sep 28, 2007 at 17:05 UTC
    Or you can use the much more readable Free Nodelet escape character (`).
    var elem = allelems`[i];
Re^2: Free Nodelet Hack: Toggle bodies of Old Replies (sqbs)
by tye (Cardinal) on Sep 28, 2007 at 17:15 UTC

    The Free Nodelet is no longer supposed to mess with square brackets that occur inside of HTML comments. I'm also pretty sure that jdporter tested that code so I'm doubly surprised that you had this problem.

    - tye        

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2014-07-10 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (213 votes), past polls