mouse roll overs

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
jftuga
Posts: 49
Joined: Mon Feb 07, 2011 11:50 am
Location: Athens, GA

mouse roll overs

Post by jftuga »

I made a nice change to 0.8.7g. When moving the mouse over entries in the Device view and Graph Trees the item the mouse is over will be highlighted blue. When the mouse is moved off of this item, the background row color returns to its previous color.

Device view (and other pages, too):
In html_utility.php:form_alternate_row_color()

Code: Select all

[root@svrcacti01 lib]# grep -B 1 -A 4 "roll_over =" html_utility.php

        if (strlen($row_id)) {
                $roll_over = " onmouseover=\"this.style.background='#0FF'\" onmouseout=\"this.style.background='#$current_color'\" ";
                print "<tr $roll_over id='$row_id' bgcolor='#$current_color'>\n";
        }else{
                print "<tr bgcolor='#$current_color'>\n";
        }
Graph Trees:
In html_tree.php:grow_edit_graph_tree()

Code: Select all

(removed, see my next post)
Also, in the Graph Tree html code, I believe there are <tr> tags missings. I would have preferred to put the roll_over code on the entire <tr> rows, but the <td> are good enough.

What go you think of this change? I tested this with IE 8 and FF 3.6.

Thanks,
-John
Last edited by jftuga on Thu Mar 24, 2011 3:47 pm, edited 1 time in total.
jftuga
Posts: 49
Joined: Mon Feb 07, 2011 11:50 am
Location: Athens, GA

Re: mouse roll overs

Post by jftuga »

OK, I fixed the Graph Tree so that the roll overs work across the entire row, which was my original intention. I have attached my modified version of lib/html_tree.php.
Attachments
html_tree.php.txt
Graph Tree with colored roll overs
(57.93 KiB) Downloaded 216 times
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: mouse roll overs

Post by noname »

I tried this.
Here are some screenshots.

Device List
highlighted_device.png
highlighted_device.png (7.46 KiB) Viewed 2338 times
Device Settings
highlighted_device_detail.png
highlighted_device_detail.png (17.05 KiB) Viewed 2338 times
Tree Settings
highlighted_tree.png
highlighted_tree.png (9.32 KiB) Viewed 2338 times
That's very good idea. It is clear where is paid attention to. (especially for large tree)
And beautiful! ^^


..But, I'm sorry to say that,
this also affects to selected rows.
selected_row.png
selected_row.png (2.74 KiB) Viewed 2338 times
Once highlighted, selected color (orange) will be changed to normal color..
selected_row_disappeared.png
selected_row_disappeared.png (3.09 KiB) Viewed 2338 times
jftuga
Posts: 49
Joined: Mon Feb 07, 2011 11:50 am
Location: Athens, GA

Re: mouse roll overs

Post by jftuga »

A quick but very inefficent fix for this is to change this line in html_utility.php:

Code: Select all

$roll_over = " onmouseover=\"this.style.background='#0FF'\" onmouseout=\"this.style.background='#$current_color'; update_selection_indicators()\" ";
This works, but makes the UI very sluggish. I am going to work on a 'proper' fix.

-John
jftuga
Posts: 49
Joined: Mon Feb 07, 2011 11:50 am
Location: Athens, GA

Re: mouse roll overs

Post by jftuga »

It looks like this will need a lot of work to get this working efficiently. Unfortunately, I don't have the time right now to work on this.

-John
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests