From b044ccbd57c5147affc489b6b972b8fc4672d663 Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 29 Sep 2009 11:02:20 -0300 Subject: Adding js, README and LICENSE --- LICENSE.txt | 1 + README | 5 +++ finder_menu.info | 4 +- finder_menu.js | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 LICENSE.txt create mode 100644 README create mode 100644 finder_menu.js diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..632e489 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1 @@ +TODO: add license information. diff --git a/README b/README new file mode 100644 index 0000000..954a84b --- /dev/null +++ b/README @@ -0,0 +1,5 @@ +Finder Menu +=========== + +This module implements the Finder Dropdown menu described +at http://www.alistapart.com/articles/complexdynamiclists. diff --git a/finder_menu.info b/finder_menu.info index 25244e2..2f11110 100644 --- a/finder_menu.info +++ b/finder_menu.info @@ -1,5 +1,5 @@ ; $Id$ -name = Finder Menu. +name = Finder Menu description = Show menu with Finder style. core = 6.x -dependencies[] = +dependencies[] = menu diff --git a/finder_menu.js b/finder_menu.js new file mode 100644 index 0000000..a0cf5b1 --- /dev/null +++ b/finder_menu.js @@ -0,0 +1,118 @@ +/* + * ul2finder + * written by Christian Heilmann (http://icant.co.uk) + * turns the nested list with the ID "finder" into a dynamic list + * uses the CSS classes defined in the variables + */ +function ul2finder() +{ + // Define variables used and classes to be applied/removed + var i,uls,als,finder; + var parentClass='parent'; + var showClass='shown'; + var hideClass='hidden'; + var openClass='open'; + + // check if our finder list exists, if not, stop all activities + finder=document.getElementById('finder'); + if(!finder){return;} + + // add the class domenabled to the body + cssjs('add',document.body,'domenabled') + + // loop through all lists inside finder, position and hide them + // by applying the class hidden + uls=document.getElementById('finder').getElementsByTagName('ul'); + for(i=0;i