Alexander Nicolaysen Sørnes : Use CSS instead of JavaScript for menu items
Chris Morgan
cmorgan at winehq.org
Thu Jan 17 18:05:44 CST 2008
Module: appdb
Branch: master
Commit: 6808c187ebfd4c485b71d2eaf8ef02636966ab56
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=6808c187ebfd4c485b71d2eaf8ef02636966ab56
Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date: Thu Jan 17 23:13:04 2008 +0100
Use CSS instead of JavaScript for menu items
---
apidb.css | 5 +++--
include/menu.php | 27 ++++++---------------------
2 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/apidb.css b/apidb.css
index 67ca444..485cfb3 100644
--- a/apidb.css
+++ b/apidb.css
@@ -63,8 +63,9 @@ p.indent { padding-left: 1em; padding-right: 1em;}
.menuTitle { font-size: 12px; color: #ffffff; font-weight: bold; text-decoration: none; }
.menuTitle:visited { font-size: 12px; color: #ffffff; font-weight: bold; text-decoration: none; }
.menuTitle:hover { font-size: 12px; color: #ffffff; font-weight: bold; text-decoration: none; }
-.menuLink { font-size: 11px; color: #ffffff; font-weight: bold; }
-.menuItem { font-size: 11px; color: #000000; }
+.menuLink { padding-left: 4px; padding-top: 5px; padding-bottom: 5px; background-color: #ffffff; font-size: 11px; width: 140px; display: block; }
+.menulink:hover { background-color: #e0e6ff; }
+.menuItem { padding-left: 4px; padding-top: 5px; padding-bottom: 5px; background-color: #ffffff; font-size: 11px; width: 140px; display: block; }
.menuItem:visited { font-size: 11px; color: #000000; }
.menuItem:hover { font-size: 11px; color: #A50D0D; }
diff --git a/include/menu.php b/include/menu.php
index 66d8403..4f5b30a 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -31,7 +31,7 @@ class htmlmenu {
<td>
<table width="155" border="0" cellspacing="0" cellpadding="1">
<tr class="topMenu"><td>
- <table width="100%" border="0" cellspacing="0" cellpadding="5">
+ <table width="100%" border="0" cellspacing="0" cellpadding="5"><tr><td class="sidemenu">
';
}
@@ -43,38 +43,23 @@ class htmlmenu {
if($shUrl)
{
- $oTableCell = new TableCell("<span class=MenuItem> <u>".
- "<a href=\"$shUrl\">$sName</a></u></span>");
-
- $oHighlightColor = new Color(0xe0, 0xe6, 0xff);
- $oInactiveColor = new Color(0xff, 0xff, 0xff);
- $oTableRowHighlight = new TableRowHighlight($oHighlightColor, $oInactiveColor);
-
- $oTableRowClick = new TableRowClick($shUrl);
- $oTableRowClick->SetHighlight($oTableRowHighlight);
-
- $oTableRow->SetRowClick($oTableRowClick);
+ echo "<a href=\"$shUrl\" class=\"menuLink\">$sName</a>";
} else
{
- $oTableCell = new TableCell("<span class=menuItem> $sName</span></td></tr>");
+ echo "<div class=\"menuItem\">$sName</div>";
}
- $oTableCell->SetAlign($sAlign);
- $oTableCell->SetWidth("100%");
-
- $oTableRow->SetClass("sidemenu");
- $oTableRow->AddCell($oTableCell);
-
- echo $oTableRow->GetString();
}
function addmisc($sStuff, $sAlign = "left")
{
- echo " <tr class=sideMenu><td width='100%' align=$sAlign><span class=menuItem> $sStuff</span></td></tr>\n";
+ echo "<div align=\"$sAlign\" class=\"menuItem\">$sStuff</div>\n";
}
function done($form = null)
{
echo '
+ </td>
+ </tr>
</table>
</td></tr>
</table>
More information about the wine-cvs
mailing list