Physikerwelt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/69453


Change subject: Fix: Browser dependent rendering decission
......................................................................

Fix: Browser dependent rendering decission

now done within the java script

Change-Id: I112e4a4fd4d8886b3a029d55a8c0d414a323c1f3
---
M Math.hooks.php
M modules/ext.math.mathjax.enabler.mml.js
2 files changed, 4 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/53/69453/1

diff --git a/Math.hooks.php b/Math.hooks.php
index 88295bc..c8159c2 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -65,14 +65,7 @@
                        // $renderer->addModules(&$parser);
                        $parser->getOutput()->addModules( array( 
'ext.math.mathjax.enabler' ) );
                } elseif ( $wgUseMathJax && $mode == MW_MATH_LATEXML ) {
-                       if(isset($_SERVER['HTTP_USER_AGENT'])){
-                               $UA=$_SERVER['HTTP_USER_AGENT'];
-                       } else
-                       {$UA="undefined"; //required for maitenance script runs
-                       }
-                       if (!preg_match('/Firefox/',$UA)){ //Don't use MathJax 
with Firefox this has to be extenden to other browser that suppert MathML maybe 
a function supports MathML was the correct way to go
-                               $parser->getOutput()->addModules( array( 
'ext.math.mathjax.enabler.mml' ) );
-                       }
+                       $parser->getOutput()->addModules( array( 
'ext.math.mathjax.enabler.mml' ) );
                }
                // Writes cache if rendering was successful
                $renderer->writeCache();
diff --git a/modules/ext.math.mathjax.enabler.mml.js 
b/modules/ext.math.mathjax.enabler.mml.js
index 7629b42..9b681d0 100644
--- a/modules/ext.math.mathjax.enabler.mml.js
+++ b/modules/ext.math.mathjax.enabler.mml.js
@@ -2,6 +2,9 @@
  * From https://en.wikipedia.org/wiki/User:Nageh/mathJax.js
  */
 /*global mathJax:true, MathJax */
+if (navigator.userAgent.search("Firefox") >= 0){
+       return true;
+}
 ( function ( mw, $ ) {
   if ( typeof mathJax === 'undefined' ) {
     mathJax = {};

-- 
To view, visit https://gerrit.wikimedia.org/r/69453
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I112e4a4fd4d8886b3a029d55a8c0d414a323c1f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: LaTeXML
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to