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 Index: openacs-4/packages/xowiki/lib/view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/lib/view.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/xowiki/lib/view.tcl 10 Aug 2007 16:10:51 -0000 1.9 +++ openacs-4/packages/xowiki/lib/view.tcl 28 Sep 2007 20:34:06 -0000 1.10 @@ -19,7 +19,7 @@ } set html [::$package_id invoke -method $m] -set ::xowiki_head [::xowiki::Page header_stuff] +set ::xowiki_head [::xo::Page header_stuff] if {![info exists css]} { set fn [get_server_root]/packages/xowiki/www/resources/xowiki.css Index: openacs-4/packages/xowiki/tcl/category-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/category-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/xowiki/tcl/category-procs.tcl 14 May 2007 07:14:21 -0000 1.12 +++ openacs-4/packages/xowiki/tcl/category-procs.tcl 28 Sep 2007 20:34:06 -0000 1.13 @@ -33,9 +33,9 @@ CatTree instproc render {{-tree_style:boolean false}} { if {$tree_style} { - #::xowiki::Page requireCSS "/resources/acs-templating/mktree.css" - ::xowiki::Page requireCSS "/resources/xowiki/cattree.css" - ::xowiki::Page requireJS "/resources/acs-templating/mktree.js" + #::xo::Page requireCSS "/resources/acs-templating/mktree.css" + ::xo::Page requireCSS "/resources/xowiki/cattree.css" + ::xo::Page requireJS "/resources/acs-templating/mktree.js" foreach c [my children] {append content [$c render] \n} return "" Index: openacs-4/packages/xowiki/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/chat-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/xowiki/tcl/chat-procs.tcl 20 Sep 2007 12:16:33 -0000 1.10 +++ openacs-4/packages/xowiki/tcl/chat-procs.tcl 28 Sep 2007 20:34:06 -0000 1.11 @@ -60,7 +60,7 @@ switch $mode { polling { - ::xowiki::Page requireJS "/resources/xowiki/get-http-object.js" + ::xo::Page requireJS "/resources/xowiki/get-http-object.js" set jspath packages/xowiki/www/ajax/chat.js set login_url ${path}ajax/chat?m=login&$context set get_update "chatSendCmd(\"$path/ajax/chat?m=get_new&$context\",chatReceiver)" Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 28 Sep 2007 11:53:09 -0000 1.36 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 28 Sep 2007 20:34:06 -0000 1.37 @@ -570,10 +570,10 @@ my set widget_type richtext } FormField::richtext::wym instproc render_content {} { - ::xowiki::Page requireCSS "/resources/xowiki/wymeditor/skins/default/screen.css" - ::xowiki::Page requireJS "/resources/xowiki/jquery/jquery.js" - ::xowiki::Page requireJS "/resources/xowiki/wymeditor/jquery.wymeditor.pack.js" - ::xowiki::Page requireJS { + ::xo::Page requireCSS "/resources/xowiki/wymeditor/skins/default/screen.css" + ::xo::Page requireJS "/resources/xowiki/jquery/jquery.js" + ::xo::Page requireJS "/resources/xowiki/wymeditor/jquery.wymeditor.pack.js" + ::xo::Page requireJS { var $j = jQuery.noConflict(); $j(function() { $j(".wymeditor").wymeditor(); Index: openacs-4/packages/xowiki/tcl/link-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v diff -u -r1.35 -r1.36 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 13 Sep 2007 20:02:19 -0000 1.35 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 28 Sep 2007 20:34:06 -0000 1.36 @@ -228,13 +228,13 @@ Class create ::xowiki::Link::css -superclass ::xowiki::Link::file -parameter { } ::xowiki::Link::css instproc render_found {href label} { - ::xowiki::Page requireCSS $href + ::xo::Page requireCSS $href return "" } Class create ::xowiki::Link::js -superclass ::xowiki::Link::file -parameter { } ::xowiki::Link::js instproc render_found {href label} { - ::xowiki::Page requireJS $href + ::xo::Page requireJS $href return "" } @@ -252,7 +252,7 @@ return $item_id } ::xowiki::Link::swf instproc render_found {href label} { - ::xowiki::Page requireJS /resources/xowiki/swfobject.js + ::xo::Page requireJS /resources/xowiki/swfobject.js my instvar package_id name #set link [$package_id pretty_link -absolute true -siteurl http://localhost:8003 $name]/download.swf foreach {width height bgcolor version} {320 240 #999999 7} break @@ -295,9 +295,9 @@ return 0 } ::xowiki::Link::glossary instproc render_found {href label} { - ::xowiki::Page requireJS "/resources/xowiki/get-http-object.js" - ::xowiki::Page requireJS "/resources/xowiki/popup-handler.js" - ::xowiki::Page requireJS "/resources/xowiki/overlib/overlib.js" + ::xo::Page requireJS "/resources/xowiki/get-http-object.js" + ::xo::Page requireJS "/resources/xowiki/popup-handler.js" + ::xo::Page requireJS "/resources/xowiki/overlib/overlib.js" return "$label" Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.91 -r1.92 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 28 Sep 2007 12:06:54 -0000 1.91 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 28 Sep 2007 20:34:06 -0000 1.92 @@ -278,7 +278,7 @@ } set context [list [$id instance_name]] set title Error - set header_stuff [::xowiki::Page header_stuff] + set header_stuff [::xo::Page header_stuff] set index_link [my make_link -privilege public -link "" $id {} {}] set link [my query_parameter "return_url" ""] if {$link ne ""} {set back_link $link} Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 28 Sep 2007 12:47:31 -0000 1.24 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 28 Sep 2007 20:34:06 -0000 1.25 @@ -222,7 +222,7 @@ # # We need the following CSS file for rendering # - ::xowiki::Page requireCSS "/resources/xowiki/weblog.css" + ::xo::Page requireCSS "/resources/xowiki/weblog.css" $items set entry_renderer [my entry_renderer] set content [$items render] Index: openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/xowiki-portlet-procs.tcl,v diff -u -r1.101 -r1.102 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 28 Sep 2007 12:17:58 -0000 1.101 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 28 Sep 2007 20:34:06 -0000 1.102 @@ -629,7 +629,7 @@ recent instproc render {} { my get_parameters - ::xowiki::Page requireCSS "/resources/acs-templating/lists.css" + ::xo::Page requireCSS "/resources/acs-templating/lists.css" TableWidget t1 -volatile \ -set allow_edit $allow_edit \ -set allow_delete $allow_delete \ @@ -702,7 +702,7 @@ last-visited instproc render {} { my get_parameters - ::xowiki::Page requireCSS "/resources/acs-templating/lists.css" + ::xo::Page requireCSS "/resources/acs-templating/lists.css" TableWidget t1 -volatile \ -columns { @@ -746,7 +746,7 @@ most-popular instproc render {} { my get_parameters - ::xowiki::Page requireCSS "/resources/acs-templating/lists.css" + ::xo::Page requireCSS "/resources/acs-templating/lists.css" if {[info exists interval]} { # @@ -827,7 +827,7 @@ unread-items instproc render {} { my get_parameters - ::xowiki::Page requireCSS "/resources/acs-templating/lists.css" + ::xo::Page requireCSS "/resources/acs-templating/lists.css" TableWidget t1 -volatile \ -columns { @@ -884,7 +884,7 @@ tags instproc render {} { my get_parameters - ::xowiki::Page requireCSS "/resources/acs-templating/lists.css" + ::xo::Page requireCSS "/resources/acs-templating/lists.css" if {$popular} { set label [_ xowiki.popular_tags_label] @@ -930,7 +930,7 @@ my-tags instproc render {} { my get_parameters my instvar __including_page tags - ::xowiki::Page requireJS "/resources/xowiki/get-http-object.js" + ::xo::Page requireJS "/resources/xowiki/get-http-object.js" set p_link [$package_id pretty_link [$__including_page name]] set return_url "[::xo::cc url]?[::xo::cc actual_query]" @@ -1534,15 +1534,15 @@ "folders" {set s "folders/"} "default" {set s ""} } - ::xowiki::Page requireCSS "/resources/ajaxhelper/yui/treeview/assets/${s}tree.css" - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/yahoo/yahoo.js" - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/event/event.js" + ::xo::Page requireCSS "/resources/ajaxhelper/yui/treeview/assets/${s}tree.css" + ::xo::Page requireJS "/resources/ajaxhelper/yui/yahoo/yahoo.js" + ::xo::Page requireJS "/resources/ajaxhelper/yui/event/event.js" if {$ajax} { - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/dom/dom.js" ;# ANIM - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/connection/connection.js" - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/animation/animation.js" ;# ANIM + ::xo::Page requireJS "/resources/ajaxhelper/yui/dom/dom.js" ;# ANIM + ::xo::Page requireJS "/resources/ajaxhelper/yui/connection/connection.js" + ::xo::Page requireJS "/resources/ajaxhelper/yui/animation/animation.js" ;# ANIM } - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/treeview/treeview.js" + ::xo::Page requireJS "/resources/ajaxhelper/yui/treeview/treeview.js" my set book_mode $book_mode if {!$book_mode} { @@ -1944,15 +1944,15 @@ graph instproc graphHTML {-edges -nodes -max_edges -cutoff -base {-attrib node_id}} { - ::xowiki::Page requireJS "/resources/ajaxhelper/prototype/prototype.js" + ::xo::Page requireJS "/resources/ajaxhelper/prototype/prototype.js" set user_agent [string tolower [ns_set get [ns_conn headers] User-Agent]] if {[string match "*msie *" $user_agent]} { # canvas support for MSIE - ::xowiki::Page requireJS "/resources/xowiki/excanvas.js" + ::xo::Page requireJS "/resources/xowiki/excanvas.js" } - ::xowiki::Page requireJS "/resources/xowiki/collab-graph.js" - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/yahoo/yahoo.js" - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/event/event.js" + ::xo::Page requireJS "/resources/xowiki/collab-graph.js" + ::xo::Page requireJS "/resources/ajaxhelper/yui/yahoo/yahoo.js" + ::xo::Page requireJS "/resources/ajaxhelper/yui/event/event.js" set nodesHTML "" array set n $nodes @@ -2200,9 +2200,9 @@ timeline instproc render {} { my get_parameters - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/yahoo/yahoo.js" - ::xowiki::Page requireJS "/resources/ajaxhelper/yui/event/event.js" - ::xowiki::Page requireJS "/resources/xowiki/timeline/api/timeline-api.js" + ::xo::Page requireJS "/resources/ajaxhelper/yui/yahoo/yahoo.js" + ::xo::Page requireJS "/resources/ajaxhelper/yui/event/event.js" + ::xo::Page requireJS "/resources/xowiki/timeline/api/timeline-api.js" set stamp [clock format [clock seconds] -format "%b %d %Y %X %Z" -gmt true] if {[info exists user_id]} {append data "?user_id=$user_id"} @@ -2347,7 +2347,7 @@ my get_parameters my instvar __including_page - ::xowiki::Page requireCSS "/resources/acs-templating/lists.css" + ::xo::Page requireCSS "/resources/acs-templating/lists.css" set return_url [::xo::cc url]?[::xo::cc actual_query] if {![info exists form_item_id]} { Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.173 -r1.174 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 28 Sep 2007 12:06:54 -0000 1.173 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 28 Sep 2007 20:34:06 -0000 1.174 @@ -206,29 +206,6 @@ # templating and CSS # - 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 - } Page proc quoted_html_content text { list [ad_text_to_html $text] text/html } @@ -626,11 +603,11 @@ #my msg t=[::xowiki::guesstype $link] switch -glob -- [::xowiki::guesstype $link] { text/css { - ::xowiki::Page requireCSS $link + ::xo::Page requireCSS $link return $ch } application/x-javascript { - ::xowiki::Page requireJS $link + ::xo::Page requireJS $link return $ch } image/* { Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.102 -r1.103 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 20 Sep 2007 12:19:37 -0000 1.102 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 28 Sep 2007 20:34:06 -0000 1.103 @@ -196,15 +196,15 @@ } else { # use adp file - foreach css [$package_id get_parameter extra_css ""] {::xowiki::Page requireCSS $css} + foreach css [$package_id get_parameter extra_css ""] {::xo::Page requireCSS $css} # refetch it, since it might have been changed via set-parameter set template_file [my query_parameter "template_file" \ [::$package_id get_parameter template_file view-default]] if {![regexp {^[./]} $template_file]} { set template_file /packages/xowiki/www/$template_file } - set header_stuff [::xowiki::Page header_stuff] + set header_stuff [::xo::Page header_stuff] $package_id return_page -adp $template_file -variables { name title item_id context header_stuff return_url content footer package_id @@ -1114,8 +1114,7 @@ #my msg requireFormCSS set css [my set extraCSS] if {$css ne ""} { - #my msg "requireCSS $css" - ::xowiki::Page requireCSS $css + ::xo::Page requireCSS $css } } Index: openacs-4/packages/xowiki/www/portlet-ajax.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlet-ajax.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/www/portlet-ajax.tcl 22 May 2006 21:44:49 -0000 1.1 +++ openacs-4/packages/xowiki/www/portlet-ajax.tcl 28 Sep 2007 20:34:07 -0000 1.2 @@ -1,6 +1,6 @@ # like portlet, except with background loading via ajax # gustaf neumann, fecit may 2006 -::xowiki::Page requireJS "/resources/xowiki/get-http-object.js" +::xo::Page requireJS "/resources/xowiki/get-http-object.js" if {![string match "/*" $portlet]} { set folder_id [$__including_page set parent_id] set package_id [$folder_id set package_id] Index: openacs-4/packages/xowiki/www/view-book.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-book.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/xowiki/www/view-book.tcl 30 Mar 2007 10:01:57 -0000 1.5 +++ openacs-4/packages/xowiki/www/view-book.tcl 28 Sep 2007 20:34:07 -0000 1.6 @@ -19,4 +19,4 @@ set page_title "

$title

" } } -set header_stuff [::xowiki::Page header_stuff] +set header_stuff [::xo::Page header_stuff] Index: openacs-4/packages/xowiki/www/portlets/calendar-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/calendar-portlet.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/www/portlets/calendar-portlet.tcl 25 Feb 2006 13:36:24 -0000 1.2 +++ openacs-4/packages/xowiki/www/portlets/calendar-portlet.tcl 28 Sep 2007 20:34:07 -0000 1.3 @@ -1,5 +1,5 @@ # -::xowiki::Page requireCSS "/resources/calendar/calendar.css" +::xo::Page requireCSS "/resources/calendar/calendar.css" set date [dt_sysdate] proc my_get_url_stub {args} { Index: openacs-4/packages/xowiki/www/portlets/include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/include.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/portlets/include.tcl 29 Dec 2006 11:01:36 -0000 1.3 +++ openacs-4/packages/xowiki/www/portlets/include.tcl 28 Sep 2007 20:34:07 -0000 1.4 @@ -1,4 +1,4 @@ #ns_log notice "--including_page= $__including_page, portlet=$portlet" set content [$__including_page include_portlet $portlet] -set header_stuff [::xowiki::Page header_stuff] +set header_stuff [::xo::Page header_stuff] template::set_file [file dir $__adp_stub]/plain-include Index: openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/weblog-mini-calendar.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl 14 Sep 2007 09:32:25 -0000 1.9 +++ openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl 28 Sep 2007 20:34:07 -0000 1.10 @@ -1,4 +1,4 @@ -::xowiki::Page requireCSS "/resources/calendar/calendar.css" +::xo::Page requireCSS "/resources/calendar/calendar.css" set package_id [::xo::cc package_id] set folder_id [$__including_page set parent_id] set including_item_id [$__including_page set item_id]