[BUG0000035: a navigation bar has been added. bisect@x9c.fr**20090503132212 It allows to jump to lines either unvisited or patially visited. The navigation bar can be disabled by using the '-no-navbar' command line switch. ] { hunk ./src/report.ml 31 +let no_navbar = ref false + hunk ./src/report.ml 53 - " Set output to html, files being written in given directory") + " Set output to html, files being written in given directory") ; + ("-no-navbar", + Arg.Set no_navbar, + " Disable the navigation bar (HTML only)") hunk ./src/report.ml 81 - ReportHTML.output verbose dir !tab_size !title data + ReportHTML.output verbose dir !tab_size !title !no_navbar data hunk ./src/reportHTML.ml 248 -let output_html verbose tab_size title in_file out_file visited = +let output_html verbose tab_size title no_navbar in_file out_file visited = hunk ./src/reportHTML.ml 262 + let navbar_script = + if no_navbar then + [] + else + [ " " ] in hunk ./src/reportHTML.ml 280 - [ "" ; - " " ; - " $(title)" ; - " " ; - " " ; - " " ; - "
File: $(in_file) (return to index)
" ; - "
" ; - "
" ; - "
" ; - " " ; - " " ; - " " ; - "
Statistics:  " ] + ([ "" ; + " " ; + " $(title)" ; + " " ] @ + navbar_script @ + [ " " ; + " " ; + "
File: $(in_file) (return to index)
" ; + "
" ; + "
" ; + "
" ; + " " ; + " " ; + " " ; + " " + nav_color + nav_elements in + navigator := nav_line :: !navigator; hunk ./src/reportHTML.ml 355 - [ "
$(line_no)| $(line)
" ] + [ "
$(line_no)| $(line)
" ] hunk ./src/reportHTML.ml 363 + let navigator_div = + if no_navbar then + [] + else + [ "
" ; + "
Statistics:  " ]) hunk ./src/reportHTML.ml 325 + let navigator = ref [] in hunk ./src/reportHTML.ml 340 - let cls = match visited, unvisited with - | false, false -> "lineNone" - | true, false -> "lineAllVisited" - | false, true -> "lineAllUnvisited" - | true, true -> "lineMixed" in + let jump = + Printf.sprintf " style=\"cursor: pointer;\" onclick=\"javascript:jump('line%06d');\" title=\"jump to line %d\"" + !line_no + !line_no in + let cls, nav_color, nav_elements = match visited, unvisited with + | false, false -> "lineNone", "gray", "" + | true, false -> "lineAllVisited", "gray", "" + | false, true -> "lineAllUnvisited", "red", jump + | true, true -> "lineMixed", "yellow", jump in + let nav_line = + Printf.sprintf "
" ] @ + (List.rev !navigator) @ + [ "
" ; + " " ] in hunk ./src/reportHTML.ml 373 - [ " " ; - "
" ; - "
Legend:
" ; - "    some code - line containing no point
" ; - "    some code - line containing only visited points
" ; - "    some code - line containing only unvisited points
" ; - "    some code - line containing both visited and unvisited points
" ; - "
" ; - "
" ; - "

$(html_footer)

" ; - " " ; - "" ] + ([ " " ; + "
" ] @ + navigator_div @ + [ "
Legend:
" ; + "    some code - line containing no point
" ; + "    some code - line containing only visited points
" ; + "    some code - line containing only unvisited points
" ; + "    some code - line containing both visited and unvisited points
" ; + "
" ; + "
" ; + "

$(html_footer)

" ; + " " ; + "" ]) hunk ./src/reportHTML.ml 396 -let output verbose dir tab_size title data = +let output verbose dir tab_size title no_navbar data = hunk ./src/reportHTML.ml 402 - let stats = output_html verbose tab_size title in_file out_file visited in + let stats = output_html verbose tab_size title no_navbar in_file out_file visited in hunk ./src/reportHTML.mli 22 -val output : (string -> unit) -> string -> int -> string -> (string, int array) Hashtbl.t -> unit -(** [output verbose dir tab_size title data] writes all the HTML files for [data] - in the directory [dir]. [verbose] is used for verbose output, [tab_size] - is the number of space character to use as a replacement for tabulations, - and [title] is the title for generated pages. *) +val output : (string -> unit) -> string -> int -> string -> bool -> (string, int array) Hashtbl.t -> unit +(** [output verbose dir tab_size title no_navbar data] writes all the HTML + files for [data] in the directory [dir]. [verbose] is used for verbose + output, [tab_size] is the number of space character to use as a replacement + for tabulations, [no_navbar] indicates whether navigation bar should be + disabled, and [title] is the title for generated pages. *) }