2015-09-29 15:44:21 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Resource loader module providing extra data from the server to Math.
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
2017-01-11 21:50:35 +00:00
|
|
|
class MathMathSymbolsDataModule extends ResourceLoaderModule {
|
2015-09-29 15:44:21 +00:00
|
|
|
|
|
|
|
/* Protected Members */
|
|
|
|
|
|
|
|
protected $origin = self::ORIGIN_USER_SITEWIDE;
|
2016-04-12 20:53:25 +00:00
|
|
|
protected $targets = [ 'desktop', 'mobile' ];
|
2015-09-29 15:44:21 +00:00
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
public function getScript( ResourceLoaderContext $context ) {
|
2017-12-30 01:21:11 +00:00
|
|
|
return 've.ui.MWMathDialog.static.setSymbols(' .
|
2017-01-11 21:50:35 +00:00
|
|
|
file_get_contents( __DIR__ . '/modules/ve-math/mathSymbols.json' ) .
|
2015-09-29 15:44:21 +00:00
|
|
|
');';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDependencies( ResourceLoaderContext $context = null ) {
|
2016-04-12 20:53:25 +00:00
|
|
|
return [
|
2015-09-29 15:44:21 +00:00
|
|
|
'ext.math.visualEditor',
|
2016-04-12 20:53:25 +00:00
|
|
|
];
|
2015-09-29 15:44:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function enableModuleContentVersion() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|