2015-09-29 15:44:21 +00:00
|
|
|
<?php
|
2018-04-13 13:29:59 +00:00
|
|
|
|
2015-09-29 15:44:21 +00:00
|
|
|
/**
|
2017-01-11 21:50:35 +00:00
|
|
|
* Resource loader module providing extra data from the server to Chem.
|
2015-09-29 15:44:21 +00:00
|
|
|
*
|
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2018-04-13 14:04:06 +00:00
|
|
|
* @license MIT
|
2015-09-29 15:44:21 +00:00
|
|
|
*/
|
2017-01-11 21:50:35 +00:00
|
|
|
class MathChemSymbolsDataModule extends ResourceLoaderModule {
|
2015-09-29 15:44:21 +00:00
|
|
|
|
2016-04-12 20:53:25 +00:00
|
|
|
protected $targets = [ 'desktop', 'mobile' ];
|
2015-09-29 15:44:21 +00:00
|
|
|
|
|
|
|
public function getScript( ResourceLoaderContext $context ) {
|
2017-12-30 01:21:11 +00:00
|
|
|
return 've.ui.MWChemDialog.static.setSymbols(' .
|
2018-04-23 13:05:15 +00:00
|
|
|
file_get_contents( __DIR__ . '/../modules/ve-math/chemSymbols.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;
|
|
|
|
}
|
|
|
|
}
|