mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-23 23:03:46 +00:00
Merge "Allow core functionality of CodeEditor to be disabled."
This commit is contained in:
commit
880d1bb0e5
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
class CodeEditorHooks {
|
class CodeEditorHooks {
|
||||||
static function getPageLanguage( $title ) {
|
static function getPageLanguage( $title ) {
|
||||||
|
global $wgCodeEditorEnableCore;
|
||||||
|
|
||||||
// Try CSS/JS
|
// Try CSS/JS
|
||||||
if( $title->isCssOrJsPage() ) {
|
if( $wgCodeEditorEnableCore && $title->isCssOrJsPage() ) {
|
||||||
if( preg_match( '/\.js$/', $title->getText() ) )
|
if( preg_match( '/\.js$/', $title->getText() ) )
|
||||||
return 'javascript';
|
return 'javascript';
|
||||||
if( preg_match( '/\.css$/', $title->getText() ) )
|
if( preg_match( '/\.css$/', $title->getText() ) )
|
||||||
|
|
|
@ -98,3 +98,7 @@ $wgResourceModules['ext.codeEditor.geshi'] = array(
|
||||||
|
|
||||||
// Experimental feature; not ready yet.
|
// Experimental feature; not ready yet.
|
||||||
$wgCodeEditorGeshiIntegration = false;
|
$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;
|
||||||
|
|
Loading…
Reference in a new issue