mediawiki-extensions-CodeEd.../CodeEditor.hooks.php
Brion Vibber bf67581924 CodeEditor ext: Add an experimental demo (off by default) mode to edit SyntaxHighlight_GeSHi sections inline using Ace editor
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.
2011-08-04 22:33:59 +00:00

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;
}
}