mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 07:34:22 +00:00
Merge "Use new ResourceLoader namespace"
This commit is contained in:
commit
9e420ab960
|
@ -13,7 +13,7 @@
|
||||||
"license-name": "GPL-2.0-or-later",
|
"license-name": "GPL-2.0-or-later",
|
||||||
"type": "parserhook",
|
"type": "parserhook",
|
||||||
"requires": {
|
"requires": {
|
||||||
"MediaWiki": ">= 1.36.0"
|
"MediaWiki": ">= 1.39.0"
|
||||||
},
|
},
|
||||||
"AutoloadNamespaces": {
|
"AutoloadNamespaces": {
|
||||||
"MediaWiki\\Extension\\Math\\": "src/"
|
"MediaWiki\\Extension\\Math\\": "src/"
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
namespace MediaWiki\Extension\Math;
|
namespace MediaWiki\Extension\Math;
|
||||||
|
|
||||||
use ResourceLoaderContext;
|
use MediaWiki\ResourceLoader as RL;
|
||||||
use ResourceLoaderModule;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resource loader module providing extra data from the server to Chem.
|
* Resource loader module providing extra data from the server to Chem.
|
||||||
|
@ -11,18 +10,18 @@ use ResourceLoaderModule;
|
||||||
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
class MathChemSymbolsDataModule extends ResourceLoaderModule {
|
class MathChemSymbolsDataModule extends RL\Module {
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
protected $targets = [ 'desktop', 'mobile' ];
|
protected $targets = [ 'desktop', 'mobile' ];
|
||||||
|
|
||||||
public function getScript( ResourceLoaderContext $context ) {
|
public function getScript( RL\Context $context ) {
|
||||||
return 've.ui.MWChemDialog.static.setSymbols(' .
|
return 've.ui.MWChemDialog.static.setSymbols(' .
|
||||||
file_get_contents( __DIR__ . '/../modules/ve-math/chemSymbols.json' ) .
|
file_get_contents( __DIR__ . '/../modules/ve-math/chemSymbols.json' ) .
|
||||||
');';
|
');';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDependencies( ResourceLoaderContext $context = null ) {
|
public function getDependencies( RL\Context $context = null ) {
|
||||||
return [
|
return [
|
||||||
'ext.math.visualEditor',
|
'ext.math.visualEditor',
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
namespace MediaWiki\Extension\Math;
|
namespace MediaWiki\Extension\Math;
|
||||||
|
|
||||||
use ResourceLoaderContext;
|
use MediaWiki\ResourceLoader as RL;
|
||||||
use ResourceLoaderModule;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resource loader module providing extra data from the server to Math.
|
* Resource loader module providing extra data from the server to Math.
|
||||||
|
@ -11,18 +10,18 @@ use ResourceLoaderModule;
|
||||||
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
class MathMathSymbolsDataModule extends ResourceLoaderModule {
|
class MathMathSymbolsDataModule extends RL\Module {
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
protected $targets = [ 'desktop', 'mobile' ];
|
protected $targets = [ 'desktop', 'mobile' ];
|
||||||
|
|
||||||
public function getScript( ResourceLoaderContext $context ) {
|
public function getScript( RL\Context $context ) {
|
||||||
return 've.ui.MWMathDialog.static.setSymbols(' .
|
return 've.ui.MWMathDialog.static.setSymbols(' .
|
||||||
file_get_contents( __DIR__ . '/../modules/ve-math/mathSymbols.json' ) .
|
file_get_contents( __DIR__ . '/../modules/ve-math/mathSymbols.json' ) .
|
||||||
');';
|
');';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDependencies( ResourceLoaderContext $context = null ) {
|
public function getDependencies( RL\Context $context = null ) {
|
||||||
return [
|
return [
|
||||||
'ext.math.visualEditor',
|
'ext.math.visualEditor',
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue