Last change
on this file since 753 was
618,
checked in by geofft, 16 years ago
|
Apply a background color to every other VM, and move the power button to the left,
closer to the VM name.
Upgraded prototype.js to 1.6.
|
File size:
685 bytes
|
Rev | Line | |
---|
[618] | 1 | /* |
---|
| 2 | * The general idea is from the following A List Apart article: |
---|
| 3 | * http://www.alistapart.com/articles/zebratables/ |
---|
| 4 | * |
---|
| 5 | * The structure is inspired by the code fragment they supply, but the |
---|
| 6 | * code here is significantly cleaner. It also colors every two lines |
---|
| 7 | * rather than every line, since XVM uses two rows for each item. |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | function stripe(table, darkClass, lightClass) { |
---|
| 11 | for (var i = 0; i < table.rows.length; i++ ) { |
---|
| 12 | /* The header row should be light; the next two are dark. */ |
---|
| 13 | if (i%4 == 1 || i%4 == 2) |
---|
| 14 | table.rows[i].className += ' ' + darkClass; |
---|
| 15 | else if (lightClass) |
---|
| 16 | table.rows[i].className += ' ' + lightClass; |
---|
| 17 | } |
---|
| 18 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.