[greenstone-users] I can't insert a script of java script

From qq6@cs.waikato.ac.nz
DateTue Jan 15 11:06:36 2008
Subject [greenstone-users] I can't insert a script of java script
In-Reply-To (BLU128-W30F35933FFE6439A1243A2C9460-phx-gbl)
Hi

If you want to add javasrcipt to the head of the page of Greenstone, a
macro has to be added into a corresponding macro
package. In your case, a {javascript codes} needs to be
defined under "package home" which can be found at the
GSDLHOME/macros/home.dm file or you can define it at the
yourcollect/macros/extra.dm file. A better way to customize the user
interface is to add extra javascript codes into
yourcollect/macros/extra.dm.

Regards
Quan


> Hi !
>
> I've been trying to insert a script of javascript to obtain a
> Greenstone Archives collection that can changes when the mainpage of Greenstone load
> completly , If I use it within a ordinary html page it works fine, but
> within Greenstone it doesn't change , the script is this:
> <html> <head> <title>Java Script simple Code</title> </head>
> <body onload = "animate()"> <img src="/gsdl/web/images/gsdlhead.jpg"
> id="anim"> <script languague="JavaScript" type="text/javascript">
> <!--//Begin var counter = 0;
>
> function animate() { var img =
> document.getElementById("anim"); // Proceed to the next
> image counter ++; // There are only four images, so
> restart when we're done if (counter > 3) counter = 0;
> if (counter == 0) { // Display the first image
> img.src = "/gsdl/web/images/gsdlhead.jpg"; } else if (counter ==
> 1) { // Display the second image img.src =
> "/gsdl/web/images/foto_02.jpg"; } else if (counter == 2) {
> // Display the third image img.src =
> "/gsdl/web/images/foto_03.jpg"; } else { // Display the
> fourth image img.src = "/gsdl/web/images/foto_04.jpg"; }
> // We need to call the animate function again in 0.10 seconds
> // Pause for 1 second between the fourth and first image
> if (counter == 3) { setTimeout("animate()", 2000);
> } else { setTimeout("animate()", 200);