The CK editor is used in xPages beginning with 8.5.2. Although there is no support for the CK editor in the classic web server, it can be "plugged in" in place of or in addition to the dojo editor.
In the classic web server, the javascript rich text editor controls are generated to the HTML output page using html
templates that reside in the Domino server data directory. Specifically
domino-data-directory/domino/template/dojo-version/dom_richtext.htm
New templates can be added to connect to different rich text editors using a combination of template files, notes.ini settings and browser.cnf changes.
(browser.cnf is in the domino data directory)
Here is an example
dom_richtext_ck.htm file. it was built by copying and modifying the
dom_richtext.htm file to driectly use the CK editor that is installed with 8.5.2.
Save this file as
domino-data-directory/domino/template/dojo-version/dom_richtext_ck.htm directory
The
version is the current dojo version. There may be more than one dojo directories installed. Use the latest, unless you have specifically chosen to configure the server to use a different version of dojo.
&DOMINO_CTRL_HEAD;
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script language="JavaScript" type="text/javascript">
CKEDITOR.config.toolbar_Domino =
[
['Font','FontSize'],
['Bold','Italic','Underline','Strike', '-', 'Subscript','Superscript'],
['TextColor', 'BGColor'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', '-', 'NumberedList','BulletedList'],
['Indent','Outdent', 'Blockquote'],
['MenuPaste'],
['Table', 'HorizontalRule', 'SpecialChar'],
['MenuLink'],
['Maximize', '-', 'Source']
];
CKEDITOR.config.toolbar = "Domino";
CKEDITOR.config.fontSize_sizes='1;2;3;4;5;6;7';
CKEDITOR.config.fontSize_style= { element: 'font', attributes : { 'size' : '#(size)' } };
CKEDITOR.config.font_names = 'Arial;Comic Sans MS;Courier New;Lucida Sans Unicode;Tahoma;Times New Roman;sans-serif;serif;monospace';
CKEDITOR.config.font_style = { element: 'font', attributes : { 'face' : '#(family)' } };
var rteList = new Array();
function GetJSEditorData() {
for (var j=0; j < rteList.length; j++) {
rteList[j](null);
}
return true;
};
</script>
&DOMINO_CTRL_HEAD_END;
&DOMINO_CTRL_FORM_ID;&DOMINO_CTRL_FORMNAME;&DOMINO_CTRL_FORM_ID_END;
&DOMINO_CTRL_POST;GetJSEditorData()&DOMINO_CTRL_POST_END;
&DOMINO_CTRL_BODY;<div class="domino-richtext"><textarea name="tb&DOMINO_CTRL_FLDNAME;" id="tb&DOMINO_CTRL_FLDNAME;">&DOMINO_CTRL_FLDVALUE;</textarea></div>
&DOMINO_CTRL_BODY_END;
&DOMINO_CTRL_FLD_INIT;
<input name="&DOMINO_CTRL_FLDNAME;" type="hidden" value="" ID="&DOMINO_CTRL_FLDNAME;">
<script type="text/javascript">
function get&DOMINO_CTRL_FLDNAME;() {
document.getElementById('&DOMINO_CTRL_FLDNAME;').value = CKEDITOR.instances.tb&DOMINO_CTRL_FLDNAME;.getData();
return true;
}
rteList.push(get&DOMINO_CTRL_FLDNAME;);
</script>
<script type="text/javascript">
CKEDITOR.replace('tb&DOMINO_CTRL_FLDNAME;');
</script>&DOMINO_CTRL_FLD_INIT_END;
Then let the web server know about this file by adding a line to the server's notes.ini:
WebRichTextEditorTemplates=dom_richtext_ck.htm
Note: This INI can be a comma separated list of template names -- so you can have several custom templates.
Finally, choose which browser(s) will use the editor and make an entry in the
domino-data-directory/browser.cnf.
The rule below will use the
dom_richtext_ck.html template for all Chrome, Safari, and MSIE browsers.
Note: you may want to restrict this based on browser version, especially for early version of MSIE.
Property WebRichTextEditorTemplateID Number 0
Rule 1 Chrome
Rule 1 Safari
Rule 1 MSIE
The number value ("1" in the example) matches the relative position (starting at 1) of the control template in the
WebRichTextEditorTemplates list.
Note: values of
WebRichTextEditorTemplateID
0 overrides the design-time choice of rich text item editor for any value other than "Using HTML" in the "Web Access : Display" peroerty. So in the example above, the CK editor will be used for MSIE even it at design time it was set to "Using Java Applet".