Index: openacs-4/www/blank-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/blank-master.tcl,v diff -u -r1.39 -r1.40 --- openacs-4/www/blank-master.tcl 4 Jan 2008 21:46:35 -0000 1.39 +++ openacs-4/www/blank-master.tcl 8 Jan 2008 09:29:18 -0000 1.40 @@ -195,6 +195,27 @@ } } +# Concatenate the javascript event handlers for the body tag +variable ::template::body_handlers +if {[array exists body_handlers]} { + + foreach name [array names body_handlers] { + set event [lindex [split $name ","] 0] + # ns_log notice "event $event name $name JS !!!$body_handlers($name)!!!" + foreach javascript $body_handlers($name) { + lappend body_handlers($event) "[string trimright $javascript {; }];" + } + unset body_handlers($name) + } + + # Now create the event handlers string + foreach {event script} [array get body_handlers] { + append event_handlers " " $event = \" [join $script { }] \" + } + unset body_handlers +} + +# Retrieve headers and footers template::head::prepare_multirows set header [template::head::get_header_html] set footer [template::head::get_footer_html]