2015-09-29 15:44:21 +00:00
|
|
|
<?php
|
|
|
|
/**
|
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
|
|
|
*
|
|
|
|
* @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 MathChemSymbolsDataModule 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 ) {
|
|
|
|
return
|
2017-01-11 21:50:35 +00:00
|
|
|
've.ui.MWChemDialog.static.setSymbols(' .
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|