Anonymous avatar Anonymous committed 0b22718

Converted the nav-menu and friends generation to HTML::Widgets::NavMenu
0.1.15 (soon to be 0.2.0) instead of the old Shlomif::NavMenu.

Use your own dog-food!

Comments (0)

Files changed (3)

 my $tree_contents =
 {
     'host' => "t2",
-    'value' => "Shlomi Fish",
+    'text' => "Shlomi Fish",
     'title' => "Shlomi Fish' Homepage",
-    'expand_re' => "",
     'subs' =>
     [
         {
-            'value' => "Home",
+            'text' => "Home",
             'url' => "",
         },
         {
-            'value' => "About Myself",
+            'text' => "About Myself",
             'url' => "me/",
             'subs' => 
             [
                 {
-                    'value' => "Bio",
+                    'text' => "Bio",
                     'url' => "personal.html",
                     'title' => "A Short Biography of Myself",
                 },
                 {
-                    'value' => "Contact",
+                    'text' => "Contact",
                     'url' => "me/contact-me/",
                     'title'=> "How to Contact me in Every Conceivable Way",
                 },
                 {
-                    'value' => "My Resumés",
+                    'text' => "My Resumés",
                     'url' => "me/resumes/",
                     'subs' =>
                     [
                         {
-                            'value' => "English Resumé",
+                            'text' => "English Resumé",
                             'url' => "SFresume.html",
                             'skip' => 1,
                         },
                         {
-                            'value' => "Detailed English Resumé",
+                            'text' => "Detailed English Resumé",
                             'url' => "SFresume_detailed.html",
                             'skip' => 1,
                         },
             ],               
         },
         {
-            'value' => "Work",
+            'text' => "Work",
             'url' => "work/",
             'title' => "Work-Related Pages",
             'show_always' => 1,
             'subs' => 
             [
                 {
-                    'value' => "Private Lessons",
+                    'text' => "Private Lessons",
                     'url' => "work/private-lessons/",
                     'title' => "I'm Giving Private Lessons for High School Subjects and Computing.",
                 },
             ],
         },
         {
-            'value' => "Humour", 
+            'text' => "Humour", 
             'url' => "humour/",
             'title' => "My Humorous Creations",
             'subs' => 
             [
                 {
-                    'value' => "The Enemy", 
+                    'text' => "The Enemy", 
                     'url' => "humour/TheEnemy/",
                     'title' => "The Enemy and How I Helped to Fight It",
                 },
                 {
-                    'value' => "TOWTF",
+                    'text' => "TOWTF",
                     'url' => "humour/TOWTF/",
                     'title' => "The One with the Fountainhead",
                 },
                 {
-                    'value' => "The Pope",
+                    'text' => "The Pope",
                     'url' => "humour/Pope/",
                     'title' => "The Pope Died on Sunday",
                 },
                 {
-                    'value' => "Humour Archive",
+                    'text' => "Humour Archive",
                     'title' => "Archive of Humorous Bits I came up with",
                     'url' => "humour.html",
                     'hide' => 1,
                 },
                 {
-                    'value' => "Fortune Cookies Collection",
+                    'text' => "Fortune Cookies Collection",
                     'title' => "Collection of Files for Input to the UNIX 'fortune' Program",
                     'url' => "humour/fortunes/",
                     'host' => "vipe",
             ],
         },
         {
-            'value' => "Math-Ventures",
+            'text' => "Math-Ventures",
             'url' => "MathVentures/",
             'title' => "Mathematical Riddles and their Solutions",
         },
         {
-            'value' => "Computer Art",
+            'text' => "Computer Art",
             'url' => "art/",
             'title' => "Computer art I created while explaining how.",
             'subs' =>
             [
                 {
-                    'value' => "Back to my Homepage",
+                    'text' => "Back to my Homepage",
                     'url' => "art/bk2hp/",
                     'title' => "A Back to my Homepage logo not unlike the one from the movie "Back to the Future"",
                 },
                 {
-                    'value' => "Linux Banner",
+                    'text' => "Linux Banner",
                     'url' => "art/linux_banner/",
                     'title' => "Linux - Because Software Problems should not Cost Money",
                 },
             ],
         },
         {
-            'value' => "Software",
+            'text' => "Software",
             'url' => "open-source/",
-            'expand_re' => "^open-source/",
+            'expand' => { 're' => "^open-source/", },
             'title' => "Pages related to Software (mostly Open-Source)",
             'subs' => 
             [
                 {
-                    'value' => "Freecell Solver",
+                    'text' => "Freecell Solver",
                     'url' => "open-source/projects/freecell-solver/",
                 },
                 {
-                    'value' => "MikMod for Java",
+                    'text' => "MikMod for Java",
                     'title' => "A Player for MOD Files (a type of Music Files) for the Java Environment",
                     'url' => "jmikmod/",
                 },
                 {
-                    'value' => "FCFS RWLock",
+                    'text' => "FCFS RWLock",
                     'title' => "A First-Come First-Served Readers/Writers Lock",
                     'url' => "rwlock/",
                     'host' => "vipe",
                 },
                 {
-                    'value' => "Quad-Pres",
+                    'text' => "Quad-Pres",
                     'title' => "A Tool for Creating HTML Presentations",
                     'url' => "open-source/projects/quad-pres/",
                 },
                 {
-                    'value' => "Favourite OSS",
+                    'text' => "Favourite OSS",
                     'title' => "Favourite Open-Source Software",
                     'url' => "open-source/favourite/",
                 },
                 {
-                    'value' => "Interviews",
+                    'text' => "Interviews",
                     'title' => "Interviews with Open-Source People",
                     'url' => "open-source/interviews/",
                 },
                 {
-                    'value' => "Contributions",
+                    'text' => "Contributions",
                     'title' => "Contributions to Other Projects, that I did not Start",
                     'url' => "open-source/contributions/",
                 },
                 {
-                    'value' => "Bits and Bobs",
+                    'text' => "Bits and Bobs",
                     'title' => "Various Small-Scale Open-Source Works",
                     'url' => "open-source/bits.html",
                 },
                 {
-                    'value' => "Portability Libraries",
+                    'text' => "Portability Libraries",
                     'title' => "Cross-Platform Abstraction Libraries",
                     'url' => "abstraction/",
                     'host' => "vipe",
                     'hide' => 1,
                 },
                 {
-                    'value' => "Software Tools",
+                    'text' => "Software Tools",
                     'title' => "Software Constructions and Management Tools",
                     'url' => "software-tools/",
                     'host' => "vipe",
             ],
         },
         {
-            'value' => "Lectures", 
+            'text' => "Lectures", 
             'url' => "lecture/",
-            'expand_re' => "^lecture/",
+            'expand' => { 're' => "^lecture/", },
             'title' => "Presentations I Wrote (Mostly Technical)",
             'host' => "vipe",
             'subs' => 
             [
                 {
-                    'value' => "Perl for Newbies",
+                    'text' => "Perl for Newbies",
                     'url' => "lecture/Perl/Newbies/",
                 },
                 {
-                    'value' => "Freecell Solver",
+                    'text' => "Freecell Solver",
                     'url' => "lecture/Freecell-Solver/",
                 },
                 {
-                    'value' => "Lambda Calculus",
+                    'text' => "Lambda Calculus",
                     'title' => "A presentation about a Turing-complete programming environment with only two primitives",
                     'url' => "lecture/lc/",
                 },
                 {
-                    'value' => "The Gimp",
+                    'text' => "The Gimp",
                     'title' => "A Presentation about the GNU Image Manipulation Program",
                     'url' => "lecture/Gimp/",
                 },
                 {
-                    'value' => "GNU Autotools",
+                    'text' => "GNU Autotools",
                     'url' => "lecture/Autotools/",
                 },
                 {
-                    'value' => "Web Meta Lecture",
+                    'text' => "Web Meta Lecture",
                     'title' => "A Presentation about the Web Meta Language",
                     'url' => "lecture/WebMetaLecture/",
                 },
             ],
         },
         {
-            'value' => "Essays",
+            'text' => "Essays",
             'url' => "philosophy/",
             'title' => "Various Essays and Articles about Technology and Philosophy in General",
             'subs' =>
             [
                 {
-                    'value' => "Index to Essays",
+                    'text' => "Index to Essays",
                     'url' => "philosophy/Index/",
                     'title' => "Index to Essays and Articles I wrote.",
                 },
                 {
-                    'value' => "What is Open Source?",
+                    'text' => "What is Open Source?",
                     'url' => "philosophy/foss-other-beasts/",
                     'title' => "Free Software, Open Source and Other Beasts",
                 },
                 {
-                    'value' => "Perl & Newcomers",
+                    'text' => "Perl & Newcomers",
                     'url' => "philosophy/perl-newcomers/",
                     'title' => ""Usability" of the Perl Online World for Newcomers",
                 },
                 {
-                    'value' => "Objectivism and Open Source",
+                    'text' => "Objectivism and Open Source",
                     'url' => "philosophy/obj-oss/",
                     'title' => "Objectivism and Open Source",
                 },
                 {
-                    'value' => "The Eternal Jew",
+                    'text' => "The Eternal Jew",
                     'url' => "philosophy/the-eternal-jew/",
                     'title' => "The Eternal Jew - An Essay about Philosophy",
                 },
             ],
         },
         {
-            'value' => "Opinion on DeCSS",
+            'text' => "Opinion on DeCSS",
             'url' => "DeCSS/",
             'title' => "My Opinion on the DeCSS (= DVDs' de-scrambling code) fiasco",
         },
             'skip' => 1,
         },
         {
-            'value' => "Cool Links",
+            'text' => "Cool Links",
             'url' => "links.html",
             'title' => "An incomplete list of links I find cool and/or useful.",
         },
         },
         {
             'url' => "site-source/",
-            'value' => "Site's Source",
+            'text' => "Site's Source",
             'title' => "The source code used to generate this site",
         },
     ],

t2/site-map/index.html.wml

 
 <div class="sitemap">
 <:{
-my $site_map = $nav_bar->gen_site_map();
-print $site_map;
+print (map { "$_\n" } @{$nav_bar->gen_site_map()});
 }:>
 </div>
 
 
 <:{
 use MyNavData;
-use Shlomif::NavMenu;
+use HTML::Widgets::NavMenu;
 
 my $filename = "$(FILENAME)";
 $filename =~ s!index\.html$!!;
 
 use vars qw($nav_bar);
 
-$nav_bar = Shlomif::NavMenu->new(
+$nav_bar = HTML::Widgets::NavMenu->new(
     'path_info' => $filename,
     'current_host' => "$(SERVER)",
     MyNavData::get_params(),
+    'ul_classes' => [ "navbarmain", ("navbarnested") x 10 ],
     );
 
-my $rendered_results = 
-        $nav_bar->render(
-            no_ie => 'true',
-            styles => 
-            {
-                'bar' => 'nav',
-                'level0' => 'navbarmain',
-                'level1' => 'navbarnested',
-                'level2' => "navbarnested",
-                'level3' => "navbarnested",
-                'level4' => "navbarnested",
-                'list' => "navbarmain",
-            },
-            );
+my $rendered_results = $nav_bar->render();
 
 use vars qw($nav_links);
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.