|
|
| Author |
Message |
bware Beginner
Joined: 28 May 2004 Posts: 6 Location: Amsterdam
|
Posted: Tue Jun 01, 2004 3:31 pm Post subject: Slide show display time configurable |
|
|
Heyaz,
Would it be an option to user configure the time to display a page in slideshow (autoscroll) mode ? I have 10 graphs on one page and the current timeout (scrollInterval = 1000 ) does not allow the page to scroll all the way to the bottom of the page.
I guess adding a user_pref 'slideInterval' (int)
And then change view.php line 368 to someting like:
| Code: |
var scrollInterval = <?PHP echo $slideInterval;?>;
|
|
|
| Back to top |
|
 |
bware Beginner
Joined: 28 May 2004 Posts: 6 Location: Amsterdam
|
Posted: Tue Jun 01, 2004 3:49 pm Post subject: |
|
|
Hmmz...
That was the incorrect place to make changes.
It seems the problem lies in the javascript code for the window scrolling... I'll dig a bit further before posting again ;) |
|
| Back to top |
|
 |
bware Beginner
Joined: 28 May 2004 Posts: 6 Location: Amsterdam
|
Posted: Tue Jun 01, 2004 3:56 pm Post subject: |
|
|
I guess I found the issue:
The autoscroll gets the window height on page load, which is -remember, I'm guessing - before the images are loaded. This should not be an issue, if the img tags contains a height value (which is not the case), so the height calculation is based upon the the body containing img placeholders + tr space.
So either setting img height or recalculating the height after the 1st scroll attempt will probably solve the problem... I'll experiment a bit further with this. |
|
| Back to top |
|
 |
balleman Site Admin
Joined: 20 Jan 2003 Posts: 282
|
Posted: Tue Jun 01, 2004 10:01 pm Post subject: |
|
|
| That might not be a viable solution as the true image heights are not known until the graphs are rendered. The dimensions we hand off to rrdtool are for the graph area, and do not include the dimensions of the legends, titles, etc. We could possibly have netmrg remember the dimensions of the image when it was last rendered, though. |
|
| Back to top |
|
 |
silfreed Site Admin
Joined: 19 Jan 2003 Posts: 394 Location: Shippensburg, PA, USA
|
Posted: Wed Jun 02, 2004 1:13 am Post subject: |
|
|
This also could be quite browser-dependant. We've done all our testing on Mozilla (Firefox, Galeon) and it's worked very well in our experience. It's would seem very possible that other browsers could implement this javascript differently.
-Doug |
|
| Back to top |
|
 |
bware Beginner
Joined: 28 May 2004 Posts: 6 Location: Amsterdam
|
Posted: Wed Jun 02, 2004 7:15 am Post subject: |
|
|
I made some modifications to the code to get this working in Crazy Browser (a Tabbed Internet Explorer clone).
I just added scrollInterval to document.body.offsetHeight and now the slideshow scrolls completely to the bottom of the page.
I guess that setting < IMG ... height=..> would be a better solution, but it works for me ;) |
|
| Back to top |
|
 |
silfreed Site Admin
Joined: 19 Jan 2003 Posts: 394 Location: Shippensburg, PA, USA
|
Posted: Wed Jun 02, 2004 11:27 am Post subject: |
|
|
Would it be possible for you to submit a bug with either a 'diff' of your changes or attach the entire file (we can do the diff then)? Bugs are maintained at http://bugs.netmrg.net
Getting features like this to work in more browsers is great! Thanks for your work!
-Doug |
|
| Back to top |
|
 |
bware Beginner
Joined: 28 May 2004 Posts: 6 Location: Amsterdam
|
Posted: Wed Jun 02, 2004 12:51 pm Post subject: |
|
|
Bug report posted Bug ID 225.
I did some additional digging into this:
* Mozilla works
* IE 6.x does not complete
The javascript function document.body.offsetHeight behaves different between the various browsers (hopefully not between the browser versions). I might check the return value accross different browsers to see the exact differences.
-- Note --
Adding the height value requires some extra work... simply adding a fixed height for all the IMG tags makes the page render pretty ugly :( So I guess the proper way to do it is get the file properties before creating the img tag and insert the height based on that information. |
|
| Back to top |
|
 |
silfreed Site Admin
Joined: 19 Jan 2003 Posts: 394 Location: Shippensburg, PA, USA
|
Posted: Thu Jun 03, 2004 2:19 am Post subject: |
|
|
rrdgraph does return the X x Y height of the graphs, but this would be too late for us to use it in the image display function, or we'd have to call it twice. An alternative would be for us to call in when a template/custom graph is created/modified to get the height and width for the graph and cache the info. I think I'll submit a bug for that, because it would be very useful ;)
-Doug |
|
| Back to top |
|
 |
|