# HG changeset patch # User Ron de Bruijn # Date 1323013531 -3600 # Node ID d314d2ec33002544315b97b60dcfbd83fef9799b # Parent 7c734edc63018031b8f2ef563d01f1428cd1e1fd Be able to obtain the name from a navItem diff -r 7c734edc6301 -r d314d2ec3300 navbar.ur --- a/navbar.ur Sat Sep 24 18:55:27 2011 -0430 +++ b/navbar.ur Sun Dec 04 16:45:31 2011 +0100 @@ -3,6 +3,8 @@ datatype navItem = NavItem of string * url +fun name (NavItem (text, url)) = text + datatype navBar m = NavBar of (list navItem) * (list navItem) (* First list is items before the active item, second list is items at and after the active one. * If the second list is non-empty its head is the active item. Parameter mode is to avoid diff -r 7c734edc6301 -r d314d2ec3300 navbar.urs --- a/navbar.urs Sat Sep 24 18:55:27 2011 -0430 +++ b/navbar.urs Sun Dec 04 16:45:31 2011 +0100 @@ -47,6 +47,9 @@ (* Pretty print the navigation menu as a piece of xml made of * a chain
  • ...
  • repeated. *) +val name : navItem -> string +(* navItems have a name, which this function returns *) + style active style last (* CSS classes to mark the active and last menu item. *)