Difference between revisions of "Talk:WYSIWYG"

From Organic Design
(To use ckeditor with mediawiki)
 
(mwforums)
Line 30: Line 30:
  
 
</pre>
 
</pre>
 +
 +
This is from [http://www.mwusers.com/forums/showthread.php?16957-CKEditor-with-MediaWiki mwforums].

Revision as of 05:24, 22 August 2011

To use ckeditor with mediawiki:

download and unpack the source ckeditor package place it in the extensions directory of mediawiki add the following lines to the end of mediawiki LocalSettings.php:


require_once("$IP/extensions/ckeditor/ckeditor.php");

$wgHooks['EditPage::showEditForm:initial'][] = 'showEditForm';
function showEditForm($form){
global $wgOut;
$wgOut->addScriptFile( '/extensions/ckeditor/ckeditor.js' );
$script =
"<script type=\"text/javascript\">
window.onload = function()
{
CKEDITOR.replace( 'wpTextbox1' );
};
if ( window.removeEventListener )
window.removeEventListener( 'load', mwSetupToolbar, false ) ;
else if ( window.detachEvent )
window.detachEvent( 'onload', mwSetupToolbar ) ;
</script>";

$wgOut->addHTML($script);

return true;
} 

This is from mwforums.