mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-15 03:34:10 +00:00
30 lines
729 B
PHP
30 lines
729 B
PHP
<?php
|
|
|
|
/**
|
|
* Resource loader module providing extra data from the server to Chem.
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license MIT
|
|
*/
|
|
class MathChemSymbolsDataModule extends ResourceLoaderModule {
|
|
|
|
protected $origin = self::ORIGIN_USER_SITEWIDE;
|
|
protected $targets = [ 'desktop', 'mobile' ];
|
|
|
|
public function getScript( ResourceLoaderContext $context ) {
|
|
return 've.ui.MWChemDialog.static.setSymbols(' .
|
|
file_get_contents( __DIR__ . '/modules/ve-math/chemSymbols.json' ) .
|
|
');';
|
|
}
|
|
|
|
public function getDependencies( ResourceLoaderContext $context = null ) {
|
|
return [
|
|
'ext.math.visualEditor',
|
|
];
|
|
}
|
|
|
|
public function enableModuleContentVersion() {
|
|
return true;
|
|
}
|
|
}
|