From 4d8777519a72ab32b147e5645f11efa464d45079 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 3 Jan 2009 20:48:54 -0800 Subject: [PATCH] Add Decorator.js to do the nav javascript stuff * Decorator.css.php * Decorator.js * docs/decoratortest.html --- Decorator.css.php | 1 + Decorator.js | 74 +++++++++++++++++++++++++++++++++++++++++ docs/decoratortest.html | 23 +++++++++---- 3 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 Decorator.js diff --git a/Decorator.css.php b/Decorator.css.php index baba1f0..a611651 100644 --- a/Decorator.css.php +++ b/Decorator.css.php @@ -410,6 +410,7 @@ table .alt2 #nav ul li ul { margin: 0px; + display: none; } /* Navigation items */ diff --git a/Decorator.js b/Decorator.js new file mode 100644 index 0000000..f2f38f6 --- /dev/null +++ b/Decorator.js @@ -0,0 +1,74 @@ +/*=====================================================================* +|| ################################################################### +|| # Blue Static ISSO Framework +|| # Copyright (c)2005-2008 Blue Static +|| # +|| # This program is free software; you can redistribute it and/or modify +|| # it under the terms of the GNU General Public License as published by +|| # the Free Software Foundation; version 2 of the License. +|| # +|| # This program is distributed in the hope that it will be useful, but +|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +|| # more details. +|| # +|| # You should have received a copy of the GNU General Public License along +|| # with this program; if not, write to the Free Software Foundation, Inc., +|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +|| ################################################################### +\*=====================================================================*/ + +function nav_init(openSectionID, selectedItemID) +{ + var nav = document.getElementById("nav"); + var openSection = document.getElementById(_name(openSectionID)); + var selectedItem = document.getElementById(_name(selectedItemID)); + + // open the proper nav section + if (openSection) + { + openSection.className = "expand"; + _adjacent_ul(openSection).style.display = "block"; + } + + // bold the selected link + if (selectedItem) + selectedItem.className = "selected"; + + // register the nav sections + var sections = nav.getElementsByTagName("ul"); + sections = sections[0].childNodes; + for (var i = 0; i < sections.length; i++) + { + // grab only
  • elements that do not have an