[greenstone-users] I can't insert a script of java script
Hi !
I've been trying to insert a script of javascript to obtain a 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); } }
// End --></script> </body> </html>
Everything works fine, but in Greenstone the script is ignored, I inserted in the macro in the style.dm macro package, but its 'doesn't work.
I put everything whithout the <html></html>, I put it too in the macro home.dm
======================================================================================================================
# this file must be UTF-8 encoded
package home
# set the title of the home page to be "greenstone digital library"# in the currently chosen language
GSDL Error {Greenstone Digital Library Software}
######################################################################## global navigation links#######################################################################
# overridden here as we don't want 'home' links on this page
# home:helplink and home:preflink set in nav_css/ns4 macro filesHOMEHELPPREFERENCES {HELPPREFERENCES}
######################################################################## icons#######################################################################
_iconmusiclibrary_ {<img src="_httpicontmusic_" border="1" alt="meldex music library" title="meldex music library">}
{<body onload = "animate()">
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><img src="/gsdl/web/images/gsdlhead.jpg" id="anim" alt="Centro de Documentación Institucional" align="middle" width="780" height="108" border="0" usemap="#Map" /><map name="Map" id="Map"><area shape="rect" coords="7,8,146,105" href="http://cdivirtual.salud.gob.mx" target="_blank" alt="cdi" /><area shape="rect" coords="661,14,761,89" href="http://portal.salud.gob.mx" target="_blank" alt="Secretaria de Salud"/></map></td> </tr></table><br><br></body>}
######################################################################## http macros ## These contain the url without any quotes#######################################################################
_httppagegsdl_ {/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-about-s%2eyeates%26%2364%3bcs%2ewaikato%2eac%2enz--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=p&p=gsdl}_httppagehomepref_ {/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-about-s%2eyeates%26%2364%3bcs%2ewaikato%2eac%2enz--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=p&p=homepref}
######################################################################## images#######################################################################
# Buttons for the pane after the collections and before the text
_button_ {<div class="button"><span class="button"><a href="_1_">_2_</a></span></div>}
_imagegli_ {_button_(/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-about-s%2eyeates%26%2364%3bcs%2ewaikato%2eac%2enz--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=p&p=gli,The Librarian Interface)}
_imagecollector_ {_button_(/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-about-s%2eyeates%26%2364%3bcs%2ewaikato%2eac%2enz--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=collector&p=intro,The Collector)}
_imagedepositor_ {_button_(/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-about-s%2eyeates%26%2364%3bcs%2ewaikato%2eac%2enz--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=depositor&p=select,The Depositor)}
_imagetranslator_ {_button_(/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-about-s%2eyeates%26%2364%3bcs%2ewaikato%2eac%2enz--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=gti&p=home,The Greenstone Translator Interface)}
_imageadmin_ {_button_(/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-about-s%2eyeates%26%2364%3bcs%2ewaikato%2eac%2enz--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=status&p=frameset,Administration Page)}
_imagegogreenstone_ {_button_(_home:httppagegsdl_,About Greenstone)}
_imagegodocs_ {_button_(/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-about-s%2eyeates%26%2364%3bcs%2ewaikato%2eac%2enz--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=p&p=docs,Greenstone Documentation)}
######################################################################## page content #######################################################################
# _homeextra_ is the automatically generated list of collections (in a table)########AQUI YO COMENTE LO SIGUIENTE QUE ES DONDE SE ENCUENTRA LO DE LA INTRODUCCION A LA BIBLIOTECA DE GREENSTONE#
oops
The requested page could not be found. Please use
your browsers 'back' button or the above home button to return to the
Greenstone Digital Library. {#<div id="content">#<div class="divbar">#<p class="navbar">#_textdescrselcol_#</p>#</div>
#<div class="section">#_homeextra_#</div>
#<div class="divbar"> </div>
#<div class="section">#<table>#_textgogli_#_textgocollector_#_textgodepositor_#_textgotranslator_#_textgoadmin_#_textgogreenstone_#_textgodocs_
#</table>#</div>
#<div class="divbar"> </div>
#<div class="section">#_textaboutgreenstone_#</div>
#<div class="divbar"> </div>
#</div>#}#### AQUI TERMINA EL COMENTARIO Y SE SUSTITUYE POR LO DE AQUI ABAJO ESTO LO TOMA COMO HTML CASI PURO
oops
The requested page could not be found. Please use
your browsers 'back' button or the above home button to return to the
Greenstone Digital Library. {<div id="content"><div class="divbar"><p class="navbar">_textdescrselcol_</p></div>
<div class="section">_homeextra_</div>
<div class="divbar"> </div><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><div class="section"><table><p style="font-size:12px; font-family:arial,helvetica,sans-serif" > ****** todo el texto que se quiera</table></div>
<div class="divbar"> </div>
<div class="section">_textaboutgreenstone_</div>
<div class="divbar"> </div>
</div>}####HASTA AQUI FUE LO QUE SE CAMBIO# the _textgocollector_, _textgotranslator_, and _textgoadmin_ macros # may be overridden to be empty from within the receptionist if the # collector, translator, or admin facilities are disabled
_textgogli_ {<tr valign=top><td valign=top>_imagegli_</td><td>
Helps you create new collections, modify or add to existing ones, or delete
collections
</td></tr>}
_textgocollector_ {<tr valign=top><td valign=top>_imagecollector_</td><td>
This predates the Librarian Interface, and for most practical purposes the Librarian Interface should be used instead
</td></tr>}
_textgodepositor_ {<tr valign=top><td valign=top>_imagedepositor_</td><td>
Helps you to add documents to existing collections
</td></tr>}
_textgotranslator_ {<tr valign=top><td valign=top>_imagetranslator_</td><td>
Helps you keep the multilingual versions of the Greenstone interface
up to date
</td></tr>}
_textgoadmin_ {<tr valign=top><td valign=top>_imageadmin_</td><td>_textdescradmin_</td></tr>}
#_textgogreenstone_ {#<tr valign=top>#<td valign=top>_imagegogreenstone_</td>#<td>_textdescrgogreenstone_</td>#</tr>}
_textgodocs_ {<tr valign=top><td valign=top>_imagegodocs_</td><td>_textdescrgodocs_</td></tr>}
package homeprefGSDL Error {Preferences - Greenstone Digital Library Software}
{<body onload = "animate()">
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><img src="/gsdl/web/images/gsdlhead.jpg" id="anim" alt="Centro de Documentación Institucional" align="middle" width="780" height="108" border="0" usemap="#Map" /><map name="Map" id="Map"><area shape="rect" coords="7,8,146,105" href="http://cdivirtual.salud.gob.mx" target="_blank" alt="cdi" /><area shape="rect" coords="661,14,761,89" href="http://portal.salud.gob.mx" target="_blank" alt="Secretaria de Salud"/></map></td> </tr></table><br><br></body>} HOMEHELPPREFERENCES {HOMEHELP}
{ 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); } }}
oops
The requested page could not be found. Please use
your browsers 'back' button or the above home button to return to the
Greenstone Digital Library. {<div id="content">
<div class="divbar"> </div>
<div class="section"><form name="PrefForm" method="get" action="/gsdlmod"><h3>Presentation preferences</h3>
<table border="0"><tr valign="top"><td>Interface language:</td><td>_languageoption_</td></tr><tr valign="top"><td>Encoding:</td><td>_encodingoption_</td></tr><tr valign="top">