added mark and hover effect to every table of class data

This commit is contained in:
Sebastian Mendel
2005-10-19 15:01:54 +00:00
parent 4e99e2d1f2
commit 3cedec468e
3 changed files with 67 additions and 5 deletions

View File

@@ -13,6 +13,8 @@ $Source$
fix problem not remembering selected server
* libraries/tooltip.js, themes/*/theme_right.css.php:
moved not always needed code out of event handler, fixed display with larger font
* libraries/function.js, css/phpmyadmin.css.php:
added mark and hover effect to every table of class data
2005-10-18 Michal Čihař <michal@cihar.com>
* libraries/relation.lib.php: Do not set database if not needed.

View File

@@ -355,17 +355,32 @@ span.tab, span.tabcaution {
/* end topmenu */
/* odd table rows 1,3,5,7,... */
table tbody tr.odd td,
table tbody tr.odd th {
table tr.odd {
background-color: <?php echo $GLOBALS['cfg']['BgcolorOne']; ?>;
}
/* even table rows 2,4,6,8,... */
table tbody tr.even td,
table tbody tr.even th {
table tr.even {
background-color: <?php echo $GLOBALS['cfg']['BgcolorTwo']; ?>;
}
/* even table rows 2,4,6,8,... */
table tr.marked {
background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
}
/* even table rows 2,4,6,8,... */
table.data tbody tr:hover,
table tr.hover {
background-color: <?php echo $GLOBALS['cfg']['BrowsePointerColor']; ?>;
}
table tr.even th,
table tr.odd th {
background-color: inherit;
color: inherit;
}
.value .attention {
color: red;
@@ -389,6 +404,7 @@ div#serverstatus table caption,
div#serverstatus table th,
div#serverstatus table td {
padding: 0.1em 0.5em 0.1em 0.5em;
margin: 0;
margin: 0.1em;
vertical-align: top;
}

View File

@@ -463,6 +463,50 @@ function checkTransmitDump(theForm, theAction)
*/
var marked_row = new Array;
/**
* enables highlight and marking of rows in data tables
*/
function tabdataInit() {
var tables = document.getElementsByTagName('table');
for (var t=0; t<tables.length; t++) {
if ( 'data' != tables[t].className ) {
continue;
}
var body = tables[t].getElementsByTagName('tbody')
var rows = body[0].getElementsByTagName('tr');
for (var i = 0; i < rows.length; i++) {
rows[i].style.cursor = 'pointer';
if ( navigator.appName == 'Microsoft Internet Explorer' ) {
rows[i].onmouseover = function() {
this.className += ' hover';
}
rows[i].onmouseout = function() {
this.className = this.className.replace(' hover', '');
}
}
rows[i].onmousedown = function() {
if ( ! this.id ) {
return;
}
if ( typeof(marked_row[this.id]) == 'undefined' || !marked_row[this.id] ) {
marked_row[this.id] = true;
} else {
marked_row[this.id] = false;
}
if ( marked_row[this.id] ) {
this.className += ' marked';
} else {
this.className = this.className.replace(' marked', '');
}
}
}
}
}
window.onload=tabdataInit;
/**
* Sets/unsets the pointer and marker in browse mode
@@ -537,7 +581,7 @@ function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerCol
currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
}
}
// 4. Defines the new color
// 4.1 Current color is the default one
if (currentColor == ''