allwiki首页  
天下维客 你可以修改的网络知识库
首页最近更改优秀条目专题展示电脑科技词典软件学习网络知识电脑安全明星时尚天下百科
 

FCKeditor

天下维客,你可以修改的网络知识库

Jump to: navigation, search

对应中文条目:MediaWiki扩展:FCKeditor

FCKeditor extension
Template:If
Type: Editor and parser extension
Maturity: experimental
MediaWiki: 1.6.5
Version: fck/mw-extension May 2006
Last Update: 16-05-2006
Description: using the FCKeditor for editing wiki pages
MediaWiki extensions


目录

Introduction and features

This is an experimental approach.

  • It may lead to security and technical problems as well as data corruption.
  • It is certainly not recommended to install the extension on a wiki in a production environment.
  • Use a fresh test installation (fresh database name, fresh wiki name, fresh subdirectories) instead.
  • Have a look at the WYSIWYM editor article, in which advantages and disadvantages of such tools in the framework of Wikis are studied thoroughly.

This experiment provides:

  • a semi WYSIWYG editor concept;
  • full WYSIWYG text and table formatting including font and background colors;
  • wiki syntax for links ([[PageTitle]]), category links, images links ([[Image:ImageTitle]]) and extensions like <math> ... </math> or private extensions <your_extension> ... </your_extension>;
  • table of contents, section editing, ...
  • The editor is activated on a per page basis for those pages having the token __USE_EDITOR__ (see Screen shots) on it.
The token remains visible when you edit the page; it can be added with standard wiki techniques and removed with the WYSIWYG editor.

Changelog

  • update: mediawiki version 1.6.2, fckeditor version 2.2 Mafs 20:15, 10 April 2006 (UTC)
  • patch free, true extension version published Mafs 09:48, 14 May 2006 (UTC)
    • small fix in FCKeditor.php Mafs 16:17, 15 May 2006 (UTC)

Restrictions, bugs

  • The text is stored as HTML in the database
  • Removal of unwanted, hidden text properties can be hard job in some cases.
  • Using Netscape 7.1 browser, you cannot use the "browser page-back" navigation function beyond a page, where the WYSIWYG editor was invoked for page editing.
  • Paste function (pasting clipboard content) seems to be prohibited - at least when using Netscape 7.1 browser.
  • "Show preview" function does not work properly.
  • Templates will work if they do only contain wiki syntax.

Integration of the FCKeditor into mediawiki software version 1.6.x

Tested on mediawiki version 1.6.1; 1.6.5 / FCKeditor version 2.2 .

Installing FCKeditor

  1. Get the FCKeditor from http://www.fckeditor.net
  2. Put the package into the subdirectory /FCKeditor of your mediawiki installation.
  3. Add the section

FCKConfig.ToolbarSets["Wiki"] = [
	['Source','-','Save','NewPage','-'],
	['Cut','Copy','Paste','PasteText','PasteWord','-','Print'],
	['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
	['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
	['OrderedList','UnorderedList','-','Outdent','Indent'],
	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
	['Link','Unlink','Anchor'],
	['Image','Table','Rule','Smiley','SpecialChar','PageBreak','UniversalKey'],
	['Style','FontFormat','FontName','FontSize'],
	['TextColor','BGColor'],
	['About']
] ;

to file /FCKeditor/fckconfig.js. Some tools of the fckeditor are disabled.

(For enabling the FCKeditor's built in file browser and upload function see FCKeditor Developer's Guide at the bottom of the page. In this case set "$wgFCKEditorAllow_img_tags = true;" (LocalSettings.php) see below. Note that you completely bypass all security checks of the mediawiki software for uploaded files when using this feature.)


Finally check your FCKeditor installation:

  1. browse to www.yourserver.org/yourwikidir/FCKeditor/_samples/default.html.
  2. You should see something like:

Should you encounter troubles, consult the FCKeditor help pages.

Extension FCKeditor.php

Put the extension code which can be found on this page FCKeditor/extension as FCKeditor.php into the extensions directory of your mediawiki installation.

LocalSettings.php

Add these lines at the end of file LocalSettings.php.


/* Installing this extension may lead to security and technical problems 
 * as well as data corruption.
 */
require_once("extensions/FCKeditor.php");

$wgFCKUseEditor          = false;      // When set to 'true' the FCKeditor is the default editor.
$wgFCKEditorDir          = "FCKeditor";
$wgFCKEditorToken        = "__USE_EDITOR__";  
$wgFCKEditorToolbarSet   = "Wiki";
$wgFCKEditorHeight       = "600";
$wgFCKEditorAllow_a_tags      = false; // <a> </a>
$wgFCKEditorAllow_img_tags    = false; // <img />
$wgFCKexcludedNamespaces = array();    // eg. "8" for disabling the editor within the MediaWiki namespace.

Done.

Next, open a new page for editing and add the token " __use_editor__ ". Save the page. Click again on "edit" and you should see the FCKeditor. In any case keep the warnings in mind when using this extension.

Screen shots

normal view
Enlarge
normal view
edit view
Enlarge
edit view

Related links

对应中文条目:MediaWiki扩展:FCKeditor

原文网址:http://meta.wikimedia.org/wiki/FCKeditor

Personal tools
工具