Extension visualeditor – mediawiki gas quality


wfLoadExtension ( ‘VisualEditor’ ); // Enable by default for everybody $wgDefaultUserOptions [ ‘visualeditor-enable’ ] = 1 ; // Optional: Set VisualEditor as the default for anonymous users // otherwise they will have to switch to VE // $wgDefaultUserOptions[‘visualeditor-editor’] = "visualeditor"; // Don’t allow users to disable it $wgHiddenPrefs [] = ‘visualeditor-enable’ ; // OPTIONAL: Enable VisualEditor’s experimental code features #$wgDefaultUserOptions[‘visualeditor-enable-experimental’] = 1;

Note that you can do this before you have installed the Parsoid node.js service to experiment with VE; this will mean that you can try the editor out in ‘create’ mode on your own wiki, but you will not be able to save or edit existing pages.

Per default, the VisualEditor is only enabled for the namespaces "Main", "User", "File" and "Category". It is however possible to add or remove namespaces. There are many ways to do this but it is recommended to use the canonical names defined for the respective namespaces. Note that this is different to MediaWiki core and nearly all extensions.

// This feature requires a non-locking session store. The default session store will not work and // will cause deadlocks (connection timeouts from Parsoid) when trying to use this feature. $wgSessionsInObjectCache = true ; // Forward users’ Cookie: headers to Parsoid. Required for private wikis (login required to read). // If the wiki is not private (i.e. $wgGroupPermissions[‘*’][‘read’] is true) this configuration // variable will be ignored. // // WARNING: ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS // of sending Cookie headers to Parsoid over HTTP. For security reasons, it is strongly recommended // that $wgVirtualRestConfig[‘modules’][‘parsoid’][‘url’] be pointed to localhost if this setting is enabled. $wgVirtualRestConfig [ ‘modules’ ][ ‘parsoid’ ][ ‘forwardCookies’ ] = true ;

Warning: ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS of sending Cookie headers to Parsoid over HTTP! (but see the HTTPS section below) Parsoid Authentication Without Forwarding Cookies [ edit source ]

The forwarding of cookies (and the enabling of $wgSessionsInObjectCache and the forwardCookies property) can be avoided by adding a user (which may be called parsoid) to the wiki and then add the NetworkAuth extension to the wiki with the configuration in "LocalSettings.php" file:

3 4 Allow from 5 Satisfy Any 6 parsoidserver-http-curl-error: couldn’t connect to host. Parsoid is not running, or $wgVirtualRestConfig[‘modules’][‘parsoid’][‘url’] is not set correctly 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 and https://www.centos.org/forums/viewtopic.php?f=47&t=53223&p=225372#p225372 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 api.php in Parsoid’s localsettings.js 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.setMwApi({uri: ‘ http://localhost/w/api.php’ });". No visible error (Appears to load forever) Check the parsoid log file, and consult Parsoid/Troubleshooting. References [ edit source ]