2011-06-09 21:50:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper to load syntax-highlighting editor for JavaScript and CSS pages
|
|
|
|
* on-wiki.
|
|
|
|
*
|
|
|
|
* Extends and requires WikiEditor extension.
|
|
|
|
*
|
|
|
|
* Extension code is GPLv2 following MediaWiki base.
|
|
|
|
* Ace editor JS code follows its own license, see in the 'ace' subdir.
|
|
|
|
*/
|
|
|
|
|
|
|
|
$wgExtensionCredits['other'][] = array(
|
|
|
|
'path' => __FILE__,
|
|
|
|
'name' => 'CodeEditor',
|
|
|
|
'url' => 'http://www.mediawiki.org/wiki/Extension:CodeEditor',
|
|
|
|
'author' => array( 'Brion Vibber', 'authors of Ace (ajax.org)' ),
|
|
|
|
'descriptionmsg' => 'codeeditor-desc',
|
|
|
|
);
|
|
|
|
|
|
|
|
$dir = dirname( __FILE__ );
|
|
|
|
$wgAutoloadClasses['CodeEditorHooks'] = $dir . '/CodeEditor.hooks.php';
|
|
|
|
$wgExtensionMessagesFiles['CodeEditor'] = $dir . '/CodeEditor.i18n.php';
|
|
|
|
|
|
|
|
$wgHooks['EditPage::showEditForm:initial'][] = 'CodeEditorHooks::editPageShowEditFormInitial';
|
|
|
|
|
2011-06-09 22:17:00 +00:00
|
|
|
$tpl = array(
|
2011-06-09 21:50:45 +00:00
|
|
|
'localBasePath' => dirname( __FILE__ ) . '/modules',
|
|
|
|
'remoteExtPath' => 'CodeEditor/modules',
|
2011-06-10 01:11:18 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2011-06-09 21:50:45 +00:00
|
|
|
);
|
2011-06-09 22:17:00 +00:00
|
|
|
|
|
|
|
$wgResourceModules['ext.codeEditor'] = array(
|
|
|
|
'scripts' => 'ext.codeEditor.js',
|
|
|
|
'dependencies' => array(
|
|
|
|
'ext.wikiEditor',
|
2011-06-10 01:11:18 +00:00
|
|
|
'jquery.codeEditor'
|
|
|
|
),
|
|
|
|
) + $tpl;
|
|
|
|
|
|
|
|
$wgResourceModules['jquery.codeEditor'] = array(
|
|
|
|
'scripts' => 'jquery.codeEditor.js',
|
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.wikiEditor',
|
2011-06-09 22:17:00 +00:00
|
|
|
'ext.codeEditor.ace',
|
|
|
|
),
|
2011-06-16 22:30:01 +00:00
|
|
|
'messages' => array(
|
|
|
|
'codeeditor-toolbar-toggle'
|
|
|
|
)
|
2011-06-09 22:17:00 +00:00
|
|
|
) + $tpl;
|
|
|
|
|
|
|
|
// Minimal bundling of a couple bits of Ace
|
|
|
|
$wgResourceModules['ext.codeEditor.ace'] = array(
|
|
|
|
'scripts' => array(
|
|
|
|
'ace/ace-uncompressed.js',
|
|
|
|
'ace/mode-javascript.js',
|
|
|
|
'ace/mode-css.js',
|
|
|
|
),
|
|
|
|
) + $tpl;
|