Jump to content

User:Hoverfish/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/****************************
* Expand Table all the time *
****************************/
 
function expandTable()
{
  var autoCollapse = 2;
  var collapseCaption = "hide";
  var expandCaption = "show";
 
  for ( var tableIndex = 1; tableIndex  < 100; tableIndex ++ ) {
 
    var Button = document.getElementById( "collapseButton" + tableIndex );
    var Table = document.getElementById( "collapsibleTable" + tableIndex );
 
    if ( !Table || !Button ) {
        return false;
    }
 
    var Rows = Table.rows;
 
    if ( Button.firstChild.data == expandCaption ) {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
  }
}
 
if ( wgPageName.indexOf("Talk\:")>-1 || wgPageName.indexOf("talk\:")>-1 ) {
    addOnloadHook( expandTable );
}