Ignore:
Timestamp:
Sep 15, 2006, 2:12:48 PM (17 years ago)
Author:
Peter Johansson
Message:

fixes #93 and refs #94 fixed some bugs from last commit and tootbar is now highlighted showing where we are

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/html_utility.cc

    r211 r212  
    117117      << "padding-left: 1em; margin: 0px;}\n";
    118118    s << "#menu ul li a:hover{ color: #000; background: #ddd;}\n";
     119    s << "#menu ul li.highlight a {color: #fff; background: #777; }";
    119120    s << "\n";
    120121    s << "#main {\n";
     
    190191    std::string filename="index.html";
    191192    std::ofstream os(filename.c_str());
    192     print_header(os, dir, 0, "", "../index.html");
     193    print_header(os, dir, 0, "main", "index.html");
    193194    time_t now;
    194195    time (&now);
     
    237238
    238239  void print_header(std::ostream& os, const std::string& title, u_int level,
    239                     const std::string& line_type, const std::string& path)
     240                    const std::string& item, const std::string& path)
    240241  {
    241242    os << "<!DOCTYPE html\n"
     
    254255       << "<body>\n"
    255256       << "<div id=\"menu\">"
    256        << "<ul><li></li>"
    257        << "<li>";
     257       << "<ul><li></li>";
     258    if (item=="main")
     259      os << "<li class=\"highlight\">";
     260    else
     261      os << "<li>";
    258262    anchor(os, "index.html", "Main", level, "Main page");
    259     os << "</li>"
    260        << "<li>";
     263    os << "</li>";
     264
     265    if (item=="total")
     266      os << "<li class=\"highlight\">";
     267    else
     268      os << "<li>";
    261269    anchor(os, "all/total/"+path, "Total", level,
    262270           "View statistics of all lines");
    263     os << "</li>"
    264        << "<li>";
     271    os << "</li>";
     272
     273    if (item=="code")
     274      os << "<li class=\"highlight\">";
     275    else
     276      os << "<li>";
    265277    anchor(os, "all/code/"+path, "Code", level,
    266278           "View statistics of code lines");
    267     os << "</li>"
    268        << "<li>";
     279    os << "</li>";
     280
     281    if (item=="comments")
     282      os << "<li class=\"highlight\">";
     283    else
     284      os << "<li>";
    269285    anchor(os, "all/comments/"+path, "Comment", level,
    270286           "View statistics of comment lines");
    271     os << "</li>"
    272        << "<li>";
    273     anchor(os, "all/empty/", "Empty", level,
     287    os << "</li>";
     288
     289
     290    if (item=="empty")
     291      os << "<li class=\"highlight\">";
     292    else
     293      os << "<li>";
     294    anchor(os, "all/empty/"+path, "Empty", level,
    274295           "View statistics of empty lines");
    275296    os << "</li>"
Note: See TracChangeset for help on using the changeset viewer.