summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-07-15 12:09:03 -0400
committerAdam Young <ayoung@redhat.com>2010-07-15 12:09:03 -0400
commit28a5ef6616a36590c3acec16a233dc587c782a8b (patch)
treea9b654fe6dde432cc72e4c385fce3e5f933649ec
parented38222d7588322da2220ec65546b0b7131ba167 (diff)
downloadfreeipa-28a5ef6616a36590c3acec16a233dc587c782a8b.tar.gz
freeipa-28a5ef6616a36590c3acec16a233dc587c782a8b.tar.xz
freeipa-28a5ef6616a36590c3acec16a233dc587c782a8b.zip
Added in navigation.js, missed that last time.
-rw-r--r--install/static/index.xhtml4
-rw-r--r--install/static/navigation.js87
2 files changed, 89 insertions, 2 deletions
diff --git a/install/static/index.xhtml b/install/static/index.xhtml
index a8ef75056..0942370d3 100644
--- a/install/static/index.xhtml
+++ b/install/static/index.xhtml
@@ -43,8 +43,8 @@
</div>
<div id="navigation">
- <div id="main-nav"></div>
- <div id="sub-nav"></div>
+ <div id="main-nav" />
+ <div id="sub-nav">Edit: </div>
</div>
diff --git a/install/static/navigation.js b/install/static/navigation.js
new file mode 100644
index 000000000..380d63d51
--- /dev/null
+++ b/install/static/navigation.js
@@ -0,0 +1,87 @@
+
+
+
+
+
+function buildNavigation(){
+ params= getPageParams();
+ var bodycontent = params["bodycontent"];
+
+ if (!bodycontent){
+ bodycontent=$.cookie("lastpage");
+ }
+ if ( !bodycontent ) {
+ bodycontent="users";
+ }
+
+
+ var siteMap = [{name:"Identity",
+ tab:"users",
+ children : [
+ {name:"Users",tab:"users"},
+ {name:"Groups",tab:"groups"},
+ {name:"Hosts",tab:"hosts"},
+ {name:"Hostgroups",tab:"hostgroups"},
+ {name:"Netgroups",tab:"netgroups"}
+
+ ]},
+ {name:"policy", tab:"policy"},
+ {name:"config", tab:"config"}];
+
+
+ var separator = $("<span class='main-separator' />");
+
+ var currentMain = siteMap[0];
+ for (var i = 0 ; i < siteMap.length; i++){
+ current = siteMap[i];
+ if (i > 0){
+ $('#main-nav').append(separator.clone());
+ }
+ var tabClass = "main-nav-off";
+ if (bodycontent == current.tab){
+ currentMain = current;
+ tabClass = "main-nav-on";
+ }
+
+
+ var span = $("<span/>", {
+ "class": tabClass,
+ });
+
+ $("<a/>",{
+ href: "index.xhtml?bodycontent="+current.tab,
+ text: current.name,
+ }).appendTo(span);
+
+
+ span.appendTo("#main-nav")
+
+ }
+
+ for (var i =0; i < currentMain.children.length; i++){
+ var currentSub = currentMain.children[i];
+
+
+ var tabClass = "sub-nav-off";
+ if (bodycontent == currentSub.tab){
+ tabClass = "sub-nav-on";
+ }
+
+ var span = $("<span/>", {
+ "class": tabClass,
+ });
+
+
+ $("<a/>",{
+ href: "index.xhtml?bodycontent="+currentSub.tab,
+ text: currentSub.name,
+ }).appendTo(span);
+
+
+ span.appendTo("#sub-nav");
+
+
+ }
+ $('#content').load(bodycontent+".inc");
+
+} \ No newline at end of file