From 4e565370c901570c1e471fa526764afe4b6a55ea Mon Sep 17 00:00:00 2001 From: octo Date: Thu, 14 Apr 2005 17:39:03 +0000 Subject: [PATCH] - Fixes in the new Weekdays Plugin - Output changes to Plugins::Core and Userdetails - Changed the light-theme's CSS accordingly.. --- lib/Onis/Plugins/Core.pm | 25 +-- lib/Onis/Plugins/Userdetails.pm | 30 ++-- lib/Onis/Plugins/Weekdays.pm | 23 ++- reports/light-theme/style.css | 354 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 392 insertions(+), 40 deletions(-) create mode 100644 reports/light-theme/style.css diff --git a/lib/Onis/Plugins/Core.pm b/lib/Onis/Plugins/Core.pm index ec6dc79..da58275 100644 --- a/lib/Onis/Plugins/Core.pm +++ b/lib/Onis/Plugins/Core.pm @@ -591,14 +591,14 @@ sub activetimes my $header = translate ('When do we actually talk here?'); print $fh "

$header

\n", - qq#\n#, - qq# \n#; + qq#
\n#, + qq# \n#; # this for circles through the four colors. Each color represents six hours. # (4 * 6 hours = 24 hours) for (my $i = 0; $i <= 3; $i++) { - for (my $j = 0; $j <= 5; $j++) + for (my $j = 0; $j < 6; $j++) { my $hour = (($i * 6) + $j); if (!defined ($data[$hour])) @@ -606,19 +606,22 @@ sub activetimes $data[$hour] = 0; } - my $percent = 100 * ($data[$hour] / $total); - my $height = int ($data[$hour] * $factor) + 1; - my $img_url = $img_urls[$i]; + my $height = sprintf ("%.2f", 95 * $data[$hour] / $max); + my $img = $img_urls[$i]; - print $fh ' \n#; + print $fh qq# \n#; } } + print $fh qq# \n \n#; + for (my $i = 0; $i < 24; $i++) + { + my $percent = sprintf ("%.1f", 100 * $data[$i] / $total); + print $fh qq# \n#; + } print $fh " \n", - qq# \n#; - print $fh map { " \n" } (0 .. 23); + qq# \n#; + print $fh map { qq# \n# } (0 .. 23); print $fh " \n", "
', sprintf ("%2.1f", $percent), - qq#%
$percent\%
$_
$_
\n\n"; } diff --git a/lib/Onis/Plugins/Userdetails.pm b/lib/Onis/Plugins/Userdetails.pm index 1f846a7..66aa39e 100644 --- a/lib/Onis/Plugins/Userdetails.pm +++ b/lib/Onis/Plugins/Userdetails.pm @@ -160,9 +160,9 @@ sub output $nick_data->{$nick}{'bignumbers'} = get_bignumbers ($nick); $nick_data->{$nick}{'interestingnumbers'} = get_interestingnumbers ($nick); - for (my $i = 0; $i < 12; $i++) + for (my $i = 0; $i < 24; $i++) { - $num = $nick_data->{$nick}{'chars'}[2 * $i] + $nick_data->{$nick}{'chars'}[(2 * $i) + 1]; + $num = $nick_data->{$nick}{'chars'}[$i]; $max_time = $num if ($max_time < $num); } @@ -315,32 +315,30 @@ sub output if (defined ($ptr->{'chars'})) { - print $fh qq# \n \n#; + print $fh qq#
\n \n#; - for (my $i = 0; $i < 12; $i++) + for (my $i = 0; $i < 24; $i++) { - my $hour = 2 * $i; $num = 0; - my $img = $V_IMAGES[int ($hour / 6)]; + my $img = $V_IMAGES[int ($i / 6)]; my $height; - $num = $ptr->{'chars'}[$hour]; - $num += $ptr->{'chars'}[$hour + 1]; + $num = $ptr->{'chars'}[$i]; - $height = int (0.5 + ($time_factor * $num)) || 1; + $height = sprintf ("%.2f", 95 * $num / $max_time); - print $fh qq# \n#; + print $fh qq# \n#; } print $fh < - - - - - + + + + +
$num chars$num chars
0-56-1112-1718-23
0-56-1112-1718-23
EOF diff --git a/lib/Onis/Plugins/Weekdays.pm b/lib/Onis/Plugins/Weekdays.pm index 788c83e..dd27ad9 100644 --- a/lib/Onis/Plugins/Weekdays.pm +++ b/lib/Onis/Plugins/Weekdays.pm @@ -127,10 +127,12 @@ sub output for (@order) { my ($num, $abbr, $name) = @$_; - my $sum = $data->{$abbr}[0] + $data->{$abbr}[1] + $data->{$abbr}[2] + $data->{$abbr}[3]; - $total += $sum; - $max = $sum if ($max < $sum); + for (my $i = 0; $i < 4; $i++) + { + $max = $data->{$abbr}[$i] if ($max < $data->{$abbr}[$i]); + $total += $data->{$abbr}[$i]; + } } $bar_factor = $BarHeight / $max; @@ -139,20 +141,15 @@ sub output for (@order) { my ($num, $abbr, $name) = @$_; - print $fh qq# #; - for (my $i = 3; $i >= 0; $i--) + for (my $i = 0; $i < 4; $i++) { my $num = $data->{$abbr}[$i]; my $height = sprintf ("%.2f", (95 * $num / $max)); my $img = $VImages[$i]; - my $class = ''; - - $class = q( class="first") if ($i == 3); - $class = q( class="last") if ($i == 0); - print $fh qq(); + print $fh qq# #, + qq(\n); } - print $fh "\n"; } print $fh qq( \n \n); for (@order) @@ -160,13 +157,13 @@ sub output my ($num, $abbr, $name) = @$_; my $sum = $data->{$abbr}[0] + $data->{$abbr}[1] + $data->{$abbr}[2] + $data->{$abbr}[3]; my $pct = sprintf ("%.1f", (100 * $sum / $total)); - print $fh qq( $pct%\n); + print $fh qq( $pct%\n); } print $fh qq( \n \n); for (@order) { my ($num, $abbr, $name) = @$_; - print $fh qq( $name\n); + print $fh qq( $name\n); } print $fh " \n\n\n"; } diff --git a/reports/light-theme/style.css b/reports/light-theme/style.css new file mode 100644 index 0000000..aaf08fc --- /dev/null +++ b/reports/light-theme/style.css @@ -0,0 +1,354 @@ +a +{ + color: navy; + background-color: transparent; + text-decoration: none; + font-weight: bold; +} + +a:hover +{ + text-decoration: underline; +} + +a:visited +{ + font-weight: normal; +} + +body +{ + background-color: white; + background-image: url(stripes.png); + color: black; +} + +div.msie_hack +{ + text-align: center; +} + +em +{ + font-style: normal; + font-weight: bold; +} + +h1, h2 +{ + text-align: center; +} + +img#smalllogo +{ + border: none; + float: right; + margin: 1px; +} + +p +{ + text-align: center; +} + +span.small +{ + font-size: smaller; +} + +table +{ + margin-left: auto; + margin-right: auto; +} + +table.big_ranking img +{ + border-left: none; + border-right: none; + height: 10px; +} + +table.big_ranking td.image img, +table.userdetails td.image img +{ + width: auto; + height: auto; + width: 50px; + height: 50px; + display: block; + border: 1px solid gray; +} + +table.conversations +{ + border-collapse: collapse; +} + +table.conversations td +{ + width: 50%; +} + +table.conversations td.bar img +{ + display: inline; + height: 4px; +} + +table.conversations td.left +{ + text-align: right; +} + +table.conversations td +{ + border-top: 2px solid white; +} + +table.conversations td.right +{ + text-align: left; +} + +table.copy +{ + width: 100%; + border-top: 1px solid black; +} + +table.copy span.spam +{ + display: none; +} + +table.copy td +{ + background-color: transparent; + color: gray; + font-size: small; + width: 50%; +} + +table.copy td.right +{ + text-align: right; +} + +table.hours tr.bars +{ + height: 150px; +} + +table.hours tr.bars td.bar +{ + color: black; + background-color: transparent; + + width: 4.1666%; +} + +table.hours tr.bars td.bar img +{ + width: 15px; +} + +table.legend +{ + width: 500px; +} + +table.legend img +{ + display: inline; + width: 50px; + height: 15px; + border: 1px solid gray; +} + +table.legend td +{ + background-color: transparent; + color: black; + text-align: center; + width: 125px; +} + +table.plugin +{ + width: 500px; + margin-top: 20px; + margin-bottom: 10px; +} + +table.plugin.userdetails +{ + width: auto; + border-collapse: collapse; +} + +table.userdetails td.convpartners, +table.userdetails td.counters, +table.userdetails td.numbers +{ + vertical-align: top; +} + +table.userdetails td.convpartners table +{ + margin-right: auto; + margin-left: 0px; +} + +table.userdetails td.convpartners td.bar img +{ + height: 4px; +} + +table.userdetails table.hours tr.bars +{ + height: 75px; +} + +table.userdetails table.hours tr.bars td.bar img +{ + width: 3px; +} + +table.userdetails td.image +{ + vertical-align: top; + padding: 1ex; +} + +table.userdetails th.nick +{ + border-top: 2px solid white; + border-bottom: 2px solid white; +} + +table.weekdays td +{ + /* 14.2857 = 100/7 */ + width: 14.28%; +} + +table.weekdays tr.bars +{ + height: 100px; +} + +table.weekdays tr.bars td +{ + color: black; + background-color: transparent; + + /* 3.5714 = 100/28 */ + width: 3.57%; +} + +table.weekdays tr.bars td img +{ + width: 10px; +} + +td +{ + background-color: #f8f8f8; + color: black; + text-align: left; +} + +td.bar +{ + font-size: smaller; +} + +td.bar img +{ + border-top: 1px solid gray; + border-bottom: 1px solid gray; +} + +td.bar img.first +{ + border-left: 1px solid gray; +} + +td.bar img.last +{ + border-right: 1px solid gray; +} + +td.bar.vertical +{ + vertical-align: bottom; + padding: 0px; + border: none; +} + +td.bar.vertical img +{ + display: block; + + margin-top: 0px; + margin-right: auto; + margin-bottom: 0px; + margin-left: auto; + + border-top: none; + border-right: 1px solid gray; + border-bottom: none; + border-left: 1px solid gray; +} + +td.bar.vertical img.first +{ + border-top: 1px solid gray; +} + +td.bar.vertical img.last +{ + border-bottom: 1px solid gray; +} + +td.counter +{ + font-size: 60%; + text-align: center; + + color: gray; + background-color: transparent; + + border: 1px solid silver; +} + +td.numeration +{ + font-weight: bold; + font-size: 80%; + text-align: center; + + color: black; + background-color: silver; +} + +td.invis +{ + background-color: transparent; + color: black; +} + +th +{ + background-color: silver; + color: black; + text-align: center; + font-weight: bold; + font-style: italic; +} + +tr.hour_row td +{ + border: 1px solid gray; +} -- 2.11.0