jenkins-bot has submitted this change and it was merged.
Change subject: Fix preview of MathRendering
......................................................................
Fix preview of MathRendering
The FormulaInfo page did not render the fallback images
correctly.
This change introduces a custom style for this task.
Change-Id: Ie12a60aef5b6bd44c4125bc1c5cdbc5bf5016684
---
M FormulaInfo.php
M MathSearch.php
A ext.mathsearch.css
3 files changed, 19 insertions(+), 3 deletions(-)
Approvals:
Physikerwelt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/FormulaInfo.php b/FormulaInfo.php
index b75c1c9..fcf71f5 100644
--- a/FormulaInfo.php
+++ b/FormulaInfo.php
@@ -57,6 +57,7 @@
public function DisplayInfo( $oldID, $eid ) {
global $wgMathDebug, $wgExtensionAssetsPath;
$out = $this->getOutput();
+ $out->addModuleStyles( array( 'ext.mathsearch.styles' ) );
$out->addWikiText( '==General==' );
$out->addWikiText( 'Display information for equation id:' .
$eid . ' on revision:' . $oldID );
$revision = Revision::newFromId( $oldID );
@@ -88,10 +89,10 @@
# $log=htmlspecialchars( $res->math_log );
$out->addHtml( "<br />\n" );
$out->addWikiText( 'SVG (' . self::getlengh( $mo->getSvg() ) .
') :', false );
- $out->addHtml( $mo->getFallbackImage( false , true, '' ) );
+ $out->addHtml( $mo->getFallbackImage( false , 'mwe-math-demo' )
);
$out->addHtml( "<br />\n" );
$out->addWikiText( 'PNG (' . self::getlengh( $mo->getPng() ) .
') :', false );
- $out->addHtml( $mo->getFallbackImage( true , true , '' ) );
+ $out->addHtml( preg_replace( '/mode=\d/', 'mode=0'
,$mo->getFallbackImage( true , 'mwe-math-demo' ) ) );
$out->addHtml( "<br />\n" );
$out->addWikiText( 'Hash : ' . $mo->getMd5(), false );
$out->addHtml( "<br />" );
diff --git a/MathSearch.php b/MathSearch.php
index 060856e..845015a 100644
--- a/MathSearch.php
+++ b/MathSearch.php
@@ -96,4 +96,11 @@
$wgMathUploadEnabled = false;
$wgAutoloadClasses['SpecialMathDownloadResult'] = $dir .
'SpecialMathDownloadResult.php';
$wgSpecialPages['MathDownload'] = 'SpecialMathDownloadResult';
-$wgSpecialPageGroups['MathDownload'] = 'mathsearch';
\ No newline at end of file
+$wgSpecialPageGroups['MathDownload'] = 'mathsearch';
+
+$wgResourceModules['ext.mathsearch.styles'] = array(
+ 'localBasePath' => __DIR__ ,
+ 'remoteExtPath' => 'MathSearch/',
+ 'styles' => 'ext.mathsearch.css',
+ 'targets' => array( 'desktop', 'mobile' ),
+);
\ No newline at end of file
diff --git a/ext.mathsearch.css b/ext.mathsearch.css
new file mode 100644
index 0000000..7cbfacf
--- /dev/null
+++ b/ext.mathsearch.css
@@ -0,0 +1,8 @@
+/*
+ Document : ext.mathsearch.css
+ Author : Physikerwelt (Moritz Schubotz)
+ Description:
+ Shows math output in all browsers.
+*/
+
+.mwe-math-demo { display: inline-block; vertical-align: middle; }
--
To view, visit https://gerrit.wikimedia.org/r/188571
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie12a60aef5b6bd44c4125bc1c5cdbc5bf5016684
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>
Gerrit-Reviewer: Physikerwelt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits