richtext::ckeditor4::add_editor (public)
richtext::ckeditor4::add_editor [ -ck_package ck_package ] \ [ -version version ] [ -adapters adapters ] [ -order order ]
Defined in packages/richtext-ckeditor4/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:
- -ck_package (optional)
- -version (optional)
- -adapters (optional)
- -order (optional, defaults to
"10"
)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: if {$ck_package eq ""} { set ck_package ${::richtext::ckeditor4::ck_package} } #ns_log notice "richtext::ckeditor4::add_editor -version $version -ck_package $ck_package" set resource_info [::richtext::ckeditor4::resource_info -ck_package $ck_package -version $version] set version [dict get $resource_info configuredVersion] set prefix [dict get $resource_info prefix] #ns_log notice "richtext::ckeditor4::add_editor loading from $prefix" 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] security::csp::require img-src [dict get $resource_info cdnHost] } #ns_log notice "richtext::ckeditor4::add_editor SRC -src $prefix/$ck_package/ckeditor.js" template::head::add_javascript -order $order -src $prefix/$ck_package/ckeditor.js foreach adapter $adapters { template::head::add_javascript -order $order.1 -src $prefix/$ck_package/adapters/$adapter } # # Add required general directives for content security policies. # security::csp::require script-src 'unsafe-eval' security::csp::require -force script-src 'unsafe-inline' # this is needed currently for "imageUploadUrl" security::csp::require img-src data:XQL Not present: Generic, PostgreSQL, Oracle