richtext::ckeditor5::add_editor (public)
richtext::ckeditor5::add_editor [ -ck_package ck_package ] \ [ -version version ]
Defined in packages/richtext-ckeditor5/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)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set version_info [::richtext::ckeditor5::version_info -ck_package $ck_package -version $version] if {[dict exists $version_info resources]} { template::head::add_javascript -src [dict get $version_info resources] } else { template::head::add_javascript -src [dict get $version_info cdn] security::csp::require script-src cdn.ckeditor.com security::csp::require style-src cdn.ckeditor.com security::csp::require img-src cdn.ckeditor.com } # # 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