Index: openacs-4/packages/acs-templating/tcl/head-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/head-procs.tcl,v diff -u -r1.45.2.5 -r1.45.2.6 --- openacs-4/packages/acs-templating/tcl/head-procs.tcl 16 Apr 2019 09:28:04 -0000 1.45.2.5 +++ openacs-4/packages/acs-templating/tcl/head-procs.tcl 16 Apr 2019 11:28:35 -0000 1.45.2.6 @@ -119,6 +119,7 @@ {-script ""} {-src ""} {-type "text/javascript"} + {-version ""} } { Add a script to the head section of the document to be returned to the users client. A script library in an external file may only be included @@ -142,6 +143,10 @@ @param src the src attribute of the script tag, i.e. the source url of the script @param type the type attribute of the script tag, e.g. 'text/javascript' + @param version the version of the resource, which will be appended as a query + string to the end of the href (.../filename?ver=...). + Useful to perform 'cache busting' in browser cached resources, + to force retrieval } { if {$defer_p} { @@ -184,6 +189,9 @@ lappend ::template::head::scripts(anonymous) $type "" $charset $defer $async $script $order $crossorigin $integrity } else { + if {$version ne ""} { + set src "$src?ver=$version" + } set ::template::head::scripts($src) [list $type $src $charset $defer $async "" $order $crossorigin $integrity] } } @@ -430,6 +438,7 @@ {-order "0"} {-script ""} {-src ""} + {-version ""} } { Add a script of type 'text/javascript' to the head section of the document to be returned to the users client. This function is a wrapper around @@ -450,6 +459,10 @@ src @param src the src attribute of the script tag, i.e. the source url of the script + @param version the version of the resource, which will be appended as a query + string to the end of the href (.../filename?ver=...). + Useful to perform 'cache busting' in browser cached resources, + to force retrieval @see template::head::add_script } { @@ -460,7 +473,9 @@ -charset $charset \ -script $script \ -order $order \ - -crossorigin $crossorigin -integrity $integrity + -crossorigin $crossorigin \ + -integrity $integrity \ + -version $version } ad_proc -public template::head::add_css {