This is an integration of the fast and highly functional CKEditor. It supports a wide range of browsers, including Firefox, IE, Safari, Opera and Google Chrome.
The integration uses the
Foswiki:Extensions.WysiwygPlugin to translate text to and from a format that CKE can edit.
This plugin is able to swap out
standard text areas and replace them with WYSIWYG editors.
Editor Notes
The editor uses a translator module to convert from Foswiki Topic Markup Language (TML) to HTML and back. The translator converts special macros - such as %MACROS% - to Macro Objects, and encloses them within HTML spans using a special style called
WYSIWYG_PROTECTED
. In this way the editor can detect text that is not meant to be HTML formatted. This style is
also used to protect special text you enter into the editor from being interpreted when the topic is translated back into TML.
Installation Instructions
NOTES:
- It requires the very latest revision of WysiwygPlugin. There is still an open Task to do for CKEditor Integration: Task.Task10082. Please have a look there, how to "hack" the old WysiwygPlugin.
- You need to change your edit template file.
- When installed, it replaces the old "textarea" editor. You may still access the plaintext editor with the "Wiki Text" button provided in the toolbar, however this does not necessarily give you the original raw topic content. To bypass the TML to HTML conversion process entirely, use the Raw Edit link provided by the default Foswiki skin at the bottom of the page.
First follow the installation instructions to install the Plugin:
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See
http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Preferences
No preferences are stored in this topic. The example settings here have no effect. To learn more about setting preference variables, see the
PreferenceSettings topic.
CKEPLUGIN_INIT
This variable holds all the options passed to the CK editor on startup. For a full explanation of available CK options, and guidance on reconfiguring CKE, see the
CK Editor Homepage.
The default options are as follows (you will need to remove the newlines for your own CKEDITOR
_INIT string). Note the inclusion of the Pattern Skin standard CSS files in the
content_csssetting.
extraPlugins : "ckefilebrowser,foswiki,toolbars,wikitext,tableresize,qwikisave",
removePlugins : "toolbar,save",
enterMode : "1",
menu_groups : "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,code",
ckefilebrowserUploadUrl : "http://365847.689093.cn/bin/rest/WysiwygPlugin/upload",
foswiki_secret_id : "WYSIWYG content - do not remove this comment, and never use this identical text in your topics",
stylesSet : "modellaachen",
foswiki_vars : { PUBURLPATH : "/pub", PUBURL : "http://365847.689093.cn/pub", WEB : "Extensions", TOPIC : "CKEditorPlugin", ATTACHURL : "http://365847.689093.cn/pub/Extensions/CKEditorPlugin", ATTACHURLPATH : "/pub/Extensions/CKEditorPlugin", VIEWSCRIPTURL : "http://365847.689093.cn", SCRIPTSUFFIX: "", SCRIPTURL : "http://365847.689093.cn/bin", SYSTEMWEB: "System", HTTP_HOST: "365847.689093.cn" },
toolbar_Full : [['WikiText','-','Source'],['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],['Maximize','ShowBlocks','-','About'],'/',['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['wbdroplets','wblink','Link','Unlink','Anchor'],['Code','Document','Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],'/',['Styles','Format','Font','FontSize']],
toolbar_Basic : [['Save', 'Cancel'],['WikiText'],['Undo','Redo','-','Link','Unlink','-','Document','Image','Table'],'/',['Format','-','Bold','Italic','Underline','-','NumberedList','BulletedList','Outdent','Indent','-','Styles']],
toolbar : "Basic",
height : "400"
Settings
Variable |
Default |
Description |
CKEPLUGIN_INIT |
As above |
Holds the initialization parameters used to start CK Editor |
CKEPLUGIN_INIT_browser |
See Browser Specific Settings below |
Add extra parameters to CKEPLUGIN_INIT string for a specific _browser |
NOWYSIWYG |
0 |
If this global setting is set to 1, CKEditorPlugin (and all other WYSIWYG editors) will be disabled. |
Additional CK Editor Plugins
Documentation for standard plugins shipped with CK Editor can be found at
http://ckeditor.com.
Frequently Asked Questions
CKEditorPlugin depends on
WysiwygPlugin to do the conversions from HTML to TML (Topic Markup Language) and back again. For more information, see
WysiwygPlugin.
Known Issues
Plugin Info
This Foswiki Extension is based on
TinyMCEPlugin, written by
CrawfordCurrie.
Warning: The extension does not appear to be released yet, can anyone detail installation instructions?
Support.ManuallyInstallingExtensions doesn't help as there is no
CKEditorPlugin _installer file to be found.
Just installing from
http://svn.foswiki.org/trunk/CKEditorPlugin/ with svn, setting permissions to the local web server user doesn't work. The corrected edit.pattern.tmpl is installed with correct permissions, but still defaults to the
TinyMCE plugin. If
TinyMCE plugin is disabled (which I guess it should be), there is just a blank edit window, no CKEditor. --
NigelOrr - 13 Apr 2012
Some of the config files appear to be copied and not updated from
GenPDFPisaPlugin (e.g. see Config.spec, DEPENDENCIES) --
NigelOrr - 20 Apr 2012