Here's a javascript hack for the most excellent Free Nodelet Freed which allows you to toggle between two views of any perlmonks page. One view is the normal view, the one you see now except that it has a "Toggle Page View" link near the top. The other view hides the Pair banner, the search bar, and the nodelets panel and extends the contents to the full width of the screen. Clicking on "Toggle Page View" (surprise) toggles between the two views. In browser windows of 800x600 or less, it more than doubles the amount of content per screen. The banners and nodelets are never more than a click away - toggling happens immediately, there is no page reloading.
To install it, just turn on the Free Nodelet in Nodelet Settings, copy the code below, then go to your User Settings, paste the code in the Free Nodelet box at the bottom of the settings, and submit. Currently the default page display is content-view, if you'd prefer to default to full-view, comment out the toggle_nodelets() call on the last line of code.
update just a reminder - browsing with javascript enabled (as this hack requires) isn't always safe; also changed the script type (thanks elusion)
<script type="text/javascript">
var nodelet_state = 'block';
var lb = "\x5B";
var rb = "\x5D"
function add_toggle_link() {
var tbl = document.getElementById('titlebar-bottom');
var row = document.createElement('tr');
var cel = document.createElement('td');
var lnk = document.createElement('a');
var txt = document.createTextNode( 'Toggle Page View' );
lnk.href = "javascript:toggle_nodelets()";
lnk.appendChild(txt);
cel.appendChild(lnk);
row.appendChild(cel);
tbl.appendChild(row);
}
function toggle_nodelets(){
nodelet_state = (nodelet_state!='none') ? 'none' : 'block';
var elements = document.getElementsByTagName('table');
var elnum;
var content_width=(nodelet_state=='none') ? '100%' : '80%';
document.getElementById('monkbar').style.display=nodelet_state;
var tds = document.getElementsByTagName('td');
for(tnum=0;tnum<tds.length;tnum++){
var td = eval("tds"+lb+"tnum"+rb);
if( td.className=='main_content' ) {
td.style.width = content_width;
break;
}
}
for(elnum=0;elnum<elements.length;elnum++){
var el = eval("elements"+lb+"elnum"+rb);
if( el.className=='nodelet_container' ) {
el.style.display = nodelet_state;
break;
}
}
}
add_toggle_link();
toggle_nodelets();
</script>
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|