From 0fd785b7d900915a27f5d9b096490e71a0b23455 Mon Sep 17 00:00:00 2001 From: "physikerwelt (Moritz Schubotz)" Date: Sat, 10 Jan 2015 16:26:53 +0100 Subject: [PATCH] Add dependency on mediawiki.toolbar Follows-up Ibcda91bbb164b0. ext.math.editbutton.enabler uses mw.toolbar. The toolbar interface used to be part of mediawiki.action.edit but is now in its own module. Bug: T86235 Change-Id: I37a0b8e84a9bd6a0de0386d5b9924bbbbbd7249c --- Math.php | 3 --- modules/ext.math.editbutton.js | 22 ++++++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Math.php b/Math.php index ad4390b..083c477 100644 --- a/Math.php +++ b/Math.php @@ -496,9 +496,6 @@ $moduleTemplate = array( $wgResourceModules['ext.math.editbutton.enabler'] = array( 'scripts' => 'ext.math.editbutton.js', - 'dependencies' => array( - 'mediawiki.action.edit', - ), 'messages' => array( 'math_tip', 'math_sample', diff --git a/modules/ext.math.editbutton.js b/modules/ext.math.editbutton.js index b5d9fbd..c2742d5 100644 --- a/modules/ext.math.editbutton.js +++ b/modules/ext.math.editbutton.js @@ -1,11 +1,13 @@ ( function ( mw ) { - var iconPath = mw.config.get( 'wgExtensionAssetsPath' ) + '/Math/images/'; - mw.toolbar.addButton( { - imageFile: iconPath + 'button_math.png', - speedTip: mw.msg( 'math_tip' ), - tagOpen: '', - tagClose: '', - sampleText: mw.msg( 'math_sample' ), - imageId: 'mw-editbutton-math' - } ); -} ( mediaWiki ) ); + 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: '', + tagClose: '', + sampleText: mw.msg( 'math_sample' ), + imageId: 'mw-editbutton-math' + } ); + } +}( mediaWiki ) );