richtext-procs.tcl

CKEditor 5 integration with the richtext widget of acs-templating. In addition to the richttext widget properties, https://openacs.org/api-doc/proc-view?proc=template::widget::richtext&source_p=1 the CKEditor 5 allows us to specify a editor class Note: CKEditor 5 no longer comes with a configuration setting to change its height. https://stackoverflow.com/questions/46559354/how-to-set-the-height-of-ckeditor-5-classic-editor/46559355#46559355 The current release 1.0.0-alpha.2 not for easy imaging support "Coming soon" This script defines in essence following two procs: ::richtext-ckeditor5::initialize_widget ::richtext-ckeditor5::render_widgets

Location:
packages/richtext-ckeditor5/tcl/richtext-procs.tcl
Created:
2 Dec 2017
Author:
Gustaf Neumann
CVS Identification:
$Id: richtext-procs.tcl,v 1.2 2018/01/19 01:23:35 gustafn Exp $

Procedures in this file

Detailed information

richtext::ckeditor5::add_editor (public)

 richtext::ckeditor5::add_editor [ -ck_package ck_package ] \
    [ -version version ]

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):
%3 richtext::ckeditor5::initialize_widget richtext::ckeditor5::initialize_widget (public) richtext::ckeditor5::add_editor richtext::ckeditor5::add_editor richtext::ckeditor5::initialize_widget->richtext::ckeditor5::add_editor richtext::ckeditor5::version_info richtext::ckeditor5::version_info (public) richtext::ckeditor5::add_editor->richtext::ckeditor5::version_info security::csp::require security::csp::require (public) richtext::ckeditor5::add_editor->security::csp::require template::head::add_javascript template::head::add_javascript (public) richtext::ckeditor5::add_editor->template::head::add_javascript

Testcases:
No testcase defined.

richtext::ckeditor5::download (public)

 richtext::ckeditor5::download [ -ck_package ck_package ] \
    [ -version version ]

Download the CKeditor package in the specified version and put it into a directory structure similar to the CDN structure to allow installation of multiple versions. When the local structure is available, it will be used by initialize_widget. Notice, that for this automated download, the "unzip" program must be installed and $::acs::rootdir/packages/www must be writable by the web server.

Switches:
-ck_package (optional)
-version (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 util::http::get util::http::get (public) util::which util::which (public) richtext::ckeditor5::download richtext::ckeditor5::download richtext::ckeditor5::download->util::http::get richtext::ckeditor5::download->util::which

Testcases:
No testcase defined.

richtext::ckeditor5::get_tag (public)

 richtext::ckeditor5::get_tag [ -options options ]

Return the tag for rendering

Switches:
-options (optional)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

richtext::ckeditor5::initialize_widget (public)

 richtext::ckeditor5::initialize_widget [ -form_id form_id ] \
    [ -text_id text_id ] [ -options options ]

Initialize an CKEditor richtext editor widget.

Switches:
-form_id (optional)
-text_id (optional)
-options (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 apm_package_id_from_key apm_package_id_from_key (public) export_vars export_vars (public) lang::conn::language lang::conn::language (public) parameter::get parameter::get (public) richtext::ckeditor5::add_editor richtext::ckeditor5::add_editor (public) richtext::ckeditor5::initialize_widget richtext::ckeditor5::initialize_widget richtext::ckeditor5::initialize_widget->apm_package_id_from_key richtext::ckeditor5::initialize_widget->export_vars richtext::ckeditor5::initialize_widget->lang::conn::language richtext::ckeditor5::initialize_widget->parameter::get richtext::ckeditor5::initialize_widget->richtext::ckeditor5::add_editor

Testcases:
No testcase defined.

richtext::ckeditor5::render_widgets (public)

 richtext::ckeditor5::render_widgets

Render the ckeditor5 rich-text widgets. This function is created at a time when all rich-text widgets of this page are already initialized. The function is controlled via the global variables ::acs_blank_master(ckeditor5) ::acs_blank_master__htmlareas

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

richtext::ckeditor5::version_info (public)

 richtext::ckeditor5::version_info [ -ck_package ck_package ] \
    [ -version version ]

Get information about available version(s) of CKEditor, either from the local file system, or from CDN.

Switches:
-ck_package (optional)
-version (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 richtext::ckeditor5::add_editor richtext::ckeditor5::add_editor (public) richtext::ckeditor5::version_info richtext::ckeditor5::version_info richtext::ckeditor5::add_editor->richtext::ckeditor5::version_info

Testcases:
No testcase defined.
[ show source ]