aboutsummaryrefslogtreecommitdiff
path: root/html/haddock-util.js
blob: fe471453369f0f6b92c8d94855c76866750d750d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Haddock JavaScript utilities
function toggle(button,id)
{
   var n = document.getElementById(id).style;
   if (n.display == "none")
   {
	button.src = "minus.gif";
	n.display = "block";
   }
   else
   {
	button.src = "plus.gif";
	n.display = "none";
   }
}


function quick_search()
{
    perform_search(false);
}

function full_search()
{
    perform_search(true);
}


function perform_search(full)
{
    var text = document.getElementById("searchbox").value.toLowerCase();
    var table = document.getElementById("indexlist");
    var children = table.firstChild.childNodes;
    for (var i = 0; i < children.length; i++)
    {
    	var c = children[i];
    	var s = c.firstChild.firstChild.data;
    	var show = s.toLowerCase().indexOf(text) != -1;
    
    	c.style.display = (show ? "" : "none");
    }
}