mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 07:34:22 +00:00
Introduce a "MathEnableWikibaseDataType" config
Set to true per default. In order to be able to switch it off in production for a coordinated deployment. Change-Id: I520b2ff1ae6dc3bad4b6067f0b673821d3c01cb4
This commit is contained in:
parent
9625dbc8e5
commit
d955be7eca
|
@ -3,14 +3,20 @@
|
|||
use ValueFormatters\FormatterOptions;
|
||||
use ValueParsers\StringParser;
|
||||
use Wikibase\Repo\Parsers\WikibaseStringValueNormalizer;
|
||||
use Wikibase\Repo\Validators\CompositeValidator;
|
||||
use Wikibase\Repo\WikibaseRepo;
|
||||
|
||||
class MathWikidataHook {
|
||||
/*
|
||||
|
||||
/**
|
||||
* Add Datatype "Math" to the Wikibase Repository
|
||||
*/
|
||||
public static function onWikibaseRepoDataTypes( array &$dataTypeDefinitions ) {
|
||||
global $wgMathEnableWikibaseDataType;
|
||||
|
||||
if ( !$wgMathEnableWikibaseDataType ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$dataTypeDefinitions['PT:math'] = array(
|
||||
'value-type' => 'string',
|
||||
'validator-factory-callback' => function() {
|
||||
|
@ -42,6 +48,12 @@ class MathWikidataHook {
|
|||
* Add Datatype "Math" to the Wikibase Client
|
||||
*/
|
||||
public static function onWikibaseClientDataTypes( array &$dataTypeDefinitions ) {
|
||||
global $wgMathEnableWikibaseDataType;
|
||||
|
||||
if ( !$wgMathEnableWikibaseDataType ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$dataTypeDefinitions['PT:math'] = array(
|
||||
'value-type' => 'string',
|
||||
'formatter-factory-callback' => function( $format, FormatterOptions $options ) {
|
||||
|
|
|
@ -110,6 +110,7 @@
|
|||
"source",
|
||||
"mathml"
|
||||
],
|
||||
"MathEnableWikibaseDataType": true,
|
||||
"Texvc": false,
|
||||
"TexvcBackgroundColor": "transparent"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue