summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2008-04-26 14:56:56 +0200
committerTobi Oetiker <tobi@oetiker.ch>2008-04-26 14:56:56 +0200
commitad4960d32b3d5bc6d8ee58dc5cb0f6553a36f21d (patch)
tree9f91d61b357ae0b453d505ac3ce7c82f42712199
parente1aa9c368e3ad73b576d4410ffc937d1d03c50f1 (diff)
downloadsmokeping-ad4960d32b3d5bc6d8ee58dc5cb0f6553a36f21d.tar.gz
smokeping-ad4960d32b3d5bc6d8ee58dc5cb0f6553a36f21d.tar.xz
integrated menuactive patch
-rw-r--r--CHANGES3
-rw-r--r--etc/basepage.html.dist9
-rw-r--r--lib/Smokeping.pm6
3 files changed, 16 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index c4e17fd..b8895c9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+* add custom style for active menu link
+ -- tobi, patch by Daniel Rich drich employees.org
+
* honour the 'linkstyle' variable when zooming
-- niko, reported by Wolfgang Tremmel as Debian bug #476404
diff --git a/etc/basepage.html.dist b/etc/basepage.html.dist
index cc5bb67..a4b31d9 100644
--- a/etc/basepage.html.dist
+++ b/etc/basepage.html.dist
@@ -30,16 +30,23 @@
}
.menuactive {
- background: #202040;
+ background: white;
}
a.menulink {
color: white;
}
+
+a.menulinkactive {
+ color: #1280d7;
+ }
+
+a.menulinkactive:hover,
a.menulink:hover {
color: #e0e0ff;
}
+
-->
</STYLE>
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 50fad0f..db0e1b9 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -660,7 +660,11 @@ sub target_menu($$$$;$){
$menu =~ s/ /&nbsp;/g;
my $menuadd ="";
$menuadd = "&nbsp;" x (20 - length($menu)) if length($menu) < 20;
- $print .= qq{<tr><td class="$class" colspan="2">&nbsp;-&nbsp;<a class="menulink" HREF="$path$key$suffix">$menu</a>$menuadd</td></tr>\n};
+ my $menuclass = "menulink";
+ if ($key eq $current and !@$open) {
+ $menuclass = "menulinkactive";
+ }
+ $print .= qq{<tr><td class="$class" colspan="2">&nbsp;-&nbsp;<a class="$menuclass" HREF="$path$key$suffix">$menu</a>$menuadd</td></tr>\n};
if ($key eq $current){
my $prline = target_menu $tree->{$key}, $open, "$path$key.",$filter, $suffix;
$print .= qq{<tr><td class="$class">&nbsp;&nbsp;</td><td align="left">$prline</td></tr>}