AnyWikiDraw for MediaWiki
Usage
To include a drawing in a MediaWiki page, write the following tag in the
page:
{{#drawing:drawing.svg|width|height}}
- The tag needs to be put into double curly braces.
- The name of the tag is
#drawing:
- The parameter
drawing.svg
specifies the name of the drawing file.
- The drawing file can have one of the following extensions
.svg
, .png
,
.jpg
.
- If you specify an drawing file that does not yet exist in your Wiki,
the drawing is created the first time you save a drawing.
- The parameter width specifies the width of the drawing.
- The parameter height specifies the height of the drawing.
Security considerations
- This is an experimental extension. Data loss may occur.
Install
it only on a Wiki system that does not contain critical data.
- You need to 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.
F
or example if your wiki embeds banners and advertisements from a third party system.
- You need to allow file upload to your users.
You may not want to do this if your wiki allows user account creation by people not known to you.
Installation instructions
- Enable Cookie access by JavaScript and Java Applets in the
LocalSettings.php
script:
$wgCookieHttpOnly = false;
- Enable file uploading in
LocalSettings.php
script:
$wgEnableUploads = true;
- If you want to use AnyWikiDraw as SVG editor, make sure that you have properly installed and enabled SVG support on your MediaWiki server. For example, if you have installed ImageMagick on your server, you can activate SVG support using the following lines in the
LocalSettings.php
script:
$wgUseImageMagick = true;
$wgImageMagickConvertCommand='/opt/local/bin/convert';
$wgSVGConverterPath='/opt/local/bin';
$wgFileExtensions[] = 'svg';
- Place the AnyWikiDraw folder into
the
extensions
folder of your MediaWiki server.
Please note, that different versions of this extension exist for different versions of MediaWiki.
- To activate this extension add the
following lines to your
LocalSettings.php
script:
require_once("extensions/AnyWikiDraw/AnyWikiDraw.php");
Summary of changes to LocalSettings.php
// Enable cookie access by 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");