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):
- 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 $confXQL Not present: Generic, PostgreSQL, Oracle