Extension:FCKeditor (by FCKeditor and Wikia)
From MediaWiki.org
|
FCKeditor extension by FCKeditor and Wikia Release status: beta |
|
|---|---|
| Implementation | Page action, Extended syntax, User rights, Skin, Ajax |
| Description | using the FCKeditor (WYSIWYG editor) for editing wiki pages |
| Author(s) | FCKeditor and Wikia |
| MediaWiki | 1.10+ |
| Download | Nightly build |
| Example | Sandbox |
| Hooks used |
UserToggles |
Contents |
[edit] 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.
[edit] Installation
[edit] Download and extract necessary files
First of all, you need to install FCKeditor as MediaWiki extension:
Download FCKeditor extension, unpack it and place in the extensions drectory.
Your directory structure should look similar to the following one:
|- ..
|- docs
|- extensions
|- ...
|- FCKeditor
|- css
|- fckeditor
|- 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
|- images
Please note that inside FCKeditor directory there is another fckeditor directory. FCKeditor holds the whole extension, whilst fckeditor inside holds the rich text editor itself. If you decide some day to upgrade the editor (not the whole MediaWiki extension), remember to extract it into that fckeditor subdirectory.
[edit] Modify configuration file
After you have put the FCKeditor extension in the correct directory, add this line at the end of LocalSettings.php:
require_once $IP . "/extensions/FCKeditor/FCKeditor.php";
[edit] Manual modifications (only for 1.10 - 1.12 users)
[edit] 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:
$wgOut->addHtml( wfHidden( 'wpAutoSummary', $autosumm ) );
if ( $this->isConflict ) {
and replace with:
$wgOut->addHtml( wfHidden( 'wpAutoSummary', $autosumm ) );
if ( $this->isConflict && wfRunHooks( 'EditPageBeforeConflictDiff', array( &$this, &$wgOut ) )) {
[edit] 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:
return count( $attribs ) ? ' ' . implode( ' ', $attribs ) : '';
and add this before the last line (with return statement):
if ( !wfRunHooks( 'SanitizerAfterFixTagAttributes', array( $text, $element, &$attribs ) ) ) {
return '';
}
at the end you should have:
if ( !wfRunHooks( 'SanitizerAfterFixTagAttributes', array( $text, $element, &$attribs ) ) ) {
return '';
}
return count( $attribs ) ? ' ' . implode( ' ', $attribs ) : '';
[edit] More Information
For more information please refer to the official site of the project

