Extension:Wikiwyg

From MediaWiki.org

Jump to: navigation, search
This extension requires patches to core MediaWiki code . Extensions implemented using patches may be disabled by or interfere with upgrades and security patches. If a suitable alternative without a patch is available, we recommend you use that extension instead.


             

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear app error.png
Wikiwyg

Release status: unstable

Wikiwyg.png
Implementation  Page action
Description A WYSIWYG editor
Author(s)  Ingy döt Net, Casey West, Chris Dent, Matt Liggett, Ryan King, Dave Rolsky, Kang-min Liu, Jason Richey, Bartek Łapiński
Last Version  0.20
License No license specified
Download Download snapshot

Subversion [Help]
Browse source code

check usage (experimental)

Contents

[edit] What is Wikiwyg?

Wikiwyg is a WYSIWYG browser editor framework for wikis. It is designed to be pluggable on top of existing wiki engines, with little or no change to the wiki engine's core software.

Wikiwyg has been successfully integrated with the following wiki engines: Socialtext, Kwiki, MediaWiki, Trac and TWiki.

Wikiwyg is designed to be a modal editor. You can flip back and forth between WYSIWYG and WikiText and Preview modes in a single editing session. Other available/possible modes are Raw-HTML and Multi-User modes. Wikiwyg can even be configured to use just WikiText mode, and still provides many user benefits over a traditional textarea.

Wikiwyg currently supports WYSIWYG mode in Firefox and IE 6+. It supports WikiText mode in those browsers, and Safari as well. In unsupported browsers, a Wikiwyg integration should fall back to the wiki engine's regular edit interface.

[edit] Wikiwyg on MediaWiki

Contains now 3 extensions in the share/MediaWiki/extensions folder (plus additional 2 included in the core file):

  • MediaWikiWyg.php - the glue code that allows MediaWiki to work with Wikiwyg
  • TagCloud - required for the full page editing with Wikiwyg
  • CreatePage - adds the functionality for creating a new page with Wikiwyg in visual mode and a special page, Special:Createpage for this
  • WikiwygEditing - the glue code that allows Wikiwyg for full page editing in MediaWiki too
  • EZParser (included in MediaWikiWyg.php) - adds a simple interface to the MediaWiki Parser. Used to generate the HTML view when switching editing modes.
  • PocketDiff (included in MediaWikiWyg.php) - adds a simple interface to the MediaWiki show changes functionality

[edit] New installation instructions for version 0.20

  1. Download the extension from the MediaWiki SVN at http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/wikiwyg.
  2. Copy all files into the /extensions folder on your wiki.
  3. Apply the patches from /extensions/wikiwyg/share/MediaWiki/mediawiki-1.10.1bleed.patch by executing the following command:
    patch -p0 -i extensions/wikiwyg/share/MediaWiki/mediawiki-1.10.1bleed.patch
    Note: you have to cd to the MediaWiki root directory first (the one with LocalSettings.php in it)
  4. Insert into LocalSettings.php the following line:
require_once ("$IP/extensions/wikiwyg/Wikiwyg.php");

The extension should work now. More information on Wikiwyg v0.20 coming later.

[edit] Parameters

  • $wgWikiwygEnabled — whether to enable Wikiwyg or not. Defaults to true.
  • $wgWysiwygEnabled — enable WYSIWYG editing. Defaults to true.
  • $wgInPageEnabled — required to be true in order for Wikiwyg to work properly. Defaults to true.
  • $wgYuiPath — path to YUI files. Defaults to http://yui.yahooapis.com/2.3.0/build.
  • $wgWikiwygPath — path to Wikiwyg extension files. Defaults to $wgScriptPath . "/extensions/wikiwyg". See below for more info.
  • $wgWikiwygJsPath — path to Wikiwyg JavaScript files. Defaults to $wgWikiwygPath/share/MediaWiki.
  • $wgWikiwygCssPath — path to Wikiwyg CSS files. Defaults to $wgWikiwygPath/share/MediaWiki/css.
  • $wgWikiwygImagePath — path to Wikiwyg images. Defaults to $wgWikiwygPath/share/MediaWiki/images.

[edit] File locations

Wikiwyg looks for files in the root directory by default, but you may easily amend this to fit your needs. Simply set the variable $wgWikiwygPath in your LocalSettings.php file

$wgWikiwygPath = "$wgServer/YOUR_DIRECTORY/wikiwyg";

The $wgServer is the root directory but $wgWikiwygPath is the path defined in the first expression so you don't put the whole path from the root, just the subpaths under the predefined wikiwyg folder

Images are handled separately. For now, it looks like you have to change the path explicitly in the file wikiwyg/share/MediaWiki/MediaWikiWyg.js. Just point to your directory where you see the line

   imagesLocation: '/wikiwyg/share/MediaWiki/images/' 

[edit] See also