mediawiki-extensions-Math/MathChemSymbolsDataModule.php
libraryupgrader fab259540f build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
The following sniffs are failing and were disabled:
* Generic.Files.OneObjectStructurePerFile.MultipleFound
* Squiz.Scope.MethodScope.Missing

The following sniffs now pass and were enabled:
* MediaWiki.Files.OneClassPerFile.MultipleFound

Change-Id: Ib51d7ec178a897cc62fd4d0143874b7bf8082f92
2017-12-30 01:27:41 +00:00

36 lines
838 B
PHP

<?php
/**
* Resource loader module providing extra data from the server to Chem.
*
* @file
* @ingroup Extensions
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
class MathChemSymbolsDataModule extends ResourceLoaderModule {
/* Protected Members */
protected $origin = self::ORIGIN_USER_SITEWIDE;
protected $targets = [ 'desktop', 'mobile' ];
/* Methods */
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;
}
}