docs/api-2.1/dynsections.js

changeset 390
d345541018fa
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docs/api-2.1/dynsections.js	Sat Feb 06 19:11:44 2021 +0100
     1.3 @@ -0,0 +1,97 @@
     1.4 +function toggleVisibility(linkObj)
     1.5 +{
     1.6 + var base = $(linkObj).attr('id');
     1.7 + var summary = $('#'+base+'-summary');
     1.8 + var content = $('#'+base+'-content');
     1.9 + var trigger = $('#'+base+'-trigger');
    1.10 + var src=$(trigger).attr('src');
    1.11 + if (content.is(':visible')===true) {
    1.12 +   content.hide();
    1.13 +   summary.show();
    1.14 +   $(linkObj).addClass('closed').removeClass('opened');
    1.15 +   $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
    1.16 + } else {
    1.17 +   content.show();
    1.18 +   summary.hide();
    1.19 +   $(linkObj).removeClass('closed').addClass('opened');
    1.20 +   $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
    1.21 + } 
    1.22 + return false;
    1.23 +}
    1.24 +
    1.25 +function updateStripes()
    1.26 +{
    1.27 +  $('table.directory tr').
    1.28 +       removeClass('even').filter(':visible:even').addClass('even');
    1.29 +}
    1.30 +
    1.31 +function toggleLevel(level)
    1.32 +{
    1.33 +  $('table.directory tr').each(function() {
    1.34 +    var l = this.id.split('_').length-1;
    1.35 +    var i = $('#img'+this.id.substring(3));
    1.36 +    var a = $('#arr'+this.id.substring(3));
    1.37 +    if (l<level+1) {
    1.38 +      i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
    1.39 +      a.html('&#9660;');
    1.40 +      $(this).show();
    1.41 +    } else if (l==level+1) {
    1.42 +      i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
    1.43 +      a.html('&#9658;');
    1.44 +      $(this).show();
    1.45 +    } else {
    1.46 +      $(this).hide();
    1.47 +    }
    1.48 +  });
    1.49 +  updateStripes();
    1.50 +}
    1.51 +
    1.52 +function toggleFolder(id)
    1.53 +{
    1.54 +  // the clicked row
    1.55 +  var currentRow = $('#row_'+id);
    1.56 +
    1.57 +  // all rows after the clicked row
    1.58 +  var rows = currentRow.nextAll("tr");
    1.59 +
    1.60 +  var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
    1.61 +
    1.62 +  // only match elements AFTER this one (can't hide elements before)
    1.63 +  var childRows = rows.filter(function() { return this.id.match(re); });
    1.64 +
    1.65 +  // first row is visible we are HIDING
    1.66 +  if (childRows.filter(':first').is(':visible')===true) {
    1.67 +    // replace down arrow by right arrow for current row
    1.68 +    var currentRowSpans = currentRow.find("span");
    1.69 +    currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
    1.70 +    currentRowSpans.filter(".arrow").html('&#9658;');
    1.71 +    rows.filter("[id^=row_"+id+"]").hide(); // hide all children
    1.72 +  } else { // we are SHOWING
    1.73 +    // replace right arrow by down arrow for current row
    1.74 +    var currentRowSpans = currentRow.find("span");
    1.75 +    currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
    1.76 +    currentRowSpans.filter(".arrow").html('&#9660;');
    1.77 +    // replace down arrows by right arrows for child rows
    1.78 +    var childRowsSpans = childRows.find("span");
    1.79 +    childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
    1.80 +    childRowsSpans.filter(".arrow").html('&#9658;');
    1.81 +    childRows.show(); //show all children
    1.82 +  }
    1.83 +  updateStripes();
    1.84 +}
    1.85 +
    1.86 +
    1.87 +function toggleInherit(id)
    1.88 +{
    1.89 +  var rows = $('tr.inherit.'+id);
    1.90 +  var img = $('tr.inherit_header.'+id+' img');
    1.91 +  var src = $(img).attr('src');
    1.92 +  if (rows.filter(':first').is(':visible')===true) {
    1.93 +    rows.css('display','none');
    1.94 +    $(img).attr('src',src.substring(0,src.length-8)+'closed.png');
    1.95 +  } else {
    1.96 +    rows.css('display','table-row'); // using show() causes jump in firefox
    1.97 +    $(img).attr('src',src.substring(0,src.length-10)+'open.png');
    1.98 +  }
    1.99 +}
   1.100 +

mercurial