|
shun-iwasawa |
82a8f5 |
/*
|
|
shun-iwasawa |
82a8f5 |
@licstart The following is the entire license notice for the JavaScript code in this file.
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
The MIT License (MIT)
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
Copyright (C) 1997-2020 by Dimitri van Heesch
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
shun-iwasawa |
82a8f5 |
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
shun-iwasawa |
82a8f5 |
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
shun-iwasawa |
82a8f5 |
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
shun-iwasawa |
82a8f5 |
furnished to do so, subject to the following conditions:
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
The above copyright notice and this permission notice shall be included in all copies or
|
|
shun-iwasawa |
82a8f5 |
substantial portions of the Software.
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
shun-iwasawa |
82a8f5 |
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
shun-iwasawa |
82a8f5 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
shun-iwasawa |
82a8f5 |
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
shun-iwasawa |
82a8f5 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
@licend The above is the entire license notice for the JavaScript code in this file
|
|
shun-iwasawa |
82a8f5 |
*/
|
|
shun-iwasawa |
82a8f5 |
function toggleVisibility(linkObj)
|
|
shun-iwasawa |
82a8f5 |
{
|
|
shun-iwasawa |
82a8f5 |
var base = $(linkObj).attr('id');
|
|
shun-iwasawa |
82a8f5 |
var summary = $('#'+base+'-summary');
|
|
shun-iwasawa |
82a8f5 |
var content = $('#'+base+'-content');
|
|
shun-iwasawa |
82a8f5 |
var trigger = $('#'+base+'-trigger');
|
|
shun-iwasawa |
82a8f5 |
var src=$(trigger).attr('src');
|
|
shun-iwasawa |
82a8f5 |
if (content.is(':visible')===true) {
|
|
shun-iwasawa |
82a8f5 |
content.hide();
|
|
shun-iwasawa |
82a8f5 |
summary.show();
|
|
shun-iwasawa |
82a8f5 |
$(linkObj).addClass('closed').removeClass('opened');
|
|
shun-iwasawa |
82a8f5 |
$(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
|
|
shun-iwasawa |
82a8f5 |
} else {
|
|
shun-iwasawa |
82a8f5 |
content.show();
|
|
shun-iwasawa |
82a8f5 |
summary.hide();
|
|
shun-iwasawa |
82a8f5 |
$(linkObj).removeClass('closed').addClass('opened');
|
|
shun-iwasawa |
82a8f5 |
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
return false;
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
function updateStripes()
|
|
shun-iwasawa |
82a8f5 |
{
|
|
shun-iwasawa |
82a8f5 |
$('table.directory tr').
|
|
shun-iwasawa |
82a8f5 |
removeClass('even').filter(':visible:even').addClass('even');
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
function toggleLevel(level)
|
|
shun-iwasawa |
82a8f5 |
{
|
|
shun-iwasawa |
82a8f5 |
$('table.directory tr').each(function() {
|
|
shun-iwasawa |
82a8f5 |
var l = this.id.split('_').length-1;
|
|
shun-iwasawa |
82a8f5 |
var i = $('#img'+this.id.substring(3));
|
|
shun-iwasawa |
82a8f5 |
var a = $('#arr'+this.id.substring(3));
|
|
shun-iwasawa |
82a8f5 |
if (l
|
|
shun-iwasawa |
82a8f5 |
i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
|
|
shun-iwasawa |
82a8f5 |
a.html('▼');
|
|
shun-iwasawa |
82a8f5 |
$(this).show();
|
|
shun-iwasawa |
82a8f5 |
} else if (l==level+1) {
|
|
shun-iwasawa |
82a8f5 |
i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
|
|
shun-iwasawa |
82a8f5 |
a.html('►');
|
|
shun-iwasawa |
82a8f5 |
$(this).show();
|
|
shun-iwasawa |
82a8f5 |
} else {
|
|
shun-iwasawa |
82a8f5 |
$(this).hide();
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
});
|
|
shun-iwasawa |
82a8f5 |
updateStripes();
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
function toggleFolder(id)
|
|
shun-iwasawa |
82a8f5 |
{
|
|
shun-iwasawa |
82a8f5 |
// the clicked row
|
|
shun-iwasawa |
82a8f5 |
var currentRow = $('#row_'+id);
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
// all rows after the clicked row
|
|
shun-iwasawa |
82a8f5 |
var rows = currentRow.nextAll("tr");
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
// only match elements AFTER this one (can't hide elements before)
|
|
shun-iwasawa |
82a8f5 |
var childRows = rows.filter(function() { return this.id.match(re); });
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
// first row is visible we are HIDING
|
|
shun-iwasawa |
82a8f5 |
if (childRows.filter(':first').is(':visible')===true) {
|
|
shun-iwasawa |
82a8f5 |
// replace down arrow by right arrow for current row
|
|
shun-iwasawa |
82a8f5 |
var currentRowSpans = currentRow.find("span");
|
|
shun-iwasawa |
82a8f5 |
currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
|
|
shun-iwasawa |
82a8f5 |
currentRowSpans.filter(".arrow").html('►');
|
|
shun-iwasawa |
82a8f5 |
rows.filter("[id^=row_"+id+"]").hide(); // hide all children
|
|
shun-iwasawa |
82a8f5 |
} else { // we are SHOWING
|
|
shun-iwasawa |
82a8f5 |
// replace right arrow by down arrow for current row
|
|
shun-iwasawa |
82a8f5 |
var currentRowSpans = currentRow.find("span");
|
|
shun-iwasawa |
82a8f5 |
currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
|
|
shun-iwasawa |
82a8f5 |
currentRowSpans.filter(".arrow").html('▼');
|
|
shun-iwasawa |
82a8f5 |
// replace down arrows by right arrows for child rows
|
|
shun-iwasawa |
82a8f5 |
var childRowsSpans = childRows.find("span");
|
|
shun-iwasawa |
82a8f5 |
childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
|
|
shun-iwasawa |
82a8f5 |
childRowsSpans.filter(".arrow").html('►');
|
|
shun-iwasawa |
82a8f5 |
childRows.show(); //show all children
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
updateStripes();
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
function toggleInherit(id)
|
|
shun-iwasawa |
82a8f5 |
{
|
|
shun-iwasawa |
82a8f5 |
var rows = $('tr.inherit.'+id);
|
|
shun-iwasawa |
82a8f5 |
var img = $('tr.inherit_header.'+id+' img');
|
|
shun-iwasawa |
82a8f5 |
var src = $(img).attr('src');
|
|
shun-iwasawa |
82a8f5 |
if (rows.filter(':first').is(':visible')===true) {
|
|
shun-iwasawa |
82a8f5 |
rows.css('display','none');
|
|
shun-iwasawa |
82a8f5 |
$(img).attr('src',src.substring(0,src.length-8)+'closed.png');
|
|
shun-iwasawa |
82a8f5 |
} else {
|
|
shun-iwasawa |
82a8f5 |
rows.css('display','table-row'); // using show() causes jump in firefox
|
|
shun-iwasawa |
82a8f5 |
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
/* @license-end */
|