Index: openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl,v
diff -u -r1.23 -r1.24
--- openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 14 Sep 2007 09:33:10 -0000 1.23
+++ openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 28 Sep 2007 20:33:04 -0000 1.24
@@ -697,3 +697,32 @@
}
+namespace eval ::xo {
+ #
+ # templating and CSS
+ #
+ Class create Page
+ Page proc requireCSS name {set ::need_css($name) 1}
+ Page proc requireJS name {
+ if {![info exists ::need_js($name)]} {lappend ::js_order $name}
+ set ::need_js($name) 1
+ }
+ Page proc header_stuff {} {
+ set result ""
+ foreach file [array names ::need_css] {
+ append result "\n"
+ }
+ if {[info exists ::js_order]} {
+ foreach file $::js_order {
+ if {[string match "*;*" $file]} {
+ # it is not a file, but some javascipt statements
+ append result "\n"
+ } else {
+ append result "\n"
+ }
+ }
+ }
+ return $result
+ }
+}
\ No newline at end of file