richtext::xinha::add_editor (public)

 richtext::xinha::add_editor [ -conf conf ] [ -version version ] \
    [ -order order ]

Defined in packages/richtext-xinha/tcl/richtext-procs.tcl

Add the necessary JavaScript and other files to the current page. The naming is modeled after "add_script", "add_css", ... but is intended to care about everything necessary, including the content security policies. Similar naming conventions should be used for other editors as well. This function can be as well used from other packages, such e.g. from the xowiki form-fields, which provide a much higher customization.

Switches:
-conf (optional)
-version (optional)
-order (optional, defaults to "10")

Partial Call Graph (max 5 caller/called nodes):
%3 richtext::xinha::initialize_widget richtext::xinha::initialize_widget (public) richtext::xinha::add_editor richtext::xinha::add_editor richtext::xinha::initialize_widget->richtext::xinha::add_editor richtext::xinha::resource_info richtext::xinha::resource_info (public) richtext::xinha::add_editor->richtext::xinha::resource_info security::csp::require security::csp::require (public) richtext::xinha::add_editor->security::csp::require template::add_body_script template::add_body_script (public) richtext::xinha::add_editor->template::add_body_script

Testcases:
No testcase defined.
Source code:
        set resource_info [::richtext::xinha::resource_info -version $version]
        set version [dict $get resource_info configuredVersion]
        set prefix [dict get $resource_info prefix]

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

        #
        # Add required general directives for content security policies.
        #
        security::csp::require script-src 'unsafe-eval'
        security::csp::require -force script-src 'unsafe-inline'

        template::add_body_script -src $prefix/XinhaEasy.js -script $conf
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: