mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-17 04:07:57 +00:00
bf67581924
Not ready for prime-time. :) Doesn't actually save pages (just updates the live view), and seems to have problems when invoked multiple times. Not all GeSHi languages are supported. Colors of course are different. Set $wgCodeEditorGeshiIntegration = true to enable; adds a 'section edit link' on source bits.
20 lines
472 B
PHP
20 lines
472 B
PHP
<?php
|
|
|
|
class CodeEditorHooks {
|
|
public static function editPageShowEditFormInitial( &$toolbar ) {
|
|
global $wgOut, $wgTitle;
|
|
if ( $wgTitle->isCssOrJsPage() || $wgTitle->isCssJsSubpage() ) {
|
|
$wgOut->addModules( 'ext.codeEditor' );
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static function onBeforePageDisplay( $out, $skin ) {
|
|
global $wgCodeEditorGeshiIntegration;
|
|
if ( $wgCodeEditorGeshiIntegration ) {
|
|
$out->addModules( 'ext.codeEditor.geshi' );
|
|
}
|
|
return true;
|
|
}
|
|
}
|