2 @licstart The following is the entire license notice for the
3 JavaScript code in this file.
5 Copyright (C) 1997-2017 by Dimitri van Heesch
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 @licend The above is the entire license notice
22 for the JavaScript code in this file
24 function toggleVisibility(linkObj)
26 var base = $(linkObj).attr('id');
27 var summary = $('#'+base+'-summary');
28 var content = $('#'+base+'-content');
29 var trigger = $('#'+base+'-trigger');
30 var src=$(trigger).attr('src');
31 if (content.is(':visible')===true) {
34 $(linkObj).addClass('closed').removeClass('opened');
35 $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
39 $(linkObj).removeClass('closed').addClass('opened');
40 $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
45 function updateStripes()
47 $('table.directory tr').
48 removeClass('even').filter(':visible:even').addClass('even');
51 function toggleLevel(level)
53 $('table.directory tr').each(function() {
54 var l = this.id.split('_').length-1;
55 var i = $('#img'+this.id.substring(3));
56 var a = $('#arr'+this.id.substring(3));
58 i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
61 } else if (l==level+1) {
62 i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
72 function toggleFolder(id)
75 var currentRow = $('#row_'+id);
77 // all rows after the clicked row
78 var rows = currentRow.nextAll("tr");
80 var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
82 // only match elements AFTER this one (can't hide elements before)
83 var childRows = rows.filter(function() { return this.id.match(re); });
85 // first row is visible we are HIDING
86 if (childRows.filter(':first').is(':visible')===true) {
87 // replace down arrow by right arrow for current row
88 var currentRowSpans = currentRow.find("span");
89 currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
90 currentRowSpans.filter(".arrow").html('►');
91 rows.filter("[id^=row_"+id+"]").hide(); // hide all children
92 } else { // we are SHOWING
93 // replace right arrow by down arrow for current row
94 var currentRowSpans = currentRow.find("span");
95 currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
96 currentRowSpans.filter(".arrow").html('▼');
97 // replace down arrows by right arrows for child rows
98 var childRowsSpans = childRows.find("span");
99 childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
100 childRowsSpans.filter(".arrow").html('►');
101 childRows.show(); //show all children
107 function toggleInherit(id)
109 var rows = $('tr.inherit.'+id);
110 var img = $('tr.inherit_header.'+id+' img');
111 var src = $(img).attr('src');
112 if (rows.filter(':first').is(':visible')===true) {
113 rows.css('display','none');
114 $(img).attr('src',src.substring(0,src.length-8)+'closed.png');
116 rows.css('display','table-row'); // using show() causes jump in firefox
117 $(img).attr('src',src.substring(0,src.length-10)+'open.png');
122 $(document).ready(function() {
123 $('.code,.codeRef').each(function() {
124 $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html());
125 $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true });