dynsections.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. function toggleVisibility(linkObj)
  2. {
  3. var base = $(linkObj).attr('id');
  4. var summary = $('#'+base+'-summary');
  5. var content = $('#'+base+'-content');
  6. var trigger = $('#'+base+'-trigger');
  7. var src=$(trigger).attr('src');
  8. if (content.is(':visible')===true) {
  9. content.hide();
  10. summary.show();
  11. $(linkObj).addClass('closed').removeClass('opened');
  12. $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
  13. } else {
  14. content.show();
  15. summary.hide();
  16. $(linkObj).removeClass('closed').addClass('opened');
  17. $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
  18. }
  19. return false;
  20. }
  21. function updateStripes()
  22. {
  23. $('table.directory tr').
  24. removeClass('even').filter(':visible:even').addClass('even');
  25. }
  26. function toggleLevel(level)
  27. {
  28. $('table.directory tr').each(function(){
  29. var l = this.id.split('_').length-1;
  30. var i = $('#img'+this.id.substring(3));
  31. var a = $('#arr'+this.id.substring(3));
  32. if (l<level+1) {
  33. i.attr('src','ftv2folderopen.png');
  34. a.attr('src','ftv2mnode.png');
  35. $(this).show();
  36. } else if (l==level+1) {
  37. i.attr('src','ftv2folderclosed.png');
  38. a.attr('src','ftv2pnode.png');
  39. $(this).show();
  40. } else {
  41. $(this).hide();
  42. }
  43. });
  44. updateStripes();
  45. }
  46. function toggleFolder(id)
  47. {
  48. var n = $('[id^=row_'+id+']');
  49. var i = $('[id^=img_'+id+']');
  50. var a = $('[id^=arr_'+id+']');
  51. var c = n.slice(1);
  52. if (c.filter(':first').is(':visible')===true) {
  53. i.attr('src','ftv2folderclosed.png');
  54. a.attr('src','ftv2pnode.png');
  55. c.hide();
  56. } else {
  57. i.attr('src','ftv2folderopen.png');
  58. a.attr('src','ftv2mnode.png');
  59. c.show();
  60. }
  61. updateStripes();
  62. }
  63. function toggleInherit(id)
  64. {
  65. var rows = $('tr.inherit.'+id);
  66. var img = $('tr.inherit_header.'+id+' img');
  67. var src = $(img).attr('src');
  68. if (rows.filter(':first').is(':visible')===true) {
  69. rows.css('display','none');
  70. $(img).attr('src',src.substring(0,src.length-8)+'closed.png');
  71. } else {
  72. rows.css('display','table-row'); // using show() causes jump in firefox
  73. $(img).attr('src',src.substring(0,src.length-10)+'open.png');
  74. }
  75. }