Index: openacs-4/packages/xowiki/tcl/yui-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/yui-init.tcl,v diff -u -r1.2.2.2 -r1.2.2.3 --- openacs-4/packages/xowiki/tcl/yui-init.tcl 15 Oct 2020 06:38:00 -0000 1.2.2.2 +++ openacs-4/packages/xowiki/tcl/yui-init.tcl 31 Jan 2022 18:38:28 -0000 1.2.2.3 @@ -3,17 +3,17 @@ # set YUI_CSS_PATHS { - assets/skins/sam/skin - base/base - button/assets/skins/sam/button - container/assets/container - datatable/assets/skins/sam/datatable - fonts/fonts-min - grids/grids - menu/assets/skins/sam/menu - reset/reset - reset-fonts-grids/reset-fonts-grids - treeview/assets/skins/sam/treeview + assets/skins/sam/skin + base/base + button/assets/skins/sam/button + container/assets/container + datatable/assets/skins/sam/datatable + fonts/fonts-min + grids/grids + menu/assets/skins/sam/menu + reset/reset + reset-fonts-grids/reset-fonts-grids + treeview/assets/skins/sam/treeview } # @@ -37,7 +37,31 @@ yahoo/yahoo-min } +if {0} { + # + # Downloading YUI files is cumbersome. Therefore this small helper + # that maybe someone else finds helpful if there is some more + # updates (which is not highly likely). + # + # see: https://cdnjs.com/libraries/yui/2.9.0 + # + set version 2.9.0 + set root /usr/local/oacs-5-10/openacs-4/packages/ajaxhelper/www/resources/yui-2.9.0 + foreach path $YUI_CSS_PATHS { + set dir $root/[file join {*}[lrange [file split $path] 0 end-1]] + file mkdir $dir + exec wget -q -P $dir https://cdnjs.cloudflare.com/ajax/libs/yui/2.9.0/$path.css + } + foreach path $YUI_JS_PATHS { + set dir $root/[file join {*}[lrange [file split $path] 0 end-1]] + file mkdir $dir + exec wget -q -P $dir https://cdnjs.cloudflare.com/ajax/libs/yui/2.9.0/$path.js + } +} + + + # # The following asset files is up to my knowledge not available via CDN # @@ -53,31 +77,41 @@ if {[ad_file isdirectory $::acs::rootdir/packages/ajaxhelper/www/resources]} { - foreach path $YUI_CSS_PATHS { - template::register_urn \ - -urn urn:ad:css:yui2:$path \ - -resource /resources/ajaxhelper/yui/$path.css - } + # + # In case, we have yui-2.9.0 then use it, otherwise stick to the old + # version. + # + if {[ad_file isdirectory $::acs::rootdir/packages/ajaxhelper/www/resources/yui-2.9.0]} { + set version yui-2.9.0 + } else { + set version yui + } - foreach path $YUI_JS_PATHS { - template::register_urn \ - -urn urn:ad:js:yui2:$path \ - -resource /resources/ajaxhelper/yui/$path.js - } + foreach path $YUI_CSS_PATHS { + template::register_urn \ + -urn urn:ad:css:yui2:$path \ + -resource /resources/ajaxhelper/$version/$path.css + } + foreach path $YUI_JS_PATHS { + template::register_urn \ + -urn urn:ad:js:yui2:$path \ + -resource /resources/ajaxhelper/$version/$path.js + } + } else { - set version 2.7.0 - foreach path $YUI_CSS_PATHS { - template::register_urn \ - -urn urn:ad:css:yui2:$path \ - -resource //yui.yahooapis.com/$version/build/$path.css - } + set version 2.9.0 + foreach path $YUI_CSS_PATHS { + template::register_urn \ + -urn urn:ad:css:yui2:$path \ + -resource //cdnjs.cloudflare.com/ajax/libs/yui/$version/$path.css + } - foreach path $YUI_JS_PATHS { - template::register_urn \ - -urn urn:ad:js:yui2:$path \ - -resource //yui.yahooapis.com/$version/build/$path.js - } + foreach path $YUI_JS_PATHS { + template::register_urn \ + -urn urn:ad:js:yui2:$path \ + -resource //cdnjs.cloudflare.com/ajax/libs/yui/$version/$path.js + } } #