From aec012b877f0395bcfe57e133d72b1d3126225a0 Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Wed, 26 Jun 2013 04:30:57 +0200 Subject: [PATCH] The HTML output now shows the number of hidden entries in tables. --- gitinspector/html/html.header | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gitinspector/html/html.header b/gitinspector/html/html.header index d9f2cfb..a591108 100644 --- a/gitinspector/html/html.header +++ b/gitinspector/html/html.header @@ -64,15 +64,16 @@ }}); $("table.git tfoot tr td:first-child").filter(function() {{ - return $(this).parent().parent().parent().find("tbody tr:hidden").length > 0; + this.hiddenCount = $(this).parent().parent().parent().find("tbody tr:hidden").length; + return this.hiddenCount > 0; }}).each(function() {{ $(this).addClass("hoverable"); - this.innerHTML = "{show_minor_authors} ∨"; + this.innerHTML = "{show_minor_authors} (" + this.hiddenCount + ") ∨"; }}).toggle(function() {{ - this.innerHTML = "{hide_minor_authors} ∧"; + this.innerHTML = "{hide_minor_authors} (" + this.hiddenCount + ") ∧"; $(this).parent().parent().parent().find("tbody tr").show().each(colorRows); }}, function() {{ - this.innerHTML = "{show_minor_authors} ∨"; + this.innerHTML = "{show_minor_authors} (" + this.hiddenCount + ") ∨"; $(this).parent().parent().parent().find("tbody tr td:last-child").filter(function() {{ return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE; }}).parent().hide(); @@ -81,15 +82,16 @@ filterTimeLine(); - if ($("div#timeline table.git tbody tr:hidden").length > 0) {{ + var hiddenTimelineCount = $("div#timeline table.git tbody tr:hidden").length; + if (hiddenTimelineCount > 0) {{ $("div#timeline table.git tbody tr:visible").each(colorRows); - $("div#timeline").prepend("
{show_minor_rows} ∨
"); + $("div#timeline").prepend("
{show_minor_rows} (" + hiddenTimelineCount + ") ∨
"); $("div#timeline div.button").toggle(function() {{ - this.innerHTML = "{hide_minor_rows} ∧"; + this.innerHTML = "{hide_minor_rows} (" + hiddenTimelineCount + ") ∧"; $("div#timeline table.git tbody tr").show().each(colorRows); }}, function() {{ - this.innerHTML = "{show_minor_rows} ∨"; + this.innerHTML = "{show_minor_rows} (" + hiddenTimelineCount + ") ∨"; filterTimeLine(); $("div#timeline table.git tbody tr:visible").each(colorRows); }});