summaryrefslogtreecommitdiffstats
path: root/src/search.js
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2011-11-17 21:22:48 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2011-11-17 21:22:48 (GMT)
commit720d85edd0316e1cedec3402e204ce418174305d (patch)
tree0c7c3ab3d6f38e212b2cd4a4628e3c9d32d49db3 /src/search.js
parent8491e9fbd06ef8a8f1cc542a524c673d7781d4b6 (diff)
downloadDoxygen-720d85edd0316e1cedec3402e204ce418174305d.zip
Doxygen-720d85edd0316e1cedec3402e204ce418174305d.tar.gz
Doxygen-720d85edd0316e1cedec3402e204ce418174305d.tar.bz2
Release-1.7.5.1-20111117
Diffstat (limited to 'src/search.js')
-rw-r--r--src/search.js69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/search.js b/src/search.js
index 8c429a2..3ed3f90 100644
--- a/src/search.js
+++ b/src/search.js
@@ -707,3 +707,72 @@ function SearchResults(name)
return false;
}
}
+
+function setKeyActions(elem,action)
+{
+ elem.setAttribute('onkeydown',action);
+ elem.setAttribute('onkeypress',action);
+ elem.setAttribute('onkeyup',action);
+}
+
+function setClassAttr(elem,attr)
+{
+ elem.setAttribute('class',attr);
+ elem.setAttribute('className',attr);
+}
+
+function createResults()
+{
+ var results = document.getElementById("SRResults");
+ for (var e=0; e<searchData.length; e++)
+ {
+ var id = searchData[e][0];
+ var srResult = document.createElement('div');
+ srResult.setAttribute('id','SR_'+id);
+ setClassAttr(srResult,'SRResult');
+ var srEntry = document.createElement('div');
+ setClassAttr(srEntry,'SREntry');
+ var srLink = document.createElement('a');
+ srLink.setAttribute('id','Item'+e);
+ setKeyActions(srLink,'return searchResults.Nav(event,'+e+')');
+ setClassAttr(srLink,'SRSymbol');
+ srLink.innerHTML = searchData[e][1][0];
+ srEntry.appendChild(srLink);
+ if (searchData[e][1].length==2) // single result
+ {
+ srLink.setAttribute('href',searchData[e][1][1][0]);
+ if (searchData[e][1][1][1])
+ {
+ srLink.setAttribute('target','_parent');
+ }
+ var srScope = document.createElement('span');
+ setClassAttr(srScope,'SRScope');
+ srScope.innerHTML = searchData[e][1][1][2];
+ srEntry.appendChild(srScope);
+ }
+ else // multiple results
+ {
+ srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")');
+ var srChildren = document.createElement('div');
+ setClassAttr(srChildren,'SRChildren');
+ for (var c=0; c<searchData[e][1].length-1; c++)
+ {
+ var srChild = document.createElement('a');
+ srChild.setAttribute('id','Item'+e+'_c'+c);
+ setKeyActions(srChild,'return searchResults.NavChild(event,'+e+','+c+')');
+ setClassAttr(srChild,'SRScope');
+ srChild.setAttribute('href',searchData[e][1][c+1][0]);
+ if (searchData[e][1][c+1][1])
+ {
+ srChild.setAttribute('target','_parent');
+ }
+ srChild.innerHTML = searchData[e][1][c+1][2];
+ srChildren.appendChild(srChild);
+ }
+ srEntry.appendChild(srChildren);
+ }
+ srResult.appendChild(srEntry);
+ results.appendChild(srResult);
+ }
+}
+