blob: 9418ed60ed46a03dd05e129bc55037a620113b28 [file] [log] [blame]
<script language="JavaScript">
function toggleClassByID(pkg) {
var element = document.getElementById(pkg);
//var button = document.getElementById(pkg+"_button");
if( element.className && element.className.indexOf("in") > -1 ) {
element.classList.remove("in");
//button.innerHTML = "&uarr;"
}
else {
element.classList.add("in");
//button.innerHTML = "&darr;"
}
}
</script>
<script language="JavaScript">
function init() {
// Declare all variables
var i, content, items;
// Get all elements with class="barcontent" and hide them
content = document.getElementsByClassName("barcontent");
for (i = 1; i < content.length; i++) {
content[i].style.display = "none";
}
content[0].style.display = "block";
// Get all elements with class="bar-item" and remove the class "active"
items = document.getElementsByClassName("bar-item");
for (i = 1; i < items.length; i++) {
items[i].className = items[i].className.replace(" active", "");
}
items[0].className += " active";
// Process all row_buttons
var coll = document.getElementsByClassName("row_button");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("row_active");
var content = this.nextElementSibling;
if (content.style.maxHeight){
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
}
}
function openBar(evt, barName) {
// Declare all variables
var i, barcontent, baritems;
// Get all elements with class="barcontent" and hide them
barcontent = document.getElementsByClassName("barcontent");
for (i = 0; i < barcontent.length; i++) {
barcontent[i].style.display = "none";
}
// Get all elements with class="bar-item" and remove the class "active"
baritems = document.getElementsByClassName("bar-item");
for (i = 0; i < baritems.length; i++) {
baritems[i].className = baritems[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the link that opened the tab
document.getElementById(barName).style.display = "block";
evt.currentTarget.className += " active";
}
</script>