in reply to Node ids by node titles
Good idea, it'd be nice to have the node id easily accessible for each reply.
Put this snippet in your free nodelet - it'll add "#node_id" after the reply title (ie #581764 for this node).
<script language="javascript"><!-- function add_node_ids() { var trs = document.getElementsByTagName('tr'); var i; for ( i = 0; i < trs.length; i++ ) { if ( trs[i].className == 'reply' ){ var anch = trs[i].getElementsByTagName( 'a' ); var id = anch[0].href.match( /\d+$/ ); var txt = document.createTextNode( " #" + id ); //or for [id://nnnnnn] style, //var txt = document.createTextNode( " [id://" + id + "]" ); anch[0].parentNode.insertBefore( txt, anch[0].nextSibling +); } } } add_node_ids(); </script><!-- end add_node_ids -->
Update: Tested on Firefox 1.507 & IE 6
Update 2: Only showed ids for new replies. Fixed to show id's for all replies. Added [id://nnnnnn].
|
---|
Replies are listed 'Best First'. | |
---|---|
Free Nodelet Hack: Node IDs by node titles
by jdporter (Paladin) on May 01, 2007 at 16:25 UTC |
In Section
Perl Monks Discussion