Merge "Editbutton for math"
This commit is contained in:
commit
ea48a4442f
|
@ -270,4 +270,14 @@ class MathHooks {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @global type $wgOut
|
||||
* @param type $toolbar
|
||||
*/
|
||||
static function onEditPageBeforeEditToolbar( &$toolbar ) {
|
||||
global $wgOut;
|
||||
$wgOut->addModules( array( 'ext.math.editbutton.enabler' ) );
|
||||
}
|
||||
}
|
||||
|
|
9
Math.php
9
Math.php
|
@ -163,6 +163,7 @@ $wgHooks['LoadExtensionSchemaUpdates'][] = 'MathHooks::onLoadExtensionSchemaUpda
|
|||
$wgHooks['ParserTestTables'][] = 'MathHooks::onParserTestTables';
|
||||
$wgHooks['UnitTestsList'][] = 'MathHooks::onRegisterUnitTests';
|
||||
$wgHooks['PageRenderingHash'][] = 'MathHooks::onPageRenderingHash';
|
||||
$wgHooks['EditPageBeforeEditToolbar'][] = 'MathHooks::onEditPageBeforeEditToolbar';
|
||||
|
||||
$dir = __DIR__ . '/';
|
||||
$wgAutoloadClasses['MathHooks'] = $dir . 'Math.hooks.php';
|
||||
|
@ -419,6 +420,14 @@ $moduleTemplate = array(
|
|||
'remoteExtPath' => 'Math/modules',
|
||||
);
|
||||
|
||||
$wgResourceModules['ext.math.editbutton.enabler'] = array(
|
||||
'scripts' => 'ext.math.editbutton.js',
|
||||
'messages' => array(
|
||||
'math_tip',
|
||||
'math_sample',
|
||||
),
|
||||
) + $moduleTemplate;
|
||||
|
||||
$wgResourceModules['ext.math.visualEditor'] = array(
|
||||
'scripts' => array(
|
||||
'VisualEditor/ve.dm.MWMathNode.js',
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 617 B |
|
@ -0,0 +1,13 @@
|
|||
( function ( mw ) {
|
||||
if ( mw.toolbar ) {
|
||||
var iconPath = mw.config.get( 'wgExtensionAssetsPath' ) + '/Math/images/';
|
||||
mw.toolbar.addButton( {
|
||||
imageFile: iconPath + 'button_math.png',
|
||||
speedTip: mw.msg( 'math_tip' ),
|
||||
tagOpen: '<math>',
|
||||
tagClose: '</math>',
|
||||
sampleText: mw.msg( 'math_sample' ),
|
||||
imageId: 'mw-editbutton-math'
|
||||
} );
|
||||
}
|
||||
} ( mediaWiki ) );
|
Loading…
Reference in New Issue