cookieconsent::add_to_page (public)

 cookieconsent::add_to_page [ -version version ] object

Defined in packages/cookie-consent/tcl/cookie-consent-procs.tcl

Add the necessary CSS, JavaScript and CSP to the current page.

Switches:
-version (optional)
Parameters:
object (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_cookie_consent__setup cookie_consent__setup (test cookie-consent) cookieconsent::add_to_page cookieconsent::add_to_page test_cookie_consent__setup->cookieconsent::add_to_page cookieconsent::resource_info cookieconsent::resource_info (public) cookieconsent::add_to_page->cookieconsent::resource_info security::csp::require security::csp::require (public) cookieconsent::add_to_page->security::csp::require template::add_body_script template::add_body_script (public) cookieconsent::add_to_page->template::add_body_script template::head::add_css template::head::add_css (public) cookieconsent::add_to_page->template::head::add_css template::head::add_javascript template::head::add_javascript (public) cookieconsent::add_to_page->template::head::add_javascript cookieconsent::initialize_widget cookieconsent::initialize_widget (public) cookieconsent::initialize_widget->cookieconsent::add_to_page

Testcases:
cookie_consent__setup
Source code:
        set resource_info [resource_info -version $version]

        if {[dict exists $resource_info cdnHost] && [dict get $resource_info cdnHost] ne ""} {
            security::csp::require script-src [dict get $resource_info cdnHost]
            security::csp::require style-src [dict get $resource_info cdnHost]
        }
        set prefix [dict get $resource_info prefix]

        foreach cssFile [dict get $resource_info cssFiles] {
            template::head::add_css -href $prefix/$cssFile
        }
        foreach jsFile [dict get $resource_info jsFiles] {
            template::head::add_javascript -src $prefix/$jsFile
        }

        ::template::add_body_script -script [$object render_js]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: