From 464886c3cb9831e644e29e0ddd819b7514b9f51b Mon Sep 17 00:00:00 2001 From: Moritz Schubotz Date: Fri, 26 May 2017 18:15:31 +0200 Subject: [PATCH] Add PNG and MathPlayer fallback for Wikidata user In MathML rendering mode custom javascript is executed to check if the brower has MathPlayer installed. In addition it's checked if the browser supports SVG rendering. This functionality was broken in Wikidata, since the scripts were loaded as styles and not as JS modules. Change-Id: I5fd8eafc89e01c6ec10cf0f3b71e885ec3a4399c --- MathWikidataHook.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MathWikidataHook.php b/MathWikidataHook.php index cc14635..5f79bdc 100644 --- a/MathWikidataHook.php +++ b/MathWikidataHook.php @@ -42,6 +42,7 @@ class MathWikidataHook { 'formatter-factory-callback' => function( $format, FormatterOptions $options ) { global $wgOut; $wgOut->addModuleStyles( [ 'ext.math.styles' ] ); + $wgOut->addModules( [ 'ext.math.scripts' ] ); return new MathFormatter( $format ); }, 'rdf-builder-factory-callback' => function ( @@ -71,6 +72,7 @@ class MathWikidataHook { 'formatter-factory-callback' => function( $format, FormatterOptions $options ) { global $wgOut; $wgOut->addModuleStyles( [ 'ext.math.styles' ] ); + $wgOut->addModules( [ 'ext.math.scripts' ] ); return new MathFormatter( $format ); }, ];