Index: openacs-4/packages/highcharts/tcl/resource-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/highcharts/tcl/resource-procs.tcl,v diff -u -r1.1.2.18 -r1.1.2.19 --- openacs-4/packages/highcharts/tcl/resource-procs.tcl 30 Jul 2024 10:25:44 -0000 1.1.2.18 +++ openacs-4/packages/highcharts/tcl/resource-procs.tcl 11 Aug 2024 07:34:45 -0000 1.1.2.19 @@ -62,6 +62,11 @@ set prefix /resources/highcharts/$version/code set cdnHost "" set cspMap "" + dict set URNs urn:ad:js:highcharts $prefix/highcharts.js + dict set URNs urn:ad:js:highcharts-more $prefix/highcharts-more.js + dict set URNs urn:ad:js:highcharts/modules/exporting $prefix/modules/exporting.js + dict set URNs urn:ad:js:highcharts/modules/accessibility $prefix/modules/accessibility.js + } else { # # Use CDN @@ -72,11 +77,12 @@ script-src $cdnHost }}] # + # Use minified versions from CDN # - # Other potential sources: - # - # https://www.highcharts.com/blog/download/ - # https://www.jsdelivr.com/package/npm/highcharts + dict set URNs urn:ad:js:highcharts $prefix/highcharts.min.js + dict set URNs urn:ad:js:highcharts-more $prefix/highcharts-more.min.js + dict set URNs urn:ad:js:highcharts/modules/exporting $prefix/modules/exporting.min.js + dict set URNs urn:ad:js:highcharts/modules/accessibility $prefix/modules/accessibility.min.js } # @@ -95,7 +101,7 @@ https://code.highcharts.com/zips/Highcharts-$version.zip }] \ cspMap $cspMap \ - urnMap {} \ + urnMap $URNs \ versionCheckAPI {cdn cdnjs library highcharts count 5} \ vulnerabilityCheck {service snyk library highcharts} \ parameterInfo $parameter_info \ @@ -149,44 +155,8 @@ -destination $resourceDir/$versionSegment } } - - ad_proc -private ::highcharts::register_urns {} { - Register URNs either with local or with CDN URLs. - } { - set resource_info [::highcharts::resource_info] - set prefix [dict get $resource_info prefix] - - if {[dict exists $resource_info cdnHost] && [dict get $resource_info cdnHost] ne ""} { - # - # Settings for the CDN, in case it differs - # - dict set URNs urn:ad:js:highcharts $prefix/highcharts.min.js - dict set URNs urn:ad:js:highcharts-more $prefix/highcharts-more.min.js - dict set URNs urn:ad:js:highcharts/modules/exporting $prefix/modules/exporting.min.js - dict set URNs urn:ad:js:highcharts/modules/accessibility $prefix/modules/accessibility.min.js - - } else { - # - # Settings for local installs - # - dict set URNs urn:ad:js:highcharts $prefix/highcharts.js - dict set URNs urn:ad:js:highcharts-more $prefix/highcharts-more.js - dict set URNs urn:ad:js:highcharts/modules/exporting $prefix/modules/exporting.js - dict set URNs urn:ad:js:highcharts/modules/accessibility $prefix/modules/accessibility.js - } - - foreach {URN resource} $URNs { - template::register_urn \ - -urn $URN \ - -resource $resource \ - -csp_list [expr {[dict exists $resource_info cspMap $URN] - ? [dict get $resource_info cspMap $URN] - : ""}] - } - } } - # Local variables: # mode: tcl # tcl-indent-level: 4