Merge "Allow core functionality of CodeEditor to be disabled."

This commit is contained in:
Tim Starling 2012-08-14 05:09:05 +00:00 committed by Gerrit Code Review
commit 880d1bb0e5
2 changed files with 7 additions and 1 deletions

View file

@ -2,8 +2,10 @@
class CodeEditorHooks {
static function getPageLanguage( $title ) {
global $wgCodeEditorEnableCore;
// Try CSS/JS
if( $title->isCssOrJsPage() ) {
if( $wgCodeEditorEnableCore && $title->isCssOrJsPage() ) {
if( preg_match( '/\.js$/', $title->getText() ) )
return 'javascript';
if( preg_match( '/\.css$/', $title->getText() ) )

View file

@ -98,3 +98,7 @@ $wgResourceModules['ext.codeEditor.geshi'] = array(
// Experimental feature; not ready yet.
$wgCodeEditorGeshiIntegration = false;
// If this is disabled, CodeEditor will only be available for client-side code
// and extensions, it won't be enabled for standard CSS and JS pages.
$wgCodeEditorEnableCore = true;