Editbutton for math
Move the code that creates the Editbutton for math from core, where it is removed in Ib17aa47c7d647e1ed293541adbdd1aa77e25e59e. Imported button image from: ssh://gerrit.wikimedia.org:29418/mediawiki/core.git/skins/common/button_math.png We don't need to vary the icon per language, because there is not a single language that has a non default icon. Bug: 60471 Change-Id: I3d126c1c252c27fa65ab8fb42ffab66a2d99cfa8
This commit is contained in:
parent
24f2ed2c5e
commit
9f7a1e51c4
|
@ -269,4 +269,14 @@ class MathHooks {
|
||||||
|
|
||||||
return true;
|
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
|
@ -153,6 +153,7 @@ $wgHooks['LoadExtensionSchemaUpdates'][] = 'MathHooks::onLoadExtensionSchemaUpda
|
||||||
$wgHooks['ParserTestTables'][] = 'MathHooks::onParserTestTables';
|
$wgHooks['ParserTestTables'][] = 'MathHooks::onParserTestTables';
|
||||||
$wgHooks['UnitTestsList'][] = 'MathHooks::onRegisterUnitTests';
|
$wgHooks['UnitTestsList'][] = 'MathHooks::onRegisterUnitTests';
|
||||||
$wgHooks['PageRenderingHash'][] = 'MathHooks::onPageRenderingHash';
|
$wgHooks['PageRenderingHash'][] = 'MathHooks::onPageRenderingHash';
|
||||||
|
$wgHooks['EditPageBeforeEditToolbar'][] = 'MathHooks::onEditPageBeforeEditToolbar';
|
||||||
|
|
||||||
$dir = __DIR__ . '/';
|
$dir = __DIR__ . '/';
|
||||||
$wgAutoloadClasses['MathHooks'] = $dir . 'Math.hooks.php';
|
$wgAutoloadClasses['MathHooks'] = $dir . 'Math.hooks.php';
|
||||||
|
@ -403,6 +404,14 @@ $moduleTemplate = array(
|
||||||
'remoteExtPath' => 'Math/modules',
|
'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(
|
$wgResourceModules['ext.math.visualEditor'] = array(
|
||||||
'scripts' => array(
|
'scripts' => array(
|
||||||
'VisualEditor/ve.dm.MWMathNode.js',
|
'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