Changeset 212 for trunk/lib/html_utility.cc
- Timestamp:
- Sep 15, 2006, 2:12:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/html_utility.cc
r211 r212 117 117 << "padding-left: 1em; margin: 0px;}\n"; 118 118 s << "#menu ul li a:hover{ color: #000; background: #ddd;}\n"; 119 s << "#menu ul li.highlight a {color: #fff; background: #777; }"; 119 120 s << "\n"; 120 121 s << "#main {\n"; … … 190 191 std::string filename="index.html"; 191 192 std::ofstream os(filename.c_str()); 192 print_header(os, dir, 0, " ", "../index.html");193 print_header(os, dir, 0, "main", "index.html"); 193 194 time_t now; 194 195 time (&now); … … 237 238 238 239 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) 240 241 { 241 242 os << "<!DOCTYPE html\n" … … 254 255 << "<body>\n" 255 256 << "<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>"; 258 262 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>"; 261 269 anchor(os, "all/total/"+path, "Total", level, 262 270 "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>"; 265 277 anchor(os, "all/code/"+path, "Code", level, 266 278 "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>"; 269 285 anchor(os, "all/comments/"+path, "Comment", level, 270 286 "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, 274 295 "View statistics of empty lines"); 275 296 os << "</li>"
Note: See TracChangeset
for help on using the changeset viewer.