blob: 1e6bf07f9fb050fd34d69602a3c95b6b50e37895 [file] [log] [blame]
Anthony Barbier871448e2017-03-24 14:54:29 +00001function 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
22function updateStripes()
23{
24 $('table.directory tr').
25 removeClass('even').filter(':visible:even').addClass('even');
26}
Anthony Barbier8140e1e2017-12-14 23:48:46 +000027
Anthony Barbier871448e2017-03-24 14:54:29 +000028function toggleLevel(level)
29{
Anthony Barbier8140e1e2017-12-14 23:48:46 +000030 $('table.directory tr').each(function() {
Anthony Barbier871448e2017-03-24 14:54:29 +000031 var l = this.id.split('_').length-1;
32 var i = $('#img'+this.id.substring(3));
33 var a = $('#arr'+this.id.substring(3));
34 if (l<level+1) {
Anthony Barbier8140e1e2017-12-14 23:48:46 +000035 i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
36 a.html('&#9660;');
Anthony Barbier871448e2017-03-24 14:54:29 +000037 $(this).show();
38 } else if (l==level+1) {
Anthony Barbier8140e1e2017-12-14 23:48:46 +000039 i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
40 a.html('&#9658;');
Anthony Barbier871448e2017-03-24 14:54:29 +000041 $(this).show();
42 } else {
43 $(this).hide();
44 }
45 });
46 updateStripes();
47}
48
49function toggleFolder(id)
50{
Anthony Barbier8140e1e2017-12-14 23:48:46 +000051 // the clicked row
Anthony Barbier871448e2017-03-24 14:54:29 +000052 var currentRow = $('#row_'+id);
53
Anthony Barbier8140e1e2017-12-14 23:48:46 +000054 // all rows after the clicked row
Anthony Barbier871448e2017-03-24 14:54:29 +000055 var rows = currentRow.nextAll("tr");
56
Anthony Barbier8140e1e2017-12-14 23:48:46 +000057 var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
Anthony Barbier871448e2017-03-24 14:54:29 +000058
Anthony Barbier8140e1e2017-12-14 23:48:46 +000059 // only match elements AFTER this one (can't hide elements before)
60 var childRows = rows.filter(function() { return this.id.match(re); });
61
62 // first row is visible we are HIDING
Anthony Barbier871448e2017-03-24 14:54:29 +000063 if (childRows.filter(':first').is(':visible')===true) {
Anthony Barbier8140e1e2017-12-14 23:48:46 +000064 // replace down arrow by right arrow for current row
65 var currentRowSpans = currentRow.find("span");
66 currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
67 currentRowSpans.filter(".arrow").html('&#9658;');
68 rows.filter("[id^=row_"+id+"]").hide(); // hide all children
69 } else { // we are SHOWING
70 // replace right arrow by down arrow for current row
71 var currentRowSpans = currentRow.find("span");
72 currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
73 currentRowSpans.filter(".arrow").html('&#9660;');
74 // replace down arrows by right arrows for child rows
75 var childRowsSpans = childRows.find("span");
76 childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
77 childRowsSpans.filter(".arrow").html('&#9658;');
Anthony Barbier871448e2017-03-24 14:54:29 +000078 childRows.show(); //show all children
79 }
80 updateStripes();
81}
82
83
84function toggleInherit(id)
85{
86 var rows = $('tr.inherit.'+id);
87 var img = $('tr.inherit_header.'+id+' img');
88 var src = $(img).attr('src');
89 if (rows.filter(':first').is(':visible')===true) {
90 rows.css('display','none');
91 $(img).attr('src',src.substring(0,src.length-8)+'closed.png');
92 } else {
93 rows.css('display','table-row'); // using show() causes jump in firefox
94 $(img).attr('src',src.substring(0,src.length-10)+'open.png');
95 }
96}
97
98
99$(document).ready(function() {
100 $('.code,.codeRef').each(function() {
101 $(this).data('powertip',$('#'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html());
102 $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true });
103 });
104});