comparison doc/html/dynsections.js @ 114:d6d9df2db3e1

Update documentation
author Adam Stark <adamstark.uk@gmail.com>
date Fri, 18 Aug 2023 10:48:26 +0200
parents bf256abf1dd4
children
comparison
equal deleted inserted replaced
113:1fb8df379f2d 114:d6d9df2db3e1
1 /*
2 @licstart The following is the entire license notice for the JavaScript code in this file.
3
4 The MIT License (MIT)
5
6 Copyright (C) 1997-2020 by Dimitri van Heesch
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
9 and associated documentation files (the "Software"), to deal in the Software without restriction,
10 including without limitation the rights to use, copy, modify, merge, publish, distribute,
11 sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in all copies or
15 substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
18 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 @licend The above is the entire license notice for the JavaScript code in this file
24 */
1 function toggleVisibility(linkObj) 25 function toggleVisibility(linkObj)
2 { 26 {
3 var base = $(linkObj).attr('id'); 27 var base = $(linkObj).attr('id');
4 var summary = $('#'+base+'-summary'); 28 var summary = $('#'+base+'-summary');
5 var content = $('#'+base+'-content'); 29 var content = $('#'+base+'-content');
13 } else { 37 } else {
14 content.show(); 38 content.show();
15 summary.hide(); 39 summary.hide();
16 $(linkObj).removeClass('closed').addClass('opened'); 40 $(linkObj).removeClass('closed').addClass('opened');
17 $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 41 $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
18 } 42 }
19 return false; 43 return false;
20 } 44 }
21 45
22 function updateStripes() 46 function updateStripes()
23 { 47 {
24 $('table.directory tr'). 48 $('table.directory tr').
25 removeClass('even').filter(':visible:even').addClass('even'); 49 removeClass('even').filter(':visible:even').addClass('even');
50 $('table.directory tr').
51 removeClass('odd').filter(':visible:odd').addClass('odd');
26 } 52 }
53
27 function toggleLevel(level) 54 function toggleLevel(level)
28 { 55 {
29 $('table.directory tr').each(function(){ 56 $('table.directory tr').each(function() {
30 var l = this.id.split('_').length-1; 57 var l = this.id.split('_').length-1;
31 var i = $('#img'+this.id.substring(3)); 58 var i = $('#img'+this.id.substring(3));
32 var a = $('#arr'+this.id.substring(3)); 59 var a = $('#arr'+this.id.substring(3));
33 if (l<level+1) { 60 if (l<level+1) {
34 i.attr('src','ftv2folderopen.png'); 61 i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
35 a.attr('src','ftv2mnode.png'); 62 a.html('&#9660;');
36 $(this).show(); 63 $(this).show();
37 } else if (l==level+1) { 64 } else if (l==level+1) {
38 i.attr('src','ftv2folderclosed.png'); 65 i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
39 a.attr('src','ftv2pnode.png'); 66 a.html('&#9658;');
40 $(this).show(); 67 $(this).show();
41 } else { 68 } else {
42 $(this).hide(); 69 $(this).hide();
43 } 70 }
44 }); 71 });
45 updateStripes(); 72 updateStripes();
46 } 73 }
47 function toggleFolder(id) 74
75 function toggleFolder(id)
48 { 76 {
49 var n = $('[id^=row_'+id+']'); 77 // the clicked row
50 var i = $('[id^=img_'+id+']'); 78 var currentRow = $('#row_'+id);
51 var a = $('[id^=arr_'+id+']'); 79
52 var c = n.slice(1); 80 // all rows after the clicked row
53 if (c.filter(':first').is(':visible')===true) { 81 var rows = currentRow.nextAll("tr");
54 i.attr('src','ftv2folderclosed.png'); 82
55 a.attr('src','ftv2pnode.png'); 83 var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
56 c.hide(); 84
57 } else { 85 // only match elements AFTER this one (can't hide elements before)
58 i.attr('src','ftv2folderopen.png'); 86 var childRows = rows.filter(function() { return this.id.match(re); });
59 a.attr('src','ftv2mnode.png'); 87
60 c.show(); 88 // first row is visible we are HIDING
89 if (childRows.filter(':first').is(':visible')===true) {
90 // replace down arrow by right arrow for current row
91 var currentRowSpans = currentRow.find("span");
92 currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
93 currentRowSpans.filter(".arrow").html('&#9658;');
94 rows.filter("[id^=row_"+id+"]").hide(); // hide all children
95 } else { // we are SHOWING
96 // replace right arrow by down arrow for current row
97 var currentRowSpans = currentRow.find("span");
98 currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
99 currentRowSpans.filter(".arrow").html('&#9660;');
100 // replace down arrows by right arrows for child rows
101 var childRowsSpans = childRows.find("span");
102 childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
103 childRowsSpans.filter(".arrow").html('&#9658;');
104 childRows.show(); //show all children
61 } 105 }
62 updateStripes(); 106 updateStripes();
63 } 107 }
108
64 109
65 function toggleInherit(id) 110 function toggleInherit(id)
66 { 111 {
67 var rows = $('tr.inherit.'+id); 112 var rows = $('tr.inherit.'+id);
68 var img = $('tr.inherit_header.'+id+' img'); 113 var img = $('tr.inherit_header.'+id+' img');
73 } else { 118 } else {
74 rows.css('display','table-row'); // using show() causes jump in firefox 119 rows.css('display','table-row'); // using show() causes jump in firefox
75 $(img).attr('src',src.substring(0,src.length-10)+'open.png'); 120 $(img).attr('src',src.substring(0,src.length-10)+'open.png');
76 } 121 }
77 } 122 }
78 123 /* @license-end */