Extension:AnyWikiDraw

The AnyWikiDraw extensions adds a  tag to the MediaWiki parser which allows to edit SVG, PNG and JPEG images directly in a page using a Java applet.

This extension is also available for MoinMoin, PmWiki, TWiki, and Foswiki.

Usage
The tag has the following form


 * The tag needs to be put into two curly braces.
 * The name of the tag is
 * The parameter  specifies the name of the image file. If you specify an image file that does not yet exist in your Wiki, the image is created the first time you save a drawing.
 * The image name may have one of the following extensions: svg, png, jpg.
 * The parameter  specifies the width of the image

The parameter specifies the height of the image
To draw the image HappyWiki.svg with a width of 400 pixels and a height of 300 pixels on a page, insert the following tag:

Security considerations
Before installing this extension, please consider whether you want to do the following configuration changes on your MediaWiki installation:


 * You must grant access to session cookies to JavaScript and Java. You may not want to do this if your wiki embeds JavaScript code from untrusted sources. For example if your wiki embeds banners and advertisements from a third party system.


 * You need to allow file upload. You may not want to do this if your wiki allows user account creation by people you do not know.

Installation steps

 * 1) Make sure the StringFunctions and ParserFunctions extensions are installed.
 * 2) Enable cookie access for JavaScript and Java Applets in the LocalSettings.php file.
 * 3) Enable file upload in the LocalSettings.php file.
 * 4) Optional: Install an SVG converter in your MediaWiki installation, for example ImageMagick, and enable it in the LocalSettings.php file. You can omit this step, if you only want to edit PNG and JPEG images.
 * 5) Copy the AnyWikiDraw folder into the   folder of your MediaWiki installation.
 * 6) Enable AnyWikiDraw in the LocalSettings.php file.

Changes to LocalSettings.php
// Enable cookie access for JavaScript and Java Applets $wgCookieHttpOnly = false;

// Enable file upload $wgEnableUploads = true;

// Enable an SVG converter, for example ImageMagick $wgUseImageMagick = true; $wgImageMagickConvertCommand='/opt/local/bin/convert'; $wgSVGConverterPath='/opt/local/bin'; $wgFileExtensions[] = 'svg';

// Enable AnyWikiDraw require_once("$IP/extensions/AnyWikiDraw/AnyWikiDraw.php");

To Do
This extension is in experimental state, because its functionality is incomplete, and because there are some known issues:

Missing functionality

 * Support for the ODG file format is missing. ODG is the Open Document Drawing format used by Open Office, Neo Office and other open source office programs.
 * Support for the TWikiDraw and PmWikiDraw file formats is missing.
 * SVG Color gradients are displayed but can not be edited.
 * SVG Markers are not yet supported.
 * The offline version of AnyWikiDraw is missing.

Known issues

 * Saves silently fail when editing an image without being logged into the wiki.
 * AnyWikiDraw only works with the specified MediaWiki versions.
 * Browsers don't refresh images after they are saved. We need either find a way to clear the image cache of the browser, or to deliver images without letting the browser cache them.
 * Pages which use the drawing tag are not listed as linking to the image file.
 * It is not clear, how we can add support for image formats like ODG .odg, TWikiDraw .draw and PmWikiDraw .draw to MediaWiki.

Links
A demo of the drawing applet can be tried out at http://www.randelshofer.ch/anywikidraw/demo/anywikidraw_for_twiki_demo.html