From 2e93df13cf5ce6c3f35b19569ef43920ce94f526 Mon Sep 17 00:00:00 2001 From: fuzzelhjb Date: Fri, 24 May 2019 10:45:45 +0200 Subject: [PATCH] add "toggle all" to the html report (#1849) --- htmlreport/cppcheck-htmlreport | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport index 663444e1c..0d1da876d 100755 --- a/htmlreport/cppcheck-htmlreport +++ b/htmlreport/cppcheck-htmlreport @@ -100,7 +100,7 @@ div.verbose div.content { margin-top: 5px; padding-left: 5px; text-align: left; - width: 200px; + width: 300px; height: 75%; position: fixed; overflow: auto; @@ -150,7 +150,7 @@ div.verbose div.content { margin-left: 10px; padding: 0 10px 10px 10px; width: 80%; - padding-left: 200px; + padding-left: 300px; } .linenos { @@ -226,6 +226,15 @@ HTML_HEAD = """ var box = document.getElementById(id); set_class_display(id, box.checked ? '' : 'none'); } + function toggle_all(){ + var elts = document.getElementsByTagName("input"); + for (var i = 1; i < elts.length; i++) { + var el = elts[i]; + el.checked ? el.checked=false : el.checked=true; + toggle_class_visibility(el.id); + } + } + @@ -568,6 +577,7 @@ if __name__ == '__main__': output_file.write(HTML_HEAD.replace('id="menu" dir="rtl"', 'id="menu_index"', 1).replace("Defects:", "Defect summary;", 1) % (options.title, '', options.title, '', '')) output_file.write(' ') output_file.write(' ') + output_file.write('') output_file.write(''.join(stat_html)) output_file.write(' ') output_file.write('
Show#Defect ID
' + str(stats_count) + 'total
')