xref: /netbsd-src/external/mit/libcbor/dist/docs/doxygen/dynsections.js (revision 5dd36a3bc8bf2a9dec29ceb6349550414570c447)
1*5dd36a3bSchristosfunction toggleVisibility(linkObj)
2*5dd36a3bSchristos{
3*5dd36a3bSchristos var base = $(linkObj).attr('id');
4*5dd36a3bSchristos var summary = $('#'+base+'-summary');
5*5dd36a3bSchristos var content = $('#'+base+'-content');
6*5dd36a3bSchristos var trigger = $('#'+base+'-trigger');
7*5dd36a3bSchristos var src=$(trigger).attr('src');
8*5dd36a3bSchristos if (content.is(':visible')===true) {
9*5dd36a3bSchristos   content.hide();
10*5dd36a3bSchristos   summary.show();
11*5dd36a3bSchristos   $(linkObj).addClass('closed').removeClass('opened');
12*5dd36a3bSchristos   $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
13*5dd36a3bSchristos } else {
14*5dd36a3bSchristos   content.show();
15*5dd36a3bSchristos   summary.hide();
16*5dd36a3bSchristos   $(linkObj).removeClass('closed').addClass('opened');
17*5dd36a3bSchristos   $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
18*5dd36a3bSchristos }
19*5dd36a3bSchristos return false;
20*5dd36a3bSchristos}
21*5dd36a3bSchristos
22*5dd36a3bSchristosfunction updateStripes()
23*5dd36a3bSchristos{
24*5dd36a3bSchristos  $('table.directory tr').
25*5dd36a3bSchristos       removeClass('even').filter(':visible:even').addClass('even');
26*5dd36a3bSchristos}
27*5dd36a3bSchristos
28*5dd36a3bSchristosfunction toggleLevel(level)
29*5dd36a3bSchristos{
30*5dd36a3bSchristos  $('table.directory tr').each(function() {
31*5dd36a3bSchristos    var l = this.id.split('_').length-1;
32*5dd36a3bSchristos    var i = $('#img'+this.id.substring(3));
33*5dd36a3bSchristos    var a = $('#arr'+this.id.substring(3));
34*5dd36a3bSchristos    if (l<level+1) {
35*5dd36a3bSchristos      i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
36*5dd36a3bSchristos      a.html('&#9660;');
37*5dd36a3bSchristos      $(this).show();
38*5dd36a3bSchristos    } else if (l==level+1) {
39*5dd36a3bSchristos      i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
40*5dd36a3bSchristos      a.html('&#9658;');
41*5dd36a3bSchristos      $(this).show();
42*5dd36a3bSchristos    } else {
43*5dd36a3bSchristos      $(this).hide();
44*5dd36a3bSchristos    }
45*5dd36a3bSchristos  });
46*5dd36a3bSchristos  updateStripes();
47*5dd36a3bSchristos}
48*5dd36a3bSchristos
49*5dd36a3bSchristosfunction toggleFolder(id)
50*5dd36a3bSchristos{
51*5dd36a3bSchristos  // the clicked row
52*5dd36a3bSchristos  var currentRow = $('#row_'+id);
53*5dd36a3bSchristos
54*5dd36a3bSchristos  // all rows after the clicked row
55*5dd36a3bSchristos  var rows = currentRow.nextAll("tr");
56*5dd36a3bSchristos
57*5dd36a3bSchristos  var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
58*5dd36a3bSchristos
59*5dd36a3bSchristos  // only match elements AFTER this one (can't hide elements before)
60*5dd36a3bSchristos  var childRows = rows.filter(function() { return this.id.match(re); });
61*5dd36a3bSchristos
62*5dd36a3bSchristos  // first row is visible we are HIDING
63*5dd36a3bSchristos  if (childRows.filter(':first').is(':visible')===true) {
64*5dd36a3bSchristos    // replace down arrow by right arrow for current row
65*5dd36a3bSchristos    var currentRowSpans = currentRow.find("span");
66*5dd36a3bSchristos    currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
67*5dd36a3bSchristos    currentRowSpans.filter(".arrow").html('&#9658;');
68*5dd36a3bSchristos    rows.filter("[id^=row_"+id+"]").hide(); // hide all children
69*5dd36a3bSchristos  } else { // we are SHOWING
70*5dd36a3bSchristos    // replace right arrow by down arrow for current row
71*5dd36a3bSchristos    var currentRowSpans = currentRow.find("span");
72*5dd36a3bSchristos    currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
73*5dd36a3bSchristos    currentRowSpans.filter(".arrow").html('&#9660;');
74*5dd36a3bSchristos    // replace down arrows by right arrows for child rows
75*5dd36a3bSchristos    var childRowsSpans = childRows.find("span");
76*5dd36a3bSchristos    childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
77*5dd36a3bSchristos    childRowsSpans.filter(".arrow").html('&#9658;');
78*5dd36a3bSchristos    childRows.show(); //show all children
79*5dd36a3bSchristos  }
80*5dd36a3bSchristos  updateStripes();
81*5dd36a3bSchristos}
82*5dd36a3bSchristos
83*5dd36a3bSchristos
84*5dd36a3bSchristosfunction toggleInherit(id)
85*5dd36a3bSchristos{
86*5dd36a3bSchristos  var rows = $('tr.inherit.'+id);
87*5dd36a3bSchristos  var img = $('tr.inherit_header.'+id+' img');
88*5dd36a3bSchristos  var src = $(img).attr('src');
89*5dd36a3bSchristos  if (rows.filter(':first').is(':visible')===true) {
90*5dd36a3bSchristos    rows.css('display','none');
91*5dd36a3bSchristos    $(img).attr('src',src.substring(0,src.length-8)+'closed.png');
92*5dd36a3bSchristos  } else {
93*5dd36a3bSchristos    rows.css('display','table-row'); // using show() causes jump in firefox
94*5dd36a3bSchristos    $(img).attr('src',src.substring(0,src.length-10)+'open.png');
95*5dd36a3bSchristos  }
96*5dd36a3bSchristos}
97*5dd36a3bSchristos
98*5dd36a3bSchristos
99*5dd36a3bSchristos$(document).ready(function() {
100*5dd36a3bSchristos  $('.code,.codeRef').each(function() {
101*5dd36a3bSchristos    $(this).data('powertip',$('#'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html());
102*5dd36a3bSchristos    $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true });
103*5dd36a3bSchristos  });
104*5dd36a3bSchristos});
105