Extension:VisualEditor

The 地对地导弹 VisualEditor project aims to create a reliable rich-text editor for MediaWiki. More information can be found on the project page; this page is just about the extension itself. The extension relies on the separate nodeJS-based Parsoid parser service to be up and running in order to edit pages. Stable release is planned for 2014.

Basic setup instructions
With the "basic setup" (without the Parsoid node.js service, but with Parsoid helper extension, if required) you can experiment with this extension on your own wiki. To do this add the following lines to your wiki's  after you have downloaded the extension:

Congratulations, you should now have VisualEditor up and running, with two edit tabs – one for the standard wikitext editor and the other for VisualEditor.

Without the Parsoid node.js service you will not be able to edit existing pages or save pages!

Note for MediaWiki 1.23 users
For MediaWiki 1.23, as well as the Parsoid nodejs service, you will also need to install the the Parsoid PHP extension or VisualEditor will fail to load.

Setup a Parsoid service
If you want to be able to edit existing pages and save pages with VisualEditor you need a Parsoid service.

To setup your own Parsoid service follow the Parsoid installation instructions first.

Linking with Parsoid
To get VisualEditor to talk to the parser, add the following code to your  to specify your Parsoid instance:

Additionally, if you want to use a Parsoid instance with a wiki that isn't running on localhost, you will need to edit the following line (the default is fine for most people's configurations):

Linking with Parsoid in private wikis
ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS of sending Cookie headers to Parsoid over HTTP!

Troubleshooting

 * parsoidserver-http-curl-error : Failed to connect to .... : Permission denied.
 * Can be caused by a cURL request on a Security-Enhanced Linux (SELinux, like CentOS) to a non standard port like 8000 in the example configuration above, see http://www.akashif.co.uk/php/curl-error-7-failed-to-connect-to-permission-denied


 * parsoidserver-http-bad-status : 401
 * Caused by read or edit restrictions. If you've set up a private wiki and don't want to use cookie forwarding, you can explicitly remove restrictions for Parsoid by IP address.


 * parsoidserver-http-not-found : 404 (or timeout)
 * Caused by wrong path to MediaWiki API endpoint. Set correct url to the right path to  in Parsoid's   config file. If you have set up following the recommendations, your API path would be "http://localhost/w/api.php". Add this API path to "localsettings.js" like "parsoidConfig.setInterwiki( 'localhost', 'http://localhost/w/api.php' );".