Extension:AnyWikiDraw

From MediaWiki.org

Jump to: navigation, search

           

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
AnyWikiDraw drawing editor

Release status: experimental

AnyWikiDraw-Screenshot.png
Implementation  Parser functions, Page action
Description Allows to edit SVG, PNG and JPEG images directly in a page using a Java applet.
Author(s)  Werner Randelshofer
Last Version  0.14
MediaWiki  1.7 – 1.10, 1.12 – 1.15 only
License Client-side code: Creative Commons Attribution 3.0 and/or LGPL,
Server-side code: GPL
Download http://sourceforge.net/projects/anywikidraw

check usage (experimental)

Contents

[edit] What can this extension do?

The AnyWikiDraw extensions adds a {{#drawing:}} 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 PmWiki, TWiki, and Foswiki.

[edit] Usage

The tag has the following form:

{{#drawing:image.svg|width|height}}

  • The tag needs to be put into two curly braces.
  • The name of the tag is #drawing:
  • The parameter image.svg 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 width specifies the width of the image
  • The parameter height 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:

{{#drawing:HappyWiki.svg|400|300}}

[edit] Installation

[edit] 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.

[edit] Installation steps

  1. Enable cookie access for JavaScript and Java Applets in the LocalSettings.php file.
  2. Enable file upload in the LocalSettings.php file.
  3. 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.
  4. Copy the AnyWikiDraw folder into the extensions folder of your MediaWiki installation.
  5. Enable AnyWikiDraw in the LocalSettings.php file.

[edit] 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");

[edit] To Do

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

[edit] 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.

[edit] Known issues

  • 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.

[edit] Links

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