Extension:FCKeditor (Official)

Intro
This extension enables a more intuitive WYSIWYG editor when editing pages on a MediaWiki-based site. It uses a special version of the FCKeditor WYSIWYG editor that outputs wiki text rather than the usual HTML that caused problems for MediaWiki integrations in the past. See the following link for a working example of this extension in action: http://mediawiki.fckeditor.net/index.php/Main_Page.

It is being jointly developed by the FCKeditor authors and Wikia.

Download the extension
First of all, you need to download and install the MediaWiki extension. Currently you can download this through SVN or get it from: http://mediawiki.fckeditor.net/nightly/svn/mediawiki_fckeditor_ext_N.zip (Size: 1,2 MB). The extension does not contain the editor itself. If you are a UNIX user, you must install the subversion package. If you are a Windows user, read the SVN_Instructions for more details.

On UNIX, you can type the following commands (you must first set the variable MEDIAWIKI_HOME with the base path of your MediaWiki installation ):

$ cd $MEDIAWIKI_HOME $ cd extensions $ svn checkout http://svn.fckeditor.net/MediaWiki/trunk FCKeditor $ find. -name .svn -print | xargs rm -rf {}
 * 1) (wait a few minutes)
 * 1) For security purposes, you should remove the .svn files.
 * 2) You can also configure your webserver to deny access to .svn directories

$ cd $MEDIAWIKI_HOME $ cd extensions $ svn export http://svn.fckeditor.net/MediaWiki/trunk FCKeditor
 * 1) If you don't keep .svn directory you can directly use
 * 1) (wait a few minutes)

Now your directory structure should look similar to the following one: $ cd $MEDIAWIKI_HOME $ tree |- ...  |- FCKeditor |- css |- &lt;b&gt;fckeditor&lt;/b&gt; |- plugins |- FCKeditor.body.php |- fckeditor_config.js     |- FCKeditor.i18n.en.php |- ...      |- FCKeditorParser.body.php |- FCKeditorParserOptions.body.php |- FCKeditor.php |- FCKeditorSajax.body.php |- FCKeditorSkin.body.php Inside the directory extensions/FCKeditor is a directory named fckeditor. The editor is already installed in this directory but you can download and install last version of the editor.
 * - docs
 * - extensions
 * - extensions

Verify/Rename Configuration Files
Verify the files fckeditor_config.js and \plugins\mediawiki\fckplugin.js exist. In case they come with .txt extension, rename the files to .js extension.

Download the editor
Download the editor. You can get this via normal HTTP, via FTP, or via SVN. Examples are given for HTTP and SVN.

Via HTTP, you can get the latest stable version, or you can get the latest nightly build. The example below is on UNIX and for the nightly build (http://www.fckeditor.net/nightly/FCKeditor_N.tar.gz):

$ cd /tmp $ w get http://www.fckeditor.net/nightly/FCKeditor_N.zip $ cd $MEDIAWIKI_HOME $ cd extensions/FCKeditor $ unzip /tmp/FCKeditor_N.zip

Modify configuration file
Place the contents of the FCKeditor folder you have just downloaded in to the folder 'extensions/FCKeditor/'. After you have put the FCKeditor extension in the correct directory, add this line at the end of LocalSettings.php:

Also make sure $wgUseAjax is turned on:

EditPageBeforeEditConflict
In the latest MediaWiki (1.13, SVN version), new hook EditPageBeforeEditConflict is already available. This hook is required to fix WikiText/HTML problems when conflict occurs.

MediaWiki 1.10 - 1.12 users have to add this hook manually.

In includes/EditPage.php, at the end of showEditForm function, find this code: and replace with:

SanitizerAfterFixTagAttributes
In the latest MediaWiki (1.13, SVN version), new hook SanitizerAfterFixTagAttributes is already available. This hook is required to keep templates defining tag attributes.

MediaWiki 1.10 - 1.12 users have to add this hook manually.

In includes/Sanitizer.php, at the end of fixTagAttributes function, find this code: and replace it with:

MediaWiki 1.13
[This zip file] contains all the files necessary for FCKeditor to work seamlessly - including the extension, the editor and all the necessary patches.

Unzip this file into your extensions directory and add the following lines to your [LocalSettings.php]

That's it. It should work.

If you would like to download the older versions from the SVN, read on...

Full details for installing FCKeditor are available at http://mediawiki.fckeditor.net/index.php/FCKeditor_integration_guide.

MediaWiki 1.14 (Patching older FCKeditors)
'' The current Version (14.3.2009) includes the new mw14-directory and works out of the box with 1.14. No patching needed! ''

From version 1.14, mediawiki dropped the Parser_OldPP class which is used by the FCKeditor extension. This issue can be solved quite easily. According to its author, the solution is only a dumbfix but as it is working and as this is the only current way to have this extension working on the current version of mediwiki, it is described it in the following. The raw patch file can be found here (before the developers really find a solution). Mainly this patch basically contains a copy of FCKeditorParser.body.php moved into the mw12/ directory and completed with the old replace_callback function.

In extensions/FCKeditor/FCKeditor.body.php, around line 344 find and replace it with:

In extensions/FCKeditor/FCKeditor.php, around line 30 find and replace it with:

Finally, create a file called /extensions/FCKeditor/mw12/FCKeditorParser.body.php and copy / paste the following code.

More information
For more information please refer to the official site of the project