Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Free nodelet hack: Auto-Fold threads in RAT

by LanX (Archbishop)
on Jan 31, 2015 at 19:09 UTC ( #1115200=note: print w/replies, xml ) Need Help??


in reply to Free nodelet hack: Auto-Fold threads in RAT for special browsers

NEW Feature:

always collapse "+/- Legend" away!

appName check disabled, just put your selective clients in there if you need it

(AutoFolding of RAT head and foot unfortunately to difficult ATM)

<script language="javascript"><!-- var expandState="expanded"; function toggle_threads(){ expandState = (expandState=='expanded') ? 'collapsed' : 'expanded' ; var elements = document.getElementsByTagName('ul'); var elnum; for( elnum=0; elnum<elements.length; elnum++ ){ var el = elements[elnum]; if ( el.parentNode.className.match(/nnt-depth-1/) ) el.className = expandState; if ( el.id == 'ul-legend') el.className = 'collapsed'; } } if ( document.title.match(/Recently Active Threads/) ) { document.writeln('<a href="javascript:toggle_threads()">+/- All Th +reads</a>'); // if (navigator.appName=="Obigo") toggle_threads(); // auto collapse at start } //--></script>

Cheers Rolf

PS: Je suis Charlie!

Replies are listed 'Best First'.
Re^2: Free nodelet hack: Auto-Fold threads in RAT
by LanX (Archbishop) on Feb 01, 2015 at 23:48 UTC
    more collapsing

    RAT head and foot now auto-collapsed. Headlines for manual unfolding added.

    <!-- ==================================================== COLLAPSING RAT VIEW 2.02 ==================================================== --> <style type="text/css"> <!-- p.collapsed, form.collapsed { display:none; } p.expanded, form.expanded { display:block; } --> </style> <script language="javascript"><!-- var expandState="expanded"; function toggle_threads(){ expandState = (expandState=='expanded') ? 'collapsed' : 'expanded' ; var elements = document.getElementsByTagName('ul'); var elnum; for( elnum=0; elnum<elements.length; elnum++ ){ var el = elements[elnum]; if ( el.parentNode.className.match(/nnt-depth-1/) ) el.className = expandState; if ( el.id == 'ul-legend') el.className = 'collapsed'; } } function collapse_RAT_head_n_foot() { // --- hide head var head_div = document.getElementById('nodethreads-head'); var head_p = head_div.children[0]; head_p.id = 'head-view'; head_p.className = 'collapsed'; var title_html = '<h3 onclick="toggleMenu(\'head-view\')"> +/- Vie +w </h3>'; head_div.innerHTML = title_html + head_div.innerHTML; // --- hide foot var config_form = document.forms[2]; var config_head = document.getElementsByName('nnt-config')[0]; config_form.id ='form-config'; config_form.className ='collapsed'; config_head.innerHTML = "+/- " + config_head.innerHTML; config_head.onclick = function () { toggleMenu('form-config') }; } if ( document.title.match(/Recently Active Threads/) ) { collapse_RAT_head_n_foot(); document.writeln('<a href="javascript:toggle_threads()">+/- Thread +s</a>'); // if (navigator.appName=="Obigo") toggle_threads(); } //--></script>

    update

    Todo:

  • global expand toggle: move from free nodelet to main pane
  • disable section title links , let collapse too
  • collapse top right navigation
  • shorten repeated parts in post titles per thread
  • +- toggle hard to click, click thread title instead
  • collapse nodelets
  • add icons for navigation
  • collapse posts text in full thread

    Cheers Rolf

    PS: /Je suis Charlie!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2019-07-23 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (24 votes). Check out past polls.

    Notices?