openacs_bootstrap5_theme::resource_info (private)
openacs_bootstrap5_theme::resource_info [ -version version ]
Defined in packages/openacs-bootstrap5-theme/tcl/resource-procs.tcl
Get information about available version(s) of the bootstrap packages. The goal is to deliver resources either from the local filesystem, or from CDN.
- Switches:
- -version (optional)
- Returns:
- dict containing resourceDir, resourceName, cdn, cdnHost, prefix, cssFiles, jsFiles and extraFiles.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: variable parameter_info if {$version eq ""} { dict with parameter_info { set version [::parameter::get_global_value -package_key $package_key -parameter $parameter_name -default $default_value] } } # # Provide paths for loading either via /resources/ or CDN # # "resourceDir" is the absolute path in the filesystem # "versionSegment" is the version-specific element both in the # URL and in the filesystem. # set resourceDir [acs_package_root_dir openacs-bootstrap5-theme/www/resources/bootstrap] set versionSegment $version set cdn //cdnjs.cloudflare.com/ajax/libs/bootstrap if {[file exists $resourceDir/$versionSegment]} { set prefix /resources/openacs-bootstrap5-theme/bootstrap/$version set cdnHost "" set cspMap "" } else { # # Use CDN # set prefix $cdn/$version set cdnHost cdnjs.cloudflare.com dict set cspMap urn:ad:css:bootstrap5 style-src $cdnHost dict set cspMap urn:ad:css:bootstrap5 font-src $cdnHost dict set cspMap urn:ad:js:bootstrap5 script-src $cdnHost } lappend result resourceName "Bootstrap 5" resourceDir $resourceDir versionSegment $versionSegment cdn $cdn cdnHost $cdnHost prefix $prefix cssFiles {css/bootstrap.min.css css/bootstrap.min.css.map} jsFiles {js/bootstrap.bundle.min.js js/bootstrap.bundle.min.js.map} extraFiles {} urnMap { urn:ad:css:bootstrap5 css/bootstrap.min.css urn:ad:js:bootstrap5 js/bootstrap.bundle.min.js } cspMap $cspMap versionCheckAPI {cdn cdnjs library bootstrap count 1} vulnerabilityCheck {service snyk library bootstrap} parameterInfo $parameter_info configuredVersion $version #urn:ad:js:popper2 dist/umd/popper.min.js return $resultXQL Not present: Generic, PostgreSQL, Oracle