[CPS-devel] adding a script

Rakotomandimby Mihamina mihamina.rakotomandimby at etu.univ-orleans.fr
Mon Feb 6 12:35:45 CET 2006


Hi,
I made a little javascript to add a "select all" feature to
CPSSharedCalendar.
For the beginnin, it's a very simple script:
//////////////////////////////////////////////////
function checkUncheckAll(theElement) 
{
    var theForm = theElement.form, z = 0;
    for(z=0; z<theForm.length;z++)
	{
	    if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall')
		{
		    theForm[z].checked = theElement.checked;
		}
	}
}
//////////////////////////////////////////////////

That's all.
I wonder where should I put my script.

In the CPSSharedCalendar product, there is a file named widget.py wich
contains:

########### [....] ###########
calendar_js_scripts = """\
<style type="text/css">
	@import url(++resource++calendar-win2k-1.css);
</style>
<script 
	type="text/javascript" 
	src="++resource++calendar.js">
</script>
<script 
	type="text/javascript" 
	src="++resource++calendar-%s.js">
</script>
<script 
	type="text/javascript" 
	src="++resource++calendar-setup.js">
</script>"""
########### [....] ###########

I tried appending the location of my Javascript in there, but it is not
liste in the code source, whan I display the source of the attendees
page.

I tried placing the Javascript in the same directory as the javascripts
of jscalendar, but nothing.

So:

- Where should I place the Javascript?
- How/where should I "declare" it? (the <script> tag)

Thanks. 

I dont want to make a new Product just for that, and as far as I
understood, Lennart was OK to integrate such a feature, if I submit a
good engouh patch.

-- 
A powerfull GroupWare, CMS, CRM, ECM: CPS (Open Source & GPL).
Opengroupware, SPIP, Plone, PhpBB, JetSpeed... are good: CPS is better.
http://www.cps-project.org for downloads & documentation.
Free hosting of CPS groupware: http://www.objectis.org.



More information about the cps-devel mailing list
More information about CPS: CPS project - CVS - API

Hosting: Nuxeo: Zope service provider


This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.