MediaWiki:Common.js/collapse.js

/*Collapsible tables by User:HaLo2FrEeEk. Append 'class="collapsible"' to a table. :)*/ $('table.collapsible').each(function(e) { $t = $(this); $th = $t.find('th'); $th.append("[[hide]] "); }); $('.collapseLink > a').click(function(e) { e.preventDefault; collapseTable($(this)); }); collapseTable = function (e) { $t = e.closest('table');  $elems = $t.find('td').parent;  if($t.hasClass('collapsed')) {    $elems.show('fast');    $t.removeClass('collapsed');    e.html('[hide]');    } else {    $elems.hide('fast');    $t.addClass('collapsed');    e.html('[show]');    }  }