Extension:TinyMCE MW

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
TinyMCE_MW

Release status: experimental

TinyMCE MW WYSIWYG.png
Implementation Extended syntax
Description Edit without WikiText
Author(s) Joseph P. Socoloski III, Justin West
Last version 0.5.4 (2012-06-21)
MediaWiki 1.20alpha
Database changes no
License GNU Lesser General Public License
Download Project page

Git [Help]
Commit history
Note:
No localisation updates are provided by translatewiki.net.

Parameters

$wgTinymceTheme, $wgExt_valid_elements, $wgDefaultUserOptions ['showtoolbar']

Hooks used
ParserBeforeStrip

ParserAfterTidy
EditPage::showEditForm:initial
ArticleAfterFetchContent

Check usage and version matrix

Contents

Note [edit]

This extension enables Moxiecode's TinyMCE Editor in mediawiki pages and does not break a majority of Mediawiki wikitext. TinyMCE is not naturally a Wikitext editor. TinyMCE is a javascript WYSIWYG editor. With this extension, you can easily use TinyMCE with Mediawiki and provide users with a toolbar editor they may be more familiar with. This extension was originally developed by Joseph P. Socoloski III. I have been working on making it compatible with the newest version of MediaWiki 1.20alpha. I have not tested it with earlier versions. The previous version still exists on the Extension_talk:TinyMCE_MW page. The old version was tested with TinyMCE 3.3.x. Jwestyp (talk) 20:13, 21 June 2012 (UTC)

Installation [edit]

  1. The download link contains a full repository that contains Moxiecode's TinyMCE Version 3.3.9.
  2. Download the package from https://github.com/jwestyp/TinyMCE_MW
  3. Place in your extensions directory, i.e. http://www.domain.com/w/extensions/.
  4. Include the following lines in your LocalSettings.php file. Make sure paths are correct to your instance.

Standard LocalSettings.php configuration example:

## TinyMCE_MW.php: Easily implement Moxiecode's TinyMCE into MediaWiki ##
require_once("$IP/extensions/TinyMCE_MW/TinyMCE_MW.php");       //Extension php file location
$wgUseTinymce = true;                                           //Init needed for clicking on a new article link
$wgDefaultUserOptions ['showtoolbar'] = 0;                      //Disable the standard wiki edit toolbar without editing your DefaultSettings.php file
$wgTinymceTheme = "msword";                                     //Options are "simple", "advanced", "msword"
$wgMyWikiURL = "$wgServer/$wgScriptPath/";                      //Configuration setting for link URLs
$wgExt_valid_elements = "data[table|template],repeat[table|sort],categorytree[mode|depth],inputbox[type|bgcolor|width|default|preload|editintro|buttonlabel|searchbuttonlabel|break],big";                                                      //Global variable for valid MediaWiki Elements to be passed to the TinyMCE_MW.php file
## End TinyMCE Configruation ##

Parameters [edit]

$wgUseTinymce True to enable TinyMCE by default, False if not.
$wgDefaultUserOptions ['showtoolbar'] 0 = Mediawiki edit toolbar disabled for new users,
1 = Mediawiki edit toolbar enabled for new users
To disable the Mediawiki editor toolbar instantly you must modify DefaultSettings.php
$wgTinymceTheme "simple", "advanced", "msword", else none
This tells TinyMCE which theme you want to use. You may see how things work by looking at TinyMCE_MW.php
$wgMyWikiURL This is used to set your default path so TinyMCE linking works.
$wgExt_valid_elements Pass your extended_valid_elements using this global variable.


Limitations and Bug/Error [edit]

  • It is recommended you do not install this on an existing Wiki unless you are willing to re-write articles. There are some problems with existing wikitext being reformatted.
  • Does not support Wikitext Bullet list.
  • Does not support Wikitext Numbered list.
  • Does not support Wikitext Redirect to another article.
  • Does not support Wikitext Tables.
  • Does not support h1 tags because "|=.*?=|is" grabs too much. Just manually use h1 tags.
    • you could easily use this: "|(?<!=)=[^=]+=(?!=)|" to support h1 tags -- Rabbitt 18:26, 18 April 2008 (UTC)

Future [edit]

Since this extension uses TinyMCE 3.3.9, I will begin a process to implement the newest version of TinyMCE. TinyMCE is a WYSIWYG HTML editor, and as such, it does not parse WikiText. The new extension Extension:VisualEditor will be able to handle parsing of WikiText and provide a more organic editing experience.

See also [edit]