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
|
|
|
|
*/
|
|
|
|
|
|
|
|
class MathDataModule extends ResourceLoaderModule {
|
|
|
|
|
|
|
|
/* 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 ) {
|
|
|
|
return
|
|
|
|
've.ui.MWMathDialog.static.setSymbols(' .
|
|
|
|
file_get_contents( __DIR__ . '/modules/ve-math/symbols.json' ) .
|
|
|
|
');';
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|