[MediaWiki-commits] [Gerrit] Add prefix option to anchor string generator - change (mediawiki...MathSearch)

2014-12-10 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add prefix option to anchor string generator
..

Add prefix option to anchor string generator

Change-Id: I27f181645a12b7f711507091bb4194c8fdbdbcab
---
M MathSearch.hooks.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/79/178979/1

diff --git a/MathSearch.hooks.php b/MathSearch.hooks.php
index 60d99b3..12cd3c5 100644
--- a/MathSearch.hooks.php
+++ b/MathSearch.hooks.php
@@ -207,7 +207,7 @@
if ( preg_match( '#math(.*)?\sid=(?Pid[\w\.]+)#', $Result, 
$matches ) ) {
$rendererId = $matches['id'];
$oldId = self::curId2OldId( $pid );
-   $newID = self::generateMathAnchorString($oldId,$eid);
+   $newID = self::generateMathAnchorString( $oldId, $eid, 
'' );
$Result = str_replace( $rendererId, $newID, $Result );
}
return true;
@@ -225,7 +225,7 @@
return true;
}
 
-   static function generateMathAnchorString($pageID, $anchorID){
-   return #math.$pageID.$anchorID;
+   static function generateMathAnchorString($pageID, $anchorID, $prefix = 
#){
+   return {$prefix}math.$pageID.$anchorID;
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27f181645a12b7f711507091bb4194c8fdbdbcab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Correct wrong variable name - change (mediawiki...Math)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Correct wrong variable name
..

Correct wrong variable name

Change-Id: Iecfa0bfa5861e077d98f7bf06af0e98cda56220b
---
M MathInputCheckTexvc.php
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/MathInputCheckTexvc.php b/MathInputCheckTexvc.php
index 804e52b..9023fc7 100644
--- a/MathInputCheckTexvc.php
+++ b/MathInputCheckTexvc.php
@@ -55,7 +55,6 @@
}
 
/**
-* @global type $wgTexvc
 * @return boolean
 */
public function doValidCheck() {
@@ -94,7 +93,7 @@
return false;
} else {
$this-validTeX = substr( $contents, 1 );
-   $this-isSecure = true;
+   $this-isValid = true;
wfDebugLog( 'Math', 'checkTex successful tex is now: ' 
. $this-validTeX );
 
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iecfa0bfa5861e077d98f7bf06af0e98cda56220b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Remove unused XML namespace - change (mediawiki...Math)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Remove unused XML namespace
..

Remove unused XML namespace

Change-Id: I1c900584aeafbeb5848a3300904710ee312d6223
---
M SpecialMathShowImage.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php
index d919e38..5e70590 100644
--- a/SpecialMathShowImage.php
+++ b/SpecialMathShowImage.php
@@ -123,7 +123,7 @@
 */
private function printSvgError( $msg ) {
global $wgMathDebug;
-   $result =  'svg xmlns=http://www.w3.org/2000/svg; 
xmlns:xlink=http://www.w3.org/1999/xlink; viewBox=0 0 100 4
+   $result =  'svg xmlns=http://www.w3.org/2000/svg; viewBox=0 
0 100 4
  preserveAspectRatio=xMidYMid meet ' .
'text text-anchor=start fill=red y=2' . 
htmlspecialchars( $msg ) . '/text/svg';
if ( $wgMathDebug ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c900584aeafbeb5848a3300904710ee312d6223
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Remove unused global - change (mediawiki...Math)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Remove unused global
..

Remove unused global

Change-Id: I8f5f77015de266f5a5b751fd7cfe424784eb3864
---
M Math.hooks.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/Math.hooks.php b/Math.hooks.php
index 213ac8f..3031d47 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -92,7 +92,6 @@
 * @return array
 */
static function mathTagHook( $content, $attributes, $parser ) {
-   global $wgMathDisableTexFilter;
 
if ( trim( $content ) === '' ) { // bug 8372
return '';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f5f77015de266f5a5b751fd7cfe424784eb3864
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Remove duplicate entry from .gitignore - change (mediawiki...Math)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Remove duplicate entry from .gitignore
..

Remove duplicate entry from .gitignore

Change-Id: I78c7e9b630c6e96a2f125f20461ff9e720754ec4
---
M .gitignore
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/.gitignore b/.gitignore
index 868c8aa..1bda452 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,7 +30,6 @@
 ts
 modules/MathJax/unpacked/jax/output/HTML-CSS/fonts/Gyre-Termes/ # We don't use 
the Gyre
 modules/MathJax/unpacked/jax/output/HTML-CSS/fonts/Latin-Modern/ # We don't 
use the Latin-Modern
-ts
 modules/MathJax/unpacked/jax/output/HTML-CSS/fonts/Neo-Euler/ # We don't use 
the Neo-Euler fonts
 modules/MathJax/unpacked/jax/output/HTML-CSS/fonts/STIX-Web/ # We don't use 
the STIX-Web fonts
 modules/MathJax/unpacked/jax/output/SVG/fonts/STIX

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78c7e9b630c6e96a2f125f20461ff9e720754ec4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Add type hinting for newFromMd5 constructor - change (mediawiki...Math)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add type hinting for newFromMd5 constructor
..

Add type hinting for newFromMd5 constructor

Change-Id: I2989ff42e48e802c1eed1877f0f2ac9316b5fd21
---
M MathRenderer.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/MathRenderer.php b/MathRenderer.php
index 6784ff4..e77adc0 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -105,6 +105,7 @@
 */
public static function newFromMd5( $md5 ) {
$class = get_called_class();
+   /** @var MathRenderer $instance */
$instance = new $class;
$instance-setMd5( $md5 );
$instance-readFromDatabase();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2989ff42e48e802c1eed1877f0f2ac9316b5fd21
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Improve PhpDoc - change (mediawiki...Math)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Improve PhpDoc
..

Improve PhpDoc

Change-Id: I84af65e15bdae81f69f0444afdd9ffa5fe9fc326
---
M MathMathML.php
M MathTexvc.php
2 files changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/MathMathML.php b/MathMathML.php
index 6707059..f07be9e 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -156,7 +156,7 @@
$options = array( 'method' = 'POST', 'postData' = $post, 
'timeout' = $wgMathLaTeXMLTimeout );
/** @var $req (CurlHttpRequest|PhpHttpRequest) the request 
object  */
$req = $httpRequestClass::factory( $host, $options );
-   /** @var Status the request status */
+   /** @var Status $req Status the request status */
$status = $req-execute();
if ( $status-isGood() ) {
$res = $req-getContent();
diff --git a/MathTexvc.php b/MathTexvc.php
index e76100c..562af16 100644
--- a/MathTexvc.php
+++ b/MathTexvc.php
@@ -55,6 +55,7 @@
 
/**
 * @param database_row $rpage
+* @return bool
 */
protected function initializeFromDatabaseRow( $rpage ) {
parent::initializeFromDatabaseRow( $rpage );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84af65e15bdae81f69f0444afdd9ffa5fe9fc326
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Avoid call to method that could be undefined - change (mediawiki...Math)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Avoid call to method that could be undefined
..

Avoid call to method that could be undefined

Change-Id: Ia0514849b57f0e5bc2e8781f4788cff39bec0f79
---
M SpecialMathShowImage.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php
index 5e70590..604f7f2 100644
--- a/SpecialMathShowImage.php
+++ b/SpecialMathShowImage.php
@@ -90,7 +90,7 @@
$success = $this-renderer-render();
}
if ( $success ) {
-   if ( $this-mode == MW_MATH_PNG ) {
+   if ( $this-mode == MW_MATH_PNG  
method_exists( $this, getPng ) ) {
// Workaround for bugfix for Bug 56769
if ( !isset( 
$wgHooks['ParserAfterParse']['FlushMathBackend'] ) ) {
// saves the PNG-file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0514849b57f0e5bc2e8781f4788cff39bec0f79
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Correct phpdoc - change (mediawiki...Math)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Correct phpdoc
..

Correct phpdoc

Change-Id: Ibce076dfb6bd3676e288cf2d762ebcb55606246d
---
M MathRenderer.php
M SpecialMathShowImage.php
2 files changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/MathRenderer.php b/MathRenderer.php
index e77adc0..6282be6 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -100,7 +100,7 @@
 
/**
 *
-* @param type $md5
+* @param string $md5
 * @return MathRenderer the MathRenderer generated from md5
 */
public static function newFromMd5( $md5 ) {
@@ -653,7 +653,7 @@
}
 
/**
-* @return string Userdefined ID
+* @param string user defined ID
 */
public function setID( $id ) {
// Changes in the ID affect the container for the math element 
on the current page
diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php
index 604f7f2..46c24c7 100644
--- a/SpecialMathShowImage.php
+++ b/SpecialMathShowImage.php
@@ -16,8 +16,10 @@
false // Don't show on Special:SpecialPages - it's not 
useful interactively
);
}
+
/**
 * Sets headers - this should be called from the execute() method of 
all derived classes!
+* @param bool $success
 */
function setHeaders( $success = true ) {
$out = $this-getOutput();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibce076dfb6bd3676e288cf2d762ebcb55606246d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] WIP: png support for mathoid - change (mediawiki...mathoid)

2014-12-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: WIP: png support for mathoid
..

WIP: png support for mathoid

Change-Id: I036d52662167a56721dd76f7ba88536f1a276d35
---
A MathJaxNode/batik/CHANGES
A MathJaxNode/batik/LICENSE
A MathJaxNode/batik/NOTICE
A MathJaxNode/batik/README
A MathJaxNode/batik/batik-rasterizer.jar
A MathJaxNode/batik/batik-slideshow.jar
A MathJaxNode/batik/batik-squiggle.jar
A MathJaxNode/batik/batik-svgpp.jar
A MathJaxNode/batik/batik-ttf2svg.jar
A MathJaxNode/batik/batik.jar
A MathJaxNode/batik/docs/.htaccess
A MathJaxNode/batik/docs/broken-links.xml
A MathJaxNode/batik/docs/contributors.html
A MathJaxNode/batik/docs/demo.html
A MathJaxNode/batik/docs/demo/AppletDemo$1.class
A MathJaxNode/batik/docs/demo/AppletDemo$2.class
A MathJaxNode/batik/docs/demo/AppletDemo.class
A MathJaxNode/batik/docs/demo/AppletDemo.java
A MathJaxNode/batik/docs/demo/barChart.svg
A MathJaxNode/batik/docs/demo/batik-awt-util.jar
A MathJaxNode/batik/docs/demo/batik-bridge.jar
A MathJaxNode/batik/docs/demo/batik-css.jar
A MathJaxNode/batik/docs/demo/batik-dom.jar
A MathJaxNode/batik/docs/demo/batik-ext.jar
A MathJaxNode/batik/docs/demo/batik-gvt.jar
A MathJaxNode/batik/docs/demo/batik-parser.jar
A MathJaxNode/batik/docs/demo/batik-script.jar
A MathJaxNode/batik/docs/demo/batik-svg-dom.jar
A MathJaxNode/batik/docs/demo/batik-swing.jar
A MathJaxNode/batik/docs/demo/batik-util.jar
A MathJaxNode/batik/docs/demo/batik-xml.jar
A MathJaxNode/batik/docs/demo/demo.html
A MathJaxNode/batik/docs/demo/xml-apis-dom3.jar
A MathJaxNode/batik/docs/dev/branches.html
A MathJaxNode/batik/docs/dev/index.html
A MathJaxNode/batik/docs/dev/svg12.html
A MathJaxNode/batik/docs/dev/test.html
A MathJaxNode/batik/docs/download.html
A MathJaxNode/batik/docs/faq.html
A MathJaxNode/batik/docs/images/batik.png
A MathJaxNode/batik/docs/images/batikUses.jpg
A MathJaxNode/batik/docs/images/built-with-forrest-button.png
A MathJaxNode/batik/docs/images/group-logo.png
A MathJaxNode/batik/docs/images/instruction_arrow.png
A MathJaxNode/batik/docs/index.html
A MathJaxNode/batik/docs/install.html
A MathJaxNode/batik/docs/jarDependImg.png
A MathJaxNode/batik/docs/license.html
A MathJaxNode/batik/docs/linkmap.html
A MathJaxNode/batik/docs/mailing-lists.html
A MathJaxNode/batik/docs/skin/CommonMessages_de.xml
A MathJaxNode/batik/docs/skin/CommonMessages_en_US.xml
A MathJaxNode/batik/docs/skin/CommonMessages_es.xml
A MathJaxNode/batik/docs/skin/CommonMessages_fr.xml
A MathJaxNode/batik/docs/skin/basic.css
A MathJaxNode/batik/docs/skin/breadcrumbs-optimized.js
A MathJaxNode/batik/docs/skin/breadcrumbs.js
A MathJaxNode/batik/docs/skin/fontsize.js
A MathJaxNode/batik/docs/skin/getBlank.js
A MathJaxNode/batik/docs/skin/getMenu.js
A MathJaxNode/batik/docs/skin/images/README.txt
A MathJaxNode/batik/docs/skin/images/add.jpg
A MathJaxNode/batik/docs/skin/images/built-with-forrest-button.png
A MathJaxNode/batik/docs/skin/images/chapter.gif
A MathJaxNode/batik/docs/skin/images/chapter_open.gif
A MathJaxNode/batik/docs/skin/images/current.gif
A MathJaxNode/batik/docs/skin/images/error.png
A MathJaxNode/batik/docs/skin/images/external-link.gif
A MathJaxNode/batik/docs/skin/images/fix.jpg
A MathJaxNode/batik/docs/skin/images/forrest-credit-logo.png
A MathJaxNode/batik/docs/skin/images/hack.jpg
A MathJaxNode/batik/docs/skin/images/header_white_line.gif
A MathJaxNode/batik/docs/skin/images/info.png
A MathJaxNode/batik/docs/skin/images/instruction_arrow.png
A MathJaxNode/batik/docs/skin/images/label.gif
A MathJaxNode/batik/docs/skin/images/page.gif
A MathJaxNode/batik/docs/skin/images/pdfdoc.gif
A MathJaxNode/batik/docs/skin/images/poddoc.png
A MathJaxNode/batik/docs/skin/images/printer.gif
A MathJaxNode/batik/docs/skin/images/rc-b-l-15-1body-2menu-3menu.png
A MathJaxNode/batik/docs/skin/images/rc-b-r-15-1body-2menu-3menu.png
A 
MathJaxNode/batik/docs/skin/images/rc-b-r-5-1header-2tab-selected-3tab-selected.png
A MathJaxNode/batik/docs/skin/images/rc-t-l-5-1header-2searchbox-3searchbox.png
A 
MathJaxNode/batik/docs/skin/images/rc-t-l-5-1header-2tab-selected-3tab-selected.png
A 
MathJaxNode/batik/docs/skin/images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png
A MathJaxNode/batik/docs/skin/images/rc-t-r-15-1body-2menu-3menu.png
A MathJaxNode/batik/docs/skin/images/rc-t-r-5-1header-2searchbox-3searchbox.png
A 
MathJaxNode/batik/docs/skin/images/rc-t-r-5-1header-2tab-selected-3tab-selected.png
A 
MathJaxNode/batik/docs/skin/images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png
A MathJaxNode/batik/docs/skin/images/remove.jpg
A MathJaxNode/batik/docs/skin/images/rss.png
A MathJaxNode/batik/docs/skin/images/spacer.gif
A MathJaxNode/batik/docs/skin/images/success.png
A MathJaxNode/batik/docs/skin/images/txtdoc.png
A MathJaxNode/batik/docs/skin/images/update.jpg
A MathJaxNode/batik/docs/skin/images/valid-html401.png
A 

[MediaWiki-commits] [Gerrit] Fix wrong case of Id - change (mediawiki...MathSearch)

2014-11-24 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix wrong case of Id
..

Fix wrong case of Id

* in the code snipped fot the documentation ID was used instead of Id

Change-Id: I5520440e3885f4cfdbe32d756ae58e41fa5d3786
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/09/175409/1

diff --git a/i18n/en.json b/i18n/en.json
index 16a8ef1..865207a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -27,7 +27,7 @@
 math-wmc-SelectRun: Name,
 math-wmc-SelectRunHelp : Specify a unique name for your submission, or 
overwrite an existing draft.,
 math-wmc-FileLabel : CSV File,
-math-wmc-FileHelp : Upload your results as ranked, comma separated list 
of (queryId,formulaId)-pairs. A column header of the form 
codequeryID,formulaId/code is required.,
+math-wmc-FileHelp : Upload your results as ranked, comma separated list 
of (queryId,formulaId)-pairs. A column header of the form 
codequeryId,formulaId/code is required.,
 math-wmc-RunAdded: Added submission \$1\ with Id \$2\,
 math-wmc-RunAddError: Error: Cannot add submission \$1\.,
 math-wmc-RunAddExist: Submission named \$1\ already exists with Id 
\$2\,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5520440e3885f4cfdbe32d756ae58e41fa5d3786
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Improve MathSearchUpload to allow for large result sets - change (mediawiki...MathSearch)

2014-11-24 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Improve MathSearchUpload to allow for large result sets
..

Improve MathSearchUpload to allow for large result sets

* Improves the performance of validation.
* Allows to split large results sets to multiple files.

Change-Id: I78a59d50da0e144f25058346b1e65bccc00ecfa1
---
M SpecialUploadResult.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 21 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/71/175471/1

diff --git a/SpecialUploadResult.php b/SpecialUploadResult.php
index bb091f9..9f569cc 100644
--- a/SpecialUploadResult.php
+++ b/SpecialUploadResult.php
@@ -11,6 +11,7 @@
private $warnings = array();
private $results = array();
private $runID = false;
+   private $validQIds = array();
 
public function __construct( $name = 'MathUpload' ) {
parent::__construct( $name );
@@ -41,7 +42,11 @@
'help-message' = 'math-wmc-display-formulae-help',
'type' = 'check',
);
-
+   $formDescriptor['attachResults'] = array(
+   'label-message' = 'math-wmc-attach-results-label',
+   'help-message' = 'math-wmc-attach-results-help',
+   'type' = 'check',
+   );
$htmlForm = new HTMLForm( $formDescriptor, $this-getContext() 
);
$htmlForm-setSubmitCallback( array( $this, 'processInput' ) );
$htmlForm-show();
@@ -140,14 +145,16 @@
return true;
}
 
-   public static function deleteRun( $runID ) {
-   $dbw = wfGetDB( DB_MASTER );
-   $dbw-delete( 'math_wmc_results', array( 'runId' = $runID ) );
+   public function deleteRun( $runID ) {
+   if ( !$this-getRequest()-getBool( wpattachResults ) ) {
+   $dbw = wfGetDB( DB_MASTER );
+   $dbw-delete( 'math_wmc_results', array( 'runId' = 
$runID ) );
+   }
}
 
function processInput(  ) {
$this-getOutput()-addWikiMsg( math-wmc-SubmissionSuccess );
-   self::deleteRun( $this-runID );
+   $this-deleteRun( $this-runID );
$dbw = wfGetDB( DB_MASTER );
//TODO: Find adequate API call
$this-getOutput()-addHTML('table border=1 
style=width:100%
@@ -220,10 +227,15 @@
}
 
private function isValidQId( $qId ) {
+   if( array_key_exists( $qId, $this-validQIds) ){
+   return $this-validQIds[$qId];
+   }
$dbr = wfGetDB( DB_SLAVE );
if ( $dbr-selectField( 'math_wmc_ref', 'qId', array( 'qId' = 
$qId ) ) ) {
+   $this-validQIds[$qId] = true;
return true;
} else {
+   $this-validQIds[$qId] = false;
return false;
}
}
diff --git a/i18n/en.json b/i18n/en.json
index 865207a..ec96c8e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -22,6 +22,8 @@
 mathmode_6: MW_MATH_MATHJAX,
 mathmode_7: MW_MATH_LATEXML,
 mathmode_7+: MW_MATH_LATEXML_JAX,
+   math-wmc-attach-results-help: Sometimes a single run contains to 
manny results for one file upload. In that case the upload has to be split into 
several files.,
+   math-wmc-attach-results-label:Attach more results to existing run,
 math-wmc-Introduction:Upload your submission to the current NTCIR 
Wikipedia Math Search Task here:,
 math-wmc-SectionRun : Submission information,
 math-wmc-SelectRun: Name,
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 971faca..180e8c2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -15,6 +15,8 @@
getequationsbyquery: {{doc-special|GetEquationByQuery}},
xquerygenerator: {{doc-special|XQueryGenerator}},
mathdebug: {{doc-special|MathDebug}},
+   math-wmc-attach-results-help: Form label help text,
+   math-wmc-attach-results-label:Form label,
math-wmc-Introduction: Used as introduction for the upload form,
math-wmc-SectionRun: Form group name,
math-wmc-SelectRun: Form label\n{{Identical|Name}},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78a59d50da0e144f25058346b1e65bccc00ecfa1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] Fix Mathoid integration test - change (mediawiki...Math)

2014-11-24 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix Mathoid integration test
..

Fix Mathoid integration test

The update to the most recent mathoid version changed some
internals of the SVG rendering.

Change-Id: I312d6226c6f24c84254b99ee6292564a421133c3
---
M tests/MathMathMLTest.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/tests/MathMathMLTest.php b/tests/MathMathMLTest.php
index aedaefe..d35776a 100644
--- a/tests/MathMathMLTest.php
+++ b/tests/MathMathMLTest.php
@@ -122,9 +122,10 @@
 */
public function testIntegration() {
global $wgMathMathMLTimeout;
+   // JENKINS TEST JOB
$svgRef = '?xml version=1.0 standalone=no?
 !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN 
http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;
-svg xmlns:xlink=http://www.w3.org/1999/xlink; style=vertical-align: 
-0.333ex; margin-left: 0ex; margin-right: 0ex; margin: 1px 0px; 
width=5.167ex height=1.833ex viewBox=0 -717.9 2195.4 823.9 
xmlns=http://www.w3.org/2000/svg;
+svg xmlns:xlink=http://www.w3.org/1999/xlink; style=vertical-align: 
-0.333ex;  width=5.167ex height=1.833ex viewBox=0 -717.9 2195.4 823.9 
xmlns=http://www.w3.org/2000/svg;
 defs
 path stroke-width=10 id=E1-MJMATHI-61 d=M33 157Q33 258 109 349T280 
441Q331 441 370 392Q386 422 416 422Q429 422 439 414T449 394Q449 381 412 234T374 
68Q374 43 381 35T402 26Q411 27 422 35Q443 55 463 131Q469 151 473 152Q475 153 
483 153H487Q506 153 506 144Q506 138 501 117T481 63T449 13Q436 0 417 -8Q409 -10 
393 -10Q359 -10 336 5T306 36L300 51Q299 52 296 50Q294 48 292 46Q233 -10 172 
-10Q117 -10 75 30T33 157ZM351 328Q351 334 346 350T323 385T277 405Q242 405 210 
374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q217 26 
254 59T298 110Q300 114 325 217T351 328Z/path
 path stroke-width=10 id=E1-MJMAIN-2B d=M56 237T56 250T70 270H369V420L370 
570Q380 583 389 583Q402 583 409 568V270H707Q722 262 722 250T707 230H409V-68Q401 
-82 391 -82H389H387Q375 -82 369 -68V230H70Q56 237 56 250Z/path

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I312d6226c6f24c84254b99ee6292564a421133c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Jenkins Test (do not submit) - change (mediawiki...Math)

2014-11-21 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Jenkins Test (do not submit)
..

Jenkins Test (do not submit)

Change-Id: I0d8c9818fe80316a9df94b84c188d4068d0695d2
---
M tests/MathMathMLTest.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/tests/MathMathMLTest.php b/tests/MathMathMLTest.php
index aedaefe..77899b3 100644
--- a/tests/MathMathMLTest.php
+++ b/tests/MathMathMLTest.php
@@ -122,6 +122,7 @@
 */
public function testIntegration() {
global $wgMathMathMLTimeout;
+   // JENKINS TEST JOB
$svgRef = '?xml version=1.0 standalone=no?
 !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN 
http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;
 svg xmlns:xlink=http://www.w3.org/1999/xlink; style=vertical-align: 
-0.333ex; margin-left: 0ex; margin-right: 0ex; margin: 1px 0px; 
width=5.167ex height=1.833ex viewBox=0 -717.9 2195.4 823.9 
xmlns=http://www.w3.org/2000/svg;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d8c9818fe80316a9df94b84c188d4068d0695d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Improve Math test generation - change (mediawiki...Math)

2014-11-20 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Improve Math test generation
..

Improve Math test generation

* Use the wikitext parser and not regexp to extract math
  tags from the page.
* Extract the attributes from the math tags as well

In a follow up a pseudo attribute in the math tag could
be introduced to provide a bug description.

Change-Id: I0dec18d4e3f87e7b58b097b2a08c4897ceaf29ac
---
M maintenance/MathGenerateTests.php
1 file changed, 6 insertions(+), 10 deletions(-)


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

diff --git a/maintenance/MathGenerateTests.php 
b/maintenance/MathGenerateTests.php
index e942601..9b50a83 100644
--- a/maintenance/MathGenerateTests.php
+++ b/maintenance/MathGenerateTests.php
@@ -36,8 +36,7 @@
 
}
 
-   private static function getMathTagsFromPage( $titleString )
-   {
+   private static function getMathTagsFromPage( $titleString ) {
global $wgEnableScaryTranscluding;
$title = Title::newFromText( $titleString );
if ( $title-exists() ) {
@@ -52,15 +51,12 @@
return 'Page does not exist';
}
}
-   // TODO: find a better way to extract math elements from a page
 
$wikiText = Sanitizer::removeHTMLcomments( $wikiText );
$wikiText = preg_replace( '#nowiki(.*)/nowiki#', '', 
$wikiText );
-   preg_match_all( #math(.*?)/math#s, $wikiText, $math );
-   // TODO: Find a way to specify a key e.g 
'\nRenderTest:(.?)#math(.*?)/math#s\n'
-   // leads to array('\1'-'\2') with \1 eg Bug 2345 and \2 the 
math content
-   return $math[1];
-
+   $math = array();
+   Parser::extractTagsAndParams( array( 'math' ), $wikiText, $math 
);
+   return $math;
}
 
public function execute()
@@ -82,9 +78,9 @@
}
$i = 0;
foreach ( array_slice( $allEquations, $offset, $length, true ) 
as $input ) {
-   $output = MathRenderer::renderMath( $input, array(), 
MW_MATH_PNG );
+   $output = MathRenderer::renderMath( $input[1], 
$input[1], MW_MATH_PNG );
$output = preg_replace( 
'#src=(.*?)/(([a-f]|\d)*).png#', 'src=\2.png', $output );
-   $parserTests[] = array( (string)$input, $output );
+   $parserTests[] = array( (string)$input[1], $output );
$i++;
echo '.';
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0dec18d4e3f87e7b58b097b2a08c4897ceaf29ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Exports the MathCache table - change (mediawiki...Math)

2014-11-20 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Exports the MathCache table
..

Exports the MathCache table

This is required for testing of texvcjs.

Change-Id: Ib602aba8f73fc18e30ebf0efc609c8fbb2d122ef
---
M MathRenderer.php
A maintenance/ExportMathCache.php
2 files changed, 96 insertions(+), 1 deletion(-)


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

diff --git a/MathRenderer.php b/MathRenderer.php
index 6784ff4..3310a95 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -247,7 +247,7 @@
 * @param binary $hash
 * @return string md5
 */
-   private static function dbHash2md5( $hash ) {
+   public static function dbHash2md5( $hash ) {
$dbr = wfGetDB( DB_SLAVE );
$xhash = unpack( 'H32md5', $dbr-decodeBlob( $hash ) . 
 );
return $xhash['md5'];
diff --git a/maintenance/ExportMathCache.php b/maintenance/ExportMathCache.php
new file mode 100644
index 000..b18909f
--- /dev/null
+++ b/maintenance/ExportMathCache.php
@@ -0,0 +1,95 @@
+?php
+/**
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @ingroup Maintenance
+ */
+
+require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
+
+class ExportMathCache extends Maintenance {
+   const DEFAULT_TABLE = 'mathoid';
+   private static $allowedTables = array( 'mathoid' , 'mathlatexml');
+   private static $inputColumns = array( 'mathoid' = 'math_input' , 
'mathlatexml' = 'math_inputtex');
+
+   public function __construct() {
+   parent::__construct();
+   $this-mDescription = 'Exports a json file that consists of the 
input hashes and the texvc input from the database cache.';
+   $this-addArg( 'table', The math table to be used (mathoid or 
latexml)., false );
+   $this-addOption( 'offset', If set the first n equations on 
the table are skipped, false, true, o );
+   $this-addOption( 'length', If set the only n equations are 
exported processed, false, true, l );
+   $this-addOption( 'sort' , 'If set the result is sorted 
according to the input', false, false, 's' );
+   }
+
+   /**
+* @param $table
+* @param $offset
+* @param $length
+* @return bool|ResultWrapper
+*/
+   private static function getMathTagsFromDatabase( $table , $offset , 
$length , $sort ) {
+   $out = array();
+   $dbr = wfGetDB( DB_SLAVE );
+   $inputColumn = self::$inputColumns[ $table ];
+   $options = array(
+   'OFFSET'   = $offset,
+   'LIMIT'= $length );
+   if ( $sort === true ) {
+   $options['ORDER BY'] = $inputColumn;
+   }
+   $res =  $dbr-select(
+   $table,
+   array( 'math_inputhash', $inputColumn ),
+   ''
+   , __METHOD__
+   , $options  );
+   if ( $res === false ) return false;
+   // Convert result wrapper to array
+   foreach ( $res as $row ){
+   $out[] = array(
+   // the binary encoded input-hash is no valid 
json output
+   'inputhash' = 
MathRenderer::dbHash2md5($row-math_inputhash) ,
+   'input' = $row-$inputColumn );
+   }
+   return $out;
+   }
+
+   public function execute() {
+   $table = $this-getArg( 0, self::DEFAULT_TABLE );
+   if( !in_array( $table, self::$allowedTables ) ){
+   echo Error:  '$table' is not allowed.\n;
+   return;
+   }
+   $offset = $this-getOption( 'offset', 0 );
+   $length = $this-getOption( 'length', PHP_INT_MAX );
+   $sort = $this-hasOption( 'sort' );
+   $allEquations = self::getMathTagsFromDatabase( $table, $offset, 
$length, $sort );
+  

[MediaWiki-commits] [Gerrit] Exports the MathCache table - change (mediawiki...Math)

2014-11-20 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Exports the MathCache table
..

Exports the MathCache table

This is required for testing of texvcjs.

Change-Id: Ib602aba8f73fc18e30ebf0efc609c8fbb2d122ef
---
M MathRenderer.php
A maintenance/ExportMathCache.php
2 files changed, 96 insertions(+), 1 deletion(-)


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

diff --git a/MathRenderer.php b/MathRenderer.php
index 72e2a6d..ded7a36 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -251,7 +251,7 @@
 * @param binary $hash
 * @return string md5
 */
-   private static function dbHash2md5( $hash ) {
+   public static function dbHash2md5( $hash ) {
$dbr = wfGetDB( DB_SLAVE );
$xhash = unpack( 'H32md5', $dbr-decodeBlob( $hash ) . 
 );
return $xhash['md5'];
diff --git a/maintenance/ExportMathCache.php b/maintenance/ExportMathCache.php
new file mode 100644
index 000..b18909f
--- /dev/null
+++ b/maintenance/ExportMathCache.php
@@ -0,0 +1,95 @@
+?php
+/**
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @ingroup Maintenance
+ */
+
+require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
+
+class ExportMathCache extends Maintenance {
+   const DEFAULT_TABLE = 'mathoid';
+   private static $allowedTables = array( 'mathoid' , 'mathlatexml');
+   private static $inputColumns = array( 'mathoid' = 'math_input' , 
'mathlatexml' = 'math_inputtex');
+
+   public function __construct() {
+   parent::__construct();
+   $this-mDescription = 'Exports a json file that consists of the 
input hashes and the texvc input from the database cache.';
+   $this-addArg( 'table', The math table to be used (mathoid or 
latexml)., false );
+   $this-addOption( 'offset', If set the first n equations on 
the table are skipped, false, true, o );
+   $this-addOption( 'length', If set the only n equations are 
exported processed, false, true, l );
+   $this-addOption( 'sort' , 'If set the result is sorted 
according to the input', false, false, 's' );
+   }
+
+   /**
+* @param $table
+* @param $offset
+* @param $length
+* @return bool|ResultWrapper
+*/
+   private static function getMathTagsFromDatabase( $table , $offset , 
$length , $sort ) {
+   $out = array();
+   $dbr = wfGetDB( DB_SLAVE );
+   $inputColumn = self::$inputColumns[ $table ];
+   $options = array(
+   'OFFSET'   = $offset,
+   'LIMIT'= $length );
+   if ( $sort === true ) {
+   $options['ORDER BY'] = $inputColumn;
+   }
+   $res =  $dbr-select(
+   $table,
+   array( 'math_inputhash', $inputColumn ),
+   ''
+   , __METHOD__
+   , $options  );
+   if ( $res === false ) return false;
+   // Convert result wrapper to array
+   foreach ( $res as $row ){
+   $out[] = array(
+   // the binary encoded input-hash is no valid 
json output
+   'inputhash' = 
MathRenderer::dbHash2md5($row-math_inputhash) ,
+   'input' = $row-$inputColumn );
+   }
+   return $out;
+   }
+
+   public function execute() {
+   $table = $this-getArg( 0, self::DEFAULT_TABLE );
+   if( !in_array( $table, self::$allowedTables ) ){
+   echo Error:  '$table' is not allowed.\n;
+   return;
+   }
+   $offset = $this-getOption( 'offset', 0 );
+   $length = $this-getOption( 'length', PHP_INT_MAX );
+   $sort = $this-hasOption( 'sort' );
+   $allEquations = self::getMathTagsFromDatabase( $table, $offset, 
$length, $sort );
+  

[MediaWiki-commits] [Gerrit] LaTeXML: prevent automatic rerendering of SVG - change (mediawiki...Math)

2014-11-18 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: LaTeXML: prevent automatic rerendering of SVG
..

LaTeXML: prevent automatic rerendering of SVG

MathMathML::renderingRequired called the getSvg
function in MathLaTeXML that caused an automatic
rerendering of the SVG image if it was not cached.
That this rendering is triggered from the function
renderingRequired is contra intutive and should be
avoided.

Change-Id: Ifa14f50193a05b3058624a18974c56897fcec09e
---
M MathLaTeXML.php
M MathMathML.php
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index 4915058..b9d7f86 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -197,8 +197,8 @@
 * Lazy evaluation: If no SVG image exists it's generated on the fly
 * @return string XML-Document of the rendered SVG
 */
-   public function getSvg() {
-   if ( $this-isPurge() || $this-svg == '' ) {
+   public function getSvg( $render = true ) {
+   if ( $render  ( $this-isPurge() || $this-svg == '' ) ) {
$this-calulateSvg();
}
return $this-svg;
diff --git a/MathMathML.php b/MathMathML.php
index 6707059..63f2b26 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -108,7 +108,7 @@
if ( $dbres ) {
if ( $this-isValidMathML( $this-getMathml() ) 
) {
wfDebugLog( Math, Valid MathML entry 
found in database. );
-   if ( $this-getSvg() ) {
+   if ( $this-getSvg( false ) ) {
wfDebugLog( Math, 
SVG-fallback found in database. );
return false;
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa14f50193a05b3058624a18974c56897fcec09e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Add logging table - change (mediawiki...Math)

2014-11-18 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add logging table
..

Add logging table

Adds a database table to store log entries in the database

Change-Id: I7935f33e04a1c9d7d4f1dbbc600e840f07c19dad
---
A db/mathlog.mysql.sql
1 file changed, 20 insertions(+), 0 deletions(-)


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

diff --git a/db/mathlog.mysql.sql b/db/mathlog.mysql.sql
new file mode 100644
index 000..d0ed74c
--- /dev/null
+++ b/db/mathlog.mysql.sql
@@ -0,0 +1,20 @@
+--
+-- Used by the math module to oganize the log files from
+-- different rendering engines
+--
+CREATE TABLE /*_*/mathlog (
+  -- Binary MD5 hash of math_inputtex, used as an identifier key.
+  math_inputhash varbinary(16) NOT NULL,
+  -- the log input
+  math_log text NOT NULL,
+  -- the post request sent
+  math_post text,
+  -- MW_MATH_(MAHML|LATEXML)
+  math_mode tinyint
+  -- time needed to answer the request in ms
+  math_postime int,
+  -- timestamp
+  math_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP,
+  -- key
+  key ( math_inputhash, math_mode )
+) /*$wgDBTableOptions*/;
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7935f33e04a1c9d7d4f1dbbc600e840f07c19dad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Create debugging table onLoadExtensionSchemaUpdates - change (mediawiki...Math)

2014-11-18 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Create debugging table onLoadExtensionSchemaUpdates
..

Create debugging table onLoadExtensionSchemaUpdates

* Creates the mathlog table if the mathdebug mode is enabled
* Replaces dirname( __FILE__ ) - __DIR__

Change-Id: I215e150452066f10458c1405ebddc9276e5596c8
---
M Math.hooks.php
1 file changed, 11 insertions(+), 5 deletions(-)


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

diff --git a/Math.hooks.php b/Math.hooks.php
index 213ac8f..95d6b00 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -216,7 +216,7 @@
 * @return bool
 */
static function onLoadExtensionSchemaUpdates( $updater = null ) {
-   global $wgMathValidModes;
+   global $wgMathValidModes, $wgMathDebug;
if ( is_null( $updater ) ) {
throw new MWException( 'Math extension is only 
necessary in 1.18 or above' );
}
@@ -226,14 +226,14 @@
$type = $updater-getDB()-getType();
 
if ( in_array( $type, $map ) ) {
-   $sql = dirname( __FILE__ ) . '/db/math.' . $type . 
'.sql';
+   $sql = __DIR__ . '/db/math.' . $type . '.sql';
$updater-addExtensionTable( 'math', $sql );
if ( in_array( MW_MATH_LATEXML, $wgMathValidModes ) ) {
if ( in_array( $type, array( 'mysql', 'sqlite', 
'postgres' ) ) ) {
-   $sql = dirname( __FILE__ ) . 
'/db/mathlatexml.' . $type . '.sql';
+   $sql = __DIR__ . '/db/mathlatexml.' . 
$type . '.sql';
$updater-addExtensionTable( 
'mathlatexml', $sql );
if ( $type == 'mysql' ){
-   $sql = dirname( __FILE__ ) . 
'/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql';
+   $sql = __DIR__ . 
'/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql';
$updater-modifyExtensionField( 
'mathlatexml', 'math_mathml', $sql );
}
} else {
@@ -242,12 +242,18 @@
}
if ( in_array( MW_MATH_MATHML, $wgMathValidModes ) ) {
if ( in_array( $type, array( 'mysql', 'sqlite', 
'postgres' ) ) ) {
-   $sql = dirname( __FILE__ ) . 
'/db/mathoid.' . $type . '.sql';
+   $sql = __DIR__ . '/db/mathoid.' . $type 
. '.sql';
$updater-addExtensionTable( 'mathoid', 
$sql );
} else {
throw new MWException( Math extension 
does not currently support $type database for Mathoid. );
}
}
+   if( $wgMathDebug ) {
+   if( $type == 'mysql' ) {
+   $sql = __DIR__ . 'db/mathlog.mysql.sql';
+   $updater-addExtensionTable( 'mathlog', 
$sql );
+   }
+   }
} else {
throw new MWException( Math extension does not 
currently support $type database. );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I215e150452066f10458c1405ebddc9276e5596c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Add debuging functionality - change (mediawiki...Math)

2014-11-18 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add debuging functionality
..

Add debuging functionality

Write debug log to database
for if $wgMathDebug is enabled.

Change-Id: I7ddd297b3ab0e3ec8b46faf55a466fc2ae6f5a9a
---
M MathLaTeXML.php
M MathMathML.php
M MathRenderer.php
M tests/MathMathMLTest.php
M tests/MathRendererTest.php
5 files changed, 116 insertions(+), 0 deletions(-)


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

diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index b9d7f86..24b424d 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -109,7 +109,9 @@
$post = preg_replace( '/tex=/' , 'tex=literal:', 
$post , 1);
}
$this-lastError = '';
+   if( $wgMathDebug ) { $renderingStart = microtime( true ); }
$requestResult = $this-makeRequest( $host, $post, $res, 
$this-lastError );
+   if( $wgMathDebug ) { $this-setRenderingTime( microtime( true ) 
- $renderingStart ); }
if ( $requestResult ) {
$jsonResult = json_decode( $res );
if ( $jsonResult  json_last_error() === 
JSON_ERROR_NONE ) {
@@ -117,7 +119,9 @@
$this-setMathml( $jsonResult-result );
if ( $wgMathDebug ) {
$this-setLog( $jsonResult-log 
);
+   $this-setPostData( $post );
$this-setStatusCode( 
$jsonResult-status_code );
+   $this-write
}
return true;
} else {
diff --git a/MathMathML.php b/MathMathML.php
index 63f2b26..6cc8b5e 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -236,7 +236,9 @@
$host = self::pickHost();
$post = $this-getPostData();
$this-lastError = '';
+   if( $wgMathDebug ) { $renderingStart = microtime( true ); }
$requestResult = $this-makeRequest( $host, $post, $res, 
$this-lastError );
+   if( $wgMathDebug ) { $this-setRenderingTime( microtime( true ) 
- $renderingStart ); }
if ( $requestResult ) {
$jsonResult = json_decode( $res );
if ( $jsonResult  json_last_error() === 
JSON_ERROR_NONE ) {
@@ -253,6 +255,8 @@
}
if ( $wgMathDebug ) {
$this-setLog( 
$jsonResult-log );
+   $this-setPostData( 
$post );
+   $this-writeDebugLog();
}
if ( $this-getMode() != 
MW_MATH_LATEXML  $this-inputType != 'pmml') {
$this-setMathml( 
$jsonResult-mml );
@@ -469,4 +473,5 @@
parent::initializeFromDatabaseRow( $rpage );
 
}
+
 }
diff --git a/MathRenderer.php b/MathRenderer.php
index 6784ff4..72e2a6d 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -47,6 +47,10 @@
protected $timestamp;
/** @var log messages generated during conversion of mathematical 
content */
protected $log = '';
+   /** @var time used for rendering in ms */
+   protected $renderingTime = 0;
+   /** @var post request sent to rendering server (if applicable) */
+   protected $postData = '';
 
// STATE OF THE CLASS INSTANCE
/** @var boolean has variable tex been security-checked */
@@ -685,4 +689,70 @@
$names = MathHooks::getMathNames();
return $names[ $this-getMode() ];
}
+
+   /**
+* @return string
+*/
+   public function getPostData() {
+   return $this-postData;
+   }
+
+   /**
+* @param string $postData
+*/
+   public function setPostData( $postData ) {
+   $this-postData = $postData;
+   }
+
+   /**
+* @return int time in ms
+*/
+   public function getRenderingTime() {
+   return $this-renderingTime;
+   }
+
+   /**
+* @param int|long $renderingTime either in ms or as in seconds as long
+* @throws MWException
+*/
+   public function setRenderingTime( $renderingTime ) {
+   $type = gettype($renderingTime);
+   switch ( $type ) {
+   case double:
+   case float:
+

[MediaWiki-commits] [Gerrit] Add logging table - change (mediawiki...Math)

2014-11-18 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add logging table
..

Add logging table

* Adds a database table to store log entries in the database
* Creates the mathlog table if the mathdebug mode is enabled
* Replaces dirname( __FILE__ ) - __DIR__

Change-Id: I7935f33e04a1c9d7d4f1dbbc600e840f07c19dad
---
M Math.hooks.php
A db/mathlog.mysql.sql
M tests/MathDatabaseTest.php
3 files changed, 49 insertions(+), 5 deletions(-)


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

diff --git a/Math.hooks.php b/Math.hooks.php
index 213ac8f..1a3bd14 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -216,7 +216,7 @@
 * @return bool
 */
static function onLoadExtensionSchemaUpdates( $updater = null ) {
-   global $wgMathValidModes;
+   global $wgMathValidModes, $wgMathDebug;
if ( is_null( $updater ) ) {
throw new MWException( 'Math extension is only 
necessary in 1.18 or above' );
}
@@ -226,14 +226,14 @@
$type = $updater-getDB()-getType();
 
if ( in_array( $type, $map ) ) {
-   $sql = dirname( __FILE__ ) . '/db/math.' . $type . 
'.sql';
+   $sql = __DIR__ . '/db/math.' . $type . '.sql';
$updater-addExtensionTable( 'math', $sql );
if ( in_array( MW_MATH_LATEXML, $wgMathValidModes ) ) {
if ( in_array( $type, array( 'mysql', 'sqlite', 
'postgres' ) ) ) {
-   $sql = dirname( __FILE__ ) . 
'/db/mathlatexml.' . $type . '.sql';
+   $sql = __DIR__ . '/db/mathlatexml.' . 
$type . '.sql';
$updater-addExtensionTable( 
'mathlatexml', $sql );
if ( $type == 'mysql' ){
-   $sql = dirname( __FILE__ ) . 
'/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql';
+   $sql = __DIR__ . 
'/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql';
$updater-modifyExtensionField( 
'mathlatexml', 'math_mathml', $sql );
}
} else {
@@ -242,12 +242,18 @@
}
if ( in_array( MW_MATH_MATHML, $wgMathValidModes ) ) {
if ( in_array( $type, array( 'mysql', 'sqlite', 
'postgres' ) ) ) {
-   $sql = dirname( __FILE__ ) . 
'/db/mathoid.' . $type . '.sql';
+   $sql = __DIR__ . '/db/mathoid.' . $type 
. '.sql';
$updater-addExtensionTable( 'mathoid', 
$sql );
} else {
throw new MWException( Math extension 
does not currently support $type database for Mathoid. );
}
}
+   if( $wgMathDebug ) {
+   if( $type == 'mysql' ) {
+   $sql = __DIR__ . 
'/db/mathlog.mysql.sql';
+   $updater-addExtensionTable( 'mathlog', 
$sql );
+   }
+   }
} else {
throw new MWException( Math extension does not 
currently support $type database. );
}
diff --git a/db/mathlog.mysql.sql b/db/mathlog.mysql.sql
new file mode 100644
index 000..a7559f8
--- /dev/null
+++ b/db/mathlog.mysql.sql
@@ -0,0 +1,22 @@
+--
+-- Used by the math module to oganize the log files from
+-- different rendering engines
+--
+CREATE TABLE /*_*/mathlog (
+  -- Binary MD5 hash of math_inputtex, used as an identifier key.
+  math_inputhash varbinary(16) NOT NULL,
+  -- the log input
+  math_log text NOT NULL,
+  -- the post request sent
+  math_post text,
+  -- MW_MATH_(MAHML|LATEXML)
+  math_mode tinyint,
+  -- time needed to answer the request in ms
+  math_rederingtime int,
+  -- statuscode returned by the rendering engine
+  math_statuscode tinyint,
+  -- timestamp
+  math_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP,
+  -- key
+  key ( math_inputhash, math_mode )
+) /*$wgDBTableOptions*/;
\ No newline at end of file
diff --git a/tests/MathDatabaseTest.php b/tests/MathDatabaseTest.php
index fcd946c..fe20940 100644
--- a/tests/MathDatabaseTest.php
+++ b/tests/MathDatabaseTest.php
@@ -112,4 +112,20 @@
$this-assertFalse( $this-renderer-readFromDatabase() );
 
}
+
+   /**
+* Checks the creation of the math table with debugging 

[MediaWiki-commits] [Gerrit] Add debuging functionality - change (mediawiki...Math)

2014-11-18 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add debuging functionality
..

Add debuging functionality

Write debug log to database if $wgMathDebug is enabled.

Change-Id: I7ddd297b3ab0e3ec8b46faf55a466fc2ae6f5a9a
---
M MathLaTeXML.php
M MathMathML.php
M MathRenderer.php
M tests/MathMathMLTest.php
M tests/MathRendererTest.php
5 files changed, 116 insertions(+), 0 deletions(-)


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

diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index 4915058..4f40474 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -109,7 +109,9 @@
$post = preg_replace( '/tex=/' , 'tex=literal:', 
$post , 1);
}
$this-lastError = '';
+   if( $wgMathDebug ) { $renderingStart = microtime( true ); }
$requestResult = $this-makeRequest( $host, $post, $res, 
$this-lastError );
+   if( $wgMathDebug ) { $this-setRenderingTime( microtime( true ) 
- $renderingStart ); }
if ( $requestResult ) {
$jsonResult = json_decode( $res );
if ( $jsonResult  json_last_error() === 
JSON_ERROR_NONE ) {
@@ -117,7 +119,9 @@
$this-setMathml( $jsonResult-result );
if ( $wgMathDebug ) {
$this-setLog( $jsonResult-log 
);
+   $this-setPostData( $post );
$this-setStatusCode( 
$jsonResult-status_code );
+   $this-writeDebugLog();
}
return true;
} else {
diff --git a/MathMathML.php b/MathMathML.php
index 6707059..d7dd222 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -236,7 +236,9 @@
$host = self::pickHost();
$post = $this-getPostData();
$this-lastError = '';
+   if( $wgMathDebug ) { $renderingStart = microtime( true ); }
$requestResult = $this-makeRequest( $host, $post, $res, 
$this-lastError );
+   if( $wgMathDebug ) { $this-setRenderingTime( microtime( true ) 
- $renderingStart ); }
if ( $requestResult ) {
$jsonResult = json_decode( $res );
if ( $jsonResult  json_last_error() === 
JSON_ERROR_NONE ) {
@@ -253,6 +255,8 @@
}
if ( $wgMathDebug ) {
$this-setLog( 
$jsonResult-log );
+   $this-setPostData( 
$post );
+   $this-writeDebugLog();
}
if ( $this-getMode() != 
MW_MATH_LATEXML  $this-inputType != 'pmml') {
$this-setMathml( 
$jsonResult-mml );
@@ -469,4 +473,5 @@
parent::initializeFromDatabaseRow( $rpage );
 
}
+
 }
diff --git a/MathRenderer.php b/MathRenderer.php
index 6784ff4..72e2a6d 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -47,6 +47,10 @@
protected $timestamp;
/** @var log messages generated during conversion of mathematical 
content */
protected $log = '';
+   /** @var time used for rendering in ms */
+   protected $renderingTime = 0;
+   /** @var post request sent to rendering server (if applicable) */
+   protected $postData = '';
 
// STATE OF THE CLASS INSTANCE
/** @var boolean has variable tex been security-checked */
@@ -685,4 +689,70 @@
$names = MathHooks::getMathNames();
return $names[ $this-getMode() ];
}
+
+   /**
+* @return string
+*/
+   public function getPostData() {
+   return $this-postData;
+   }
+
+   /**
+* @param string $postData
+*/
+   public function setPostData( $postData ) {
+   $this-postData = $postData;
+   }
+
+   /**
+* @return int time in ms
+*/
+   public function getRenderingTime() {
+   return $this-renderingTime;
+   }
+
+   /**
+* @param int|long $renderingTime either in ms or as in seconds as long
+* @throws MWException
+*/
+   public function setRenderingTime( $renderingTime ) {
+   $type = gettype($renderingTime);
+   switch ( $type ) {
+   case double:
+   case float:
+ 

[MediaWiki-commits] [Gerrit] LaTeXML: prevent automatic rerendering of SVG - change (mediawiki...Math)

2014-11-18 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: LaTeXML: prevent automatic rerendering of SVG
..

LaTeXML: prevent automatic rerendering of SVG

MathMathML::renderingRequired called the getSvg
function in MathLaTeXML that caused an automatic
rerendering of the SVG image if it was not cached.
That this rendering is triggered from the function
renderingRequired is contra intutive and should be
avoided.

Change-Id: Ifa14f50193a05b3058624a18974c56897fcec09e
---
M MathLaTeXML.php
M MathMathML.php
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index 4f40474..e8eaa62 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -201,8 +201,8 @@
 * Lazy evaluation: If no SVG image exists it's generated on the fly
 * @return string XML-Document of the rendered SVG
 */
-   public function getSvg() {
-   if ( $this-isPurge() || $this-svg == '' ) {
+   public function getSvg( $render = true ) {
+   if ( $render  ( $this-isPurge() || $this-svg == '' ) ) {
$this-calulateSvg();
}
return $this-svg;
diff --git a/MathMathML.php b/MathMathML.php
index d7dd222..6cc8b5e 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -108,7 +108,7 @@
if ( $dbres ) {
if ( $this-isValidMathML( $this-getMathml() ) 
) {
wfDebugLog( Math, Valid MathML entry 
found in database. );
-   if ( $this-getSvg() ) {
+   if ( $this-getSvg( false ) ) {
wfDebugLog( Math, 
SVG-fallback found in database. );
return false;
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa14f50193a05b3058624a18974c56897fcec09e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: debug
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Use local Mathoid renderer - change (mediawiki/vagrant)

2014-11-17 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Use local Mathoid renderer
..

Use local Mathoid renderer

The mediawiki installation should use the local
Mathoid renderer if the Mathoid role is enabled.

Change-Id: I49e7468076a3fd7bdca0a26e86ab87710588e9f8
---
M puppet/modules/role/manifests/mathoid.pp
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/91/173791/1

diff --git a/puppet/modules/role/manifests/mathoid.pp 
b/puppet/modules/role/manifests/mathoid.pp
index 07bc0f7..e4db031 100644
--- a/puppet/modules/role/manifests/mathoid.pp
+++ b/puppet/modules/role/manifests/mathoid.pp
@@ -3,4 +3,10 @@
 #
 class role::mathoid {
 require ::mathoid::install::git
+# use local mathoid renderer
+mediawiki::settings { 'Mathoid':
+values = [
+'$wgMathMathMLUrl = http://localhost:10042;;',
+],
+}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49e7468076a3fd7bdca0a26e86ab87710588e9f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Fix wrong class name - change (mediawiki...MathSearch)

2014-11-17 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix wrong class name
..

Fix wrong class name

Change-Id: I3d81505748eb03f4e723dbb40265740a3424323c
---
M maintenance/CleanMathTable.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/75/173775/1

diff --git a/maintenance/CleanMathTable.php b/maintenance/CleanMathTable.php
index adc84e1..b80f200 100644
--- a/maintenance/CleanMathTable.php
+++ b/maintenance/CleanMathTable.php
@@ -21,7 +21,7 @@
 
 require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
 
-class UpdateMath extends Maintenance {
+class CleanMathTable extends Maintenance {
const RTI_CHUNK_SIZE = 10;
public $purge = false;
 
@@ -51,5 +51,5 @@
}
 }
 
-$maintClass = UpdateMath;
+$maintClass = CleanMathTable;
 require_once( RUN_MAINTENANCE_IF_MAIN );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d81505748eb03f4e723dbb40265740a3424323c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Select rendering engine for batch update script - change (mediawiki...MathSearch)

2014-11-17 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Select rendering engine for batch update script
..


Select rendering engine for batch update script

Add option to select which renderer should be used to
perform the Math Formulae update

Change-Id: I074d3938c2898f4124f1b5ad11186863b0455172
---
M db/mathperformance.sql
M maintenance/UpdateMath.php
2 files changed, 15 insertions(+), 9 deletions(-)

Approvals:
  Physikerwelt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/db/mathperformance.sql b/db/mathperformance.sql
index 56a59b2..593056a 100644
--- a/db/mathperformance.sql
+++ b/db/mathperformance.sql
@@ -2,5 +2,6 @@
   `math_inputhash` VARBINARY(16) NOT NULL,
   `mathperformance_name` CHAR(10) NOT NULL,
   `mathperformance_time` DOUBLE NOT NULL,
+  `mathperformance_mode` TINYINT NOT NULL,
   `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
   INDEX `PK` (`math_inputhash` ASC, `mathperformance_name` ASC));
\ No newline at end of file
diff --git a/maintenance/UpdateMath.php b/maintenance/UpdateMath.php
index 9e1922d..f2bb6a0 100644
--- a/maintenance/UpdateMath.php
+++ b/maintenance/UpdateMath.php
@@ -32,6 +32,7 @@
private $current;
private $time = 0;//microtime( true );
private $performance = array();
+   private $renderingMode =  MW_MATH_LATEXML;
 
/**
 * @var DatabaseBase
@@ -43,7 +44,7 @@
public function __construct() {
$this-verbose = $this-verbose;
parent::__construct();
-   $this-mDescription = 'Outputs page text to stdout';
+   $this-mDescription = 'Updates the index of Mathematical 
formulae.';
$this-addOption( 'purge', If set all formulae are rendered 
again without using caches. (Very time consuming!), false, false, f );
$this-addArg( 'min', If set processing is started at the page 
with rank(pageID)min, false );
$this-addArg( 'max', If set processing is stopped at the page 
with rank(pageID)=max, false );
@@ -51,6 +52,7 @@
$this-addOption( 'SVG', If set SVG images will be produced, 
false, false );
$this-addOption( 'hoooks', If set hooks will be skipped, 
false, false );
$this-addOption( 'texvccheck', If set texvccheck will be 
skipped, false, false );
+   $this-addOption( 'mode' , 'Rendering mode to be used (0 = PNG, 
5= MathML, 7=MathML)',false,true,'m');
}
private function time($category='default'){
global $wgMathDebug;
@@ -63,7 +65,8 @@
$this-db-insert('mathperformance',array(
'math_inputhash' = 
$this-current-getInputHash(),
'mathperformance_name' = 
substr($category,0,10),
-   'mathperformance_time' =$delta,
+   'mathperformance_time' = $delta,
+   'mathperformance_mode' = $this-renderingMode
));
 
}
@@ -116,10 +119,11 @@
}
 
/**
-* @param unknown $pId
+* @param $pid
 * @param unknown $pText
 * @param string $pTitle
-* @param string $purge
+* @internal param unknown $pId
+* @internal param string $purge
 * @return number
 */
private function doUpdate( $pid, $pText, $pTitle = ) {
@@ -132,7 +136,7 @@
echo( \t processing $matches math fields for {$pTitle} 
page\n );
foreach ( $math as $formula ) {
$this-time = microtime(true);
-   $renderer = MathRenderer::getRenderer( 
$formula[1], $formula[2], MW_MATH_LATEXML );
+   $renderer = MathRenderer::getRenderer( 
$formula[1], $formula[2], $this-renderingMode );
$this-current = $renderer;
$this-time(loadClass);
if ( $this-getOption( texvccheck, false ) ) {
@@ -144,9 +148,9 @@
if ( $checked ) {
$renderer-render( $this-purge );
if( $renderer-getMathml() ){
-   
$this-time(LaTeXML-Rendering);
+   $this-time(Rendering);
} else {
-   $this-time(LaTeXML-Fail);
+   $this-time(Failing);
}
if ( $this-getOption( SVG, false ) ) 
{
$svg = $renderer-getSvg();
@@ -156,7 +160,7 @@
  

[MediaWiki-commits] [Gerrit] Fix wrong class name - change (mediawiki...MathSearch)

2014-11-17 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Fix wrong class name
..


Fix wrong class name

Change-Id: I3d81505748eb03f4e723dbb40265740a3424323c
---
M maintenance/CleanMathTable.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Physikerwelt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/CleanMathTable.php b/maintenance/CleanMathTable.php
index adc84e1..b80f200 100644
--- a/maintenance/CleanMathTable.php
+++ b/maintenance/CleanMathTable.php
@@ -21,7 +21,7 @@
 
 require_once( dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
 
-class UpdateMath extends Maintenance {
+class CleanMathTable extends Maintenance {
const RTI_CHUNK_SIZE = 10;
public $purge = false;
 
@@ -51,5 +51,5 @@
}
 }
 
-$maintClass = UpdateMath;
+$maintClass = CleanMathTable;
 require_once( RUN_MAINTENANCE_IF_MAIN );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3d81505748eb03f4e723dbb40265740a3424323c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Select rendering engine for batch update script - change (mediawiki...MathSearch)

2014-11-14 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Select rendering engine for batch update script
..

Select rendering engine for batch update script

Add option to select which renderer should be used to
perform the Math Formulae update

Change-Id: I074d3938c2898f4124f1b5ad11186863b0455172
---
M maintenance/UpdateMath.php
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/92/173292/1

diff --git a/maintenance/UpdateMath.php b/maintenance/UpdateMath.php
index 9e1922d..04e78e9 100644
--- a/maintenance/UpdateMath.php
+++ b/maintenance/UpdateMath.php
@@ -32,6 +32,7 @@
private $current;
private $time = 0;//microtime( true );
private $performance = array();
+   private $renderingMode =  MW_MATH_LATEXML;
 
/**
 * @var DatabaseBase
@@ -43,7 +44,7 @@
public function __construct() {
$this-verbose = $this-verbose;
parent::__construct();
-   $this-mDescription = 'Outputs page text to stdout';
+   $this-mDescription = 'Updates the index of Mathematical 
formulae.';
$this-addOption( 'purge', If set all formulae are rendered 
again without using caches. (Very time consuming!), false, false, f );
$this-addArg( 'min', If set processing is started at the page 
with rank(pageID)min, false );
$this-addArg( 'max', If set processing is stopped at the page 
with rank(pageID)=max, false );
@@ -51,6 +52,7 @@
$this-addOption( 'SVG', If set SVG images will be produced, 
false, false );
$this-addOption( 'hoooks', If set hooks will be skipped, 
false, false );
$this-addOption( 'texvccheck', If set texvccheck will be 
skipped, false, false );
+   $this-addOption( 'mode' , 'Rendering mode to be used (0 = PNG, 
5= MathML, 7=MathML)',false,true,'m');
}
private function time($category='default'){
global $wgMathDebug;
@@ -116,10 +118,11 @@
}
 
/**
-* @param unknown $pId
+* @param $pid
 * @param unknown $pText
 * @param string $pTitle
-* @param string $purge
+* @internal param unknown $pId
+* @internal param string $purge
 * @return number
 */
private function doUpdate( $pid, $pText, $pTitle = ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I074d3938c2898f4124f1b5ad11186863b0455172
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Uniform naming of Math anchors - change (mediawiki...MathSearch)

2014-11-11 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Uniform naming of Math anchors
..

Uniform naming of Math anchors

Change-Id: I64b69aba6d479d020d5b2a219405ea011c24ed7f
---
M FormulaInfo.php
M MathEngineBaseX.php
M MathQueryObject.php
M MathSearch.hooks.php
M SpecialUploadResult.php
M maintenance/CreateBaseXMathTable.php
M maintenance/CreateMWSHarvest.php
7 files changed, 16 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/40/172540/1

diff --git a/FormulaInfo.php b/FormulaInfo.php
index b57a89d..fffe20e 100644
--- a/FormulaInfo.php
+++ b/FormulaInfo.php
@@ -100,7 +100,6 @@
$mo-findSimilarPages( $pid );
$out-addWikiText( '==Variables==' );
$mo-getObservations();
-   // $wgOut-addWikiText( [[$pagename#math$eid|Eq: $eid]] , 
false );
$out-addWikiText( '==MathML==' );
 
$out-addHtml( br / );
diff --git a/MathEngineBaseX.php b/MathEngineBaseX.php
index 48ea045..6e64590 100644
--- a/MathEngineBaseX.php
+++ b/MathEngineBaseX.php
@@ -65,6 +65,7 @@
$this-relevanceMap = array();
$this-resultSet = array();
if( $res ){
+   //TODO: ReEvaluate the regexp.
$baseXRegExp = /a .*? 
href=\http.*?curid=(\d+)#math(\d?)\/;
preg_match_all( $baseXRegExp , $res, 
$matches,PREG_SET_ORDER);
foreach($matches as $match){
diff --git a/MathQueryObject.php b/MathQueryObject.php
index d05b2bc..6eca335 100644
--- a/MathQueryObject.php
+++ b/MathQueryObject.php
@@ -58,11 +58,12 @@
$this-queryID = $id;
}
 
-   public function exportTexDocument(){
-   $texInput = htmlspecialchars( $this-getUserInputTex());
-   $texInputComment = preg_replace(/[\n\r]/,\n%,$texInput);
+   public function exportTexDocument() {
+   $texInput = htmlspecialchars( $this-getUserInputTex() );
+   $texInputComment = preg_replace( /[\n\r]/, \n%, $texInput );
$title = Title::newFromId( $this-getPageID() );
-   $absUrl  = 
$title-getFullURL(array(oldid=$title-getLatestRevID())).#math{$this-getAnchorID()};
+   $absUrl = $title-getFullURL( array( oldid = 
$title-getLatestRevID() ) ) .
+   MathSearchHooks::generateMathAnchorString( 
$title-getLatestRevID(), $this-getAnchorID() );
return TeX
 \begin{topic}{{$this-getPageTitle()}-{$this-getAnchorID()}}
   \begin{fquery}\${$this-getTeXQuery()}\$\end{fquery}
diff --git a/MathSearch.hooks.php b/MathSearch.hooks.php
index cab93d8..60d99b3 100644
--- a/MathSearch.hooks.php
+++ b/MathSearch.hooks.php
@@ -12,6 +12,7 @@
 * LoadExtensionSchemaUpdates handler; set up math table on 
install/upgrade.
 *
 * @param $updater DatabaseUpdater
+* @throws MWException
 * @return bool
 */
static function onLoadExtensionSchemaUpdates( $updater = null ) {
@@ -206,7 +207,7 @@
if ( preg_match( '#math(.*)?\sid=(?Pid[\w\.]+)#', $Result, 
$matches ) ) {
$rendererId = $matches['id'];
$oldId = self::curId2OldId( $pid );
-   $newID = math.${oldId}.${eid};
+   $newID = self::generateMathAnchorString($oldId,$eid);
$Result = str_replace( $rendererId, $newID, $Result );
}
return true;
@@ -223,4 +224,8 @@
$files = array_merge( $files, glob( $testDir/*Test.php ) );
return true;
}
+
+   static function generateMathAnchorString($pageID, $anchorID){
+   return #math.$pageID.$anchorID;
+   }
 }
diff --git a/SpecialUploadResult.php b/SpecialUploadResult.php
index 49ac58d..e4bd25d 100644
--- a/SpecialUploadResult.php
+++ b/SpecialUploadResult.php
@@ -180,7 +180,7 @@
} else {
$renderedMath = $md5;
}
-   $formulaId = math.{$row['oldId']}.{$row['fId']};
+   $formulaId = 
MathSearchHooks::generateMathAnchorString($row['oldId'],$row['fId']);;
$link=Revision::newFromId( $row['oldId'] 
)-getTitle()-getCanonicalURL().#$formulaId;
$this-getOutput()-addHTML(trtd${row['qId']}/tdtda 
href=\${link}\$formulaId/a/td
td${row['rank']}/tdtd$renderedMath/td/tr);
diff --git a/maintenance/CreateBaseXMathTable.php 
b/maintenance/CreateBaseXMathTable.php
index 2124218..6ce615d 100644
--- a/maintenance/CreateBaseXMathTable.php
+++ b/maintenance/CreateBaseXMathTable.php
@@ -58,7 +58,8 @@
libxml_clear_errors();
return ;
}
-   $out .= \n 

[MediaWiki-commits] [Gerrit] Improve user feedback - change (mediawiki...MathSearch)

2014-11-06 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Improve user feedback
..

Improve user feedback

Change-Id: If83ba0b9f2c8fa10bea3269c3ed6d1dc6611bfc8
---
M SpecialUploadResult.php
M db/math_wmc_results.sql
2 files changed, 47 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/02/171602/1

diff --git a/SpecialUploadResult.php b/SpecialUploadResult.php
index 35b2af0..256a5bc 100644
--- a/SpecialUploadResult.php
+++ b/SpecialUploadResult.php
@@ -330,4 +330,45 @@
}
$this-getOutput()-addHTML('/table');
}
+
+   private function displayFormulaFeedback(){
+   $runId=$this-runID;
+   $dbr=wfGetDB(DB_SLAVE);
+   $res = $dbr-select(
+   
array('l'='math_wmc_rank_levels','r'='math_wmc_ref','math_wmc_results'),
+   array( 'count(DISTINCT `r`.`qId`)  AS `c`',
+   '`l`.`level`AS `level`'),
+   array( (`math_wmc_results`.`rank` = `l`.`level`) ,
+   'runId'=$runId,
+   '`math_wmc_results`.`oldId` = `r`.`oldId`',
+   '`math_wmc_results`.`qId` = `r`.`qId`',
+   '`math_wmc_results`.`fId` = `r`.`fId`',
+   ),
+   __METHOD__,
+   array( 'GROUP BY' = '`l`.`level`',
+   'ORDER BY' = 'count(DISTINCT `r`.`qId`) DESC')
+   );
+   if ( ! $res || $res-numRows() == 0 ){
+   $this-getOutput()-addWikiText( Score is 0. Check 
your submission);
+   return ;
+   } else {
+   $this-getOutput()-addWikiText( '''Scored in  . 
$res-numRows() .  evaluation levels''');
+   }
+
+   $this-getOutput()-addHTML('table border=1 
style=width:100%
+  tr
+thnumber of correct results/th
+thrank cutoff/th
+  /tr');
+   foreach ( $res as $result ) {
+   $c=$result-c;
+   $l=$result-level;
+   $this-getOutput()-addHTML(
+  tr
+td$c/td
+td$l/td
+  /tr);
+   }
+   $this-getOutput()-addHTML('/table');
+   }
 }
diff --git a/db/math_wmc_results.sql b/db/math_wmc_results.sql
index fe32235..7a4f67e 100644
--- a/db/math_wmc_results.sql
+++ b/db/math_wmc_results.sql
@@ -1,13 +1,14 @@
 CREATE TABLE math_wmc_results
 (
 resultId INT PRIMARY KEY NOT NULL,
-qId INT,
-curId INT,
+qId INT NOT NULL,
 rank INT NOT NULL,
-runId INT,
-oldId INT,
+runId INT NOT NULL,
+oldId INT NOT NULL,
+fId INT NOT NULL,
 FOREIGN KEY ( runId ) REFERENCES math_wmc_runs ( runId ),
 FOREIGN KEY ( oldId ) REFERENCES revision ( rev_id )
 );
 CREATE INDEX idx_wmc_results_qid ON math_wmc_results ( qId );
-CREATE INDEX idx_wmc_results_qid_curid ON math_wmc_results ( qId, curId );
+CREATE INDEX idx_wmc_results_run ON math_wmc_results ( runId );
+CREATE INDEX idx_wmc_results_qid_curid ON math_wmc_results ( qId, oldId );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If83ba0b9f2c8fa10bea3269c3ed6d1dc6611bfc8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Increase size of the math_mathml in the mathlatexml table - change (mediawiki...Math)

2014-11-06 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Increase size of the math_mathml in the mathlatexml table
..

Increase size of the math_mathml in the mathlatexml table

The type text allows text with maximum length of 64k only. Since the
MathML generated by LaTeXML is quite verbose this is too small for
some equations used at Wikipedia.

Bug: 73090
Change-Id: Id09ec6201f68efe63a439f6e85a53876d5c1e521
---
M db/mathlatexml.mysql.sql
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/db/mathlatexml.mysql.sql b/db/mathlatexml.mysql.sql
index 89d8a6c..38ded24 100644
--- a/db/mathlatexml.mysql.sql
+++ b/db/mathlatexml.mysql.sql
@@ -10,7 +10,7 @@
   -- the validated tex
   math_tex text,
   -- MathML output LaTeXML
-  math_mathml text,
+  math_mathml mediumtext,
   -- SVG output mathoid
   math_svg text,
   -- MW_MATHSTYLE_(INLINE_DISPLAYSTYLE|DISPLAY|INLINE)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id09ec6201f68efe63a439f6e85a53876d5c1e521
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Disable overwriting of the fallback image - change (mediawiki...Math)

2014-11-02 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Disable overwriting of the fallback image
..

Disable overwriting of the fallback image

The style information for the fallback image is quite sophisticated
and should not be changed.

Bug: 72626
Change-Id: I553cf7209d87517b8c8841cc25df74ebd4c683f4
---
M MathMathML.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/MathMathML.php b/MathMathML.php
index b440cf2..9f3619a 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -383,10 +383,9 @@
$style = 'background-image: url(\''. $url. '\'); 
background-repeat: no-repeat; background-size: 100% 100%;';
$this-correctSvgStyle( $this-getSvg(), $style );
if ( $class ) { $attribs['class'] = $class; }
-   if ( $style ) { $attribs['style'] = $style; }
// Don't use an empty span, as that is going to be stripped by 
HTML tidy
// when enabled (which is true in production).
-   return Xml::element( 'meta', $this-getAttributes( 'span', 
$attribs , array( 'aria-hidden' = 'true' ) ) );
+   return Xml::element( 'meta', $this-getAttributes( 'span', 
$attribs , array( 'aria-hidden' = 'true', 'style' = $style ) ) );
}
 
 
@@ -439,6 +438,7 @@
$output .= Xml::tags( $element, array( 'class' = 
$this-getClassName(), 'style' = 'display: none;'  ), $mml );
$output .= $this-getFallbackImage( ) . \n;
$output .= HTML::closeElement( $element );
+   wfDebugLog(Math,new output.$this-getFallbackImage( ));
return $output;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I553cf7209d87517b8c8841cc25df74ebd4c683f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Remove Undesired spaces after math expressions - change (mediawiki...Math)

2014-11-02 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Remove Undesired spaces after math expressions
..

Remove Undesired spaces after math expressions

The linebreak after the math fallback image caused
the additional space.

Bug: 72806
Change-Id: Id7117f84ddb4cbe2eb4d6b8abeecf38b4f7e3c6d
---
M MathMathML.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/MathMathML.php b/MathMathML.php
index b440cf2..6707059 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -437,7 +437,7 @@
$mml = preg_replace( '/math/', 'math 
display=block', $mml );
}
$output .= Xml::tags( $element, array( 'class' = 
$this-getClassName(), 'style' = 'display: none;'  ), $mml );
-   $output .= $this-getFallbackImage( ) . \n;
+   $output .= $this-getFallbackImage( );
$output .= HTML::closeElement( $element );
return $output;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7117f84ddb4cbe2eb4d6b8abeecf38b4f7e3c6d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] prepare mathoid for speech output - change (mediawiki...mathoid)

2014-10-27 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: prepare mathoid for speech output
..

prepare mathoid for speech output

Change-Id: I434e0ba0e82ecbd814b3083f140793e3c4715bee
---
M MathJaxNode/lib/mj-single.js
M mathoid-worker.js
2 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/50/168950/1

diff --git a/MathJaxNode/lib/mj-single.js b/MathJaxNode/lib/mj-single.js
index fccdc31..189b166 100644
--- a/MathJaxNode/lib/mj-single.js
+++ b/MathJaxNode/lib/mj-single.js
@@ -370,7 +370,8 @@
   //  Add the speech elements, if needed
   //
   if (data.speakText) {
-GetSpeech(svg,result.mml);
+result.speech = speech.processExpression(result.mml);
+//GetSpeech(svg,result.mml);
 if (!data.mml) {delete result.mml}
   }
 
diff --git a/mathoid-worker.js b/mathoid-worker.js
index e2e0745..424a3bc 100644
--- a/mathoid-worker.js
+++ b/mathoid-worker.js
@@ -92,7 +92,7 @@
 if (type === ascii || type === asciimath) {
 type = AsciiMath;
 }
-mjAPI.typeset({math: q, format: type, svg: true, img: true, mml: mml}, 
function (data) {
+mjAPI.typeset({math: q, format: type, svg: true, img: true, mml: mml, 
speakText: true}, function (data) {
 if (data.errors) {
 data.success = false;
 data.log = Error: + JSON.stringify(data.errors);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I434e0ba0e82ecbd814b3083f140793e3c4715bee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Adjust caching times for svg images - change (mediawiki...Math)

2014-10-15 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Adjust caching times for svg images
..

Adjust caching times for svg images

In the first period we set the caching time for server-side
caching to 1 week and the value for client-side caching
to 1 hour.

Change-Id: Ieab63dfe9a00f31d64945180d7b0d98b9fe62b39
---
M SpecialMathShowImage.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php
index 32f2f08..c12b9ae 100644
--- a/SpecialMathShowImage.php
+++ b/SpecialMathShowImage.php
@@ -32,7 +32,8 @@
$request-response()-header( Content-type: 
image/svg+xml; charset=utf-8 );
}
if ( $success  !( $this-noRender ) ) {
-   $request-response()-header( 'Cache-Control: public 
max-age=2419200' ); // 4 weeks
+   $request-response()-header( 'Cache-Control: public 
s-maxage=604800' ); // 1 week (server)
+   $request-response()-header( 'Cache-Control: public 
max-age=3600' ); // 1 hour (client)
$request-response()-header( 'Vary: User-Agent' );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieab63dfe9a00f31d64945180d7b0d98b9fe62b39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] XML-escape TeX annotation - change (mediawiki...mathoid)

2014-10-14 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: XML-escape TeX annotation
..

XML-escape TeX annotation

Change-Id: I5594ce4c754f7340b1995a155d6005966e67cb78
---
M mathoid-worker.js
A node_modules/xml-escape/.npmignore
A node_modules/xml-escape/LICENSE
A node_modules/xml-escape/README.md
A node_modules/xml-escape/index.js
A node_modules/xml-escape/package.json
A node_modules/xml-escape/test.js
M package.json
8 files changed, 135 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/56/166556/1

diff --git a/mathoid-worker.js b/mathoid-worker.js
index 21cbfd1..0c5f8e0 100644
--- a/mathoid-worker.js
+++ b/mathoid-worker.js
@@ -13,6 +13,7 @@
 querystring = require('querystring');
 var texvcjs = require('texvcjs');
 var mjAPI = require(./MathJaxNode/lib/mj-single.js);
+var xmlescape = require('xml-escape');
 
 var format = TeX;
 var font = TeX;
@@ -110,6 +111,13 @@
 });
 }
 
+if (data.mml) {
+data.mml = data.mml.replace(/annotation 
encoding=application\/x-tex(.*?)\/annotation/ , function(match, xml) {
+   return 'annotation encoding=application/x-tex' +
+ xmlescape(xml) +
+   '/annotation';
+});
+}
 // Return the sanitized TeX to the client
 if (sanitizedTex !== undefined) {
 data.sanetex = sanitizedTex;
diff --git a/node_modules/xml-escape/.npmignore 
b/node_modules/xml-escape/.npmignore
new file mode 100644
index 000..a72b52e
--- /dev/null
+++ b/node_modules/xml-escape/.npmignore
@@ -0,0 +1,15 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+npm-debug.log
+node_modules
diff --git a/node_modules/xml-escape/LICENSE b/node_modules/xml-escape/LICENSE
new file mode 100644
index 000..bd261ef
--- /dev/null
+++ b/node_modules/xml-escape/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Michael Hernandez
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the Software), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/xml-escape/README.md 
b/node_modules/xml-escape/README.md
new file mode 100644
index 000..db55ce8
--- /dev/null
+++ b/node_modules/xml-escape/README.md
@@ -0,0 +1,15 @@
+xml-escape
+==
+
+Escape XML in javascript (NodeJS)
+
+
+npm install xml-escape
+
+// Warning escape is a reserved word, so maybe best to use xmlescape for var 
name
+var xmlescape = require('xml-escape');
+
+xmlescape('hello \'world\'  false  true  -1')
+
+// output
+// 'quot;helloquot; apos;worldapos; amp; true lt; false gt; -1'
\ No newline at end of file
diff --git a/node_modules/xml-escape/index.js b/node_modules/xml-escape/index.js
new file mode 100644
index 000..d26715d
--- /dev/null
+++ b/node_modules/xml-escape/index.js
@@ -0,0 +1,15 @@
+
+
+var escape = module.exports = function escape(string) {
+  return string.replace(/(['])/g, function(str, item) {
+return escape.map[item];
+  })
+}
+
+var map = escape.map = {
+'': 'gt;'
+  , '': 'lt;'
+  , ': 'apos;'
+  , '': 'quot;'
+  , '': 'amp;'
+}
\ No newline at end of file
diff --git a/node_modules/xml-escape/package.json 
b/node_modules/xml-escape/package.json
new file mode 100644
index 000..6cdd634
--- /dev/null
+++ b/node_modules/xml-escape/package.json
@@ -0,0 +1,53 @@
+{
+  name: xml-escape,
+  version: 1.0.0,
+  description: Escape XML ,
+  main: index.js,
+  scripts: {
+test: node test.js
+  },
+  repository: {
+type: git,
+url: git://github.com/miketheprogrammer/xml-escape.git
+  },
+  keywords: [
+Escape,
+XML,
+Unesacpe,
+encoding,
+xml-escape
+  ],
+  author: {
+name: Michael Hernandez - michael.hernandez1...@gmail.com
+  },
+  license: MIT License,
+  bugs: {
+url: https://github.com/miketheprogrammer/xml-escape/issues;
+  },
+  homepage: 

[MediaWiki-commits] [Gerrit] Make texvcjs compatible to texvc - change (mediawiki...mathoid)

2014-10-14 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Make texvcjs compatible to texvc
..


Make texvcjs compatible to texvc

Change-Id: I7508b273ef9c0c9c0084e87b968af9e69d14a7e9
---
M node_modules/texvcjs/CHANGELOG.md
M node_modules/texvcjs/lib/texutil.js
M node_modules/texvcjs/node_modules/commander/package.json
M node_modules/texvcjs/package.json
M package.json
5 files changed, 38 insertions(+), 80 deletions(-)

Approvals:
  GWicke: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/node_modules/texvcjs/CHANGELOG.md 
b/node_modules/texvcjs/CHANGELOG.md
index 2554e50..7b667c7 100644
--- a/node_modules/texvcjs/CHANGELOG.md
+++ b/node_modules/texvcjs/CHANGELOG.md
@@ -1,3 +1,5 @@
+# texvcjs x.x.x (not yet released)
+
 # texvcjs 0.3.1 (2014-07-29)
 
 * Color models for \color, \definecolor, and \pagecolor are now
diff --git a/node_modules/texvcjs/lib/texutil.js 
b/node_modules/texvcjs/lib/texutil.js
index a2d6e99..e36a5e8 100644
--- a/node_modules/texvcjs/lib/texutil.js
+++ b/node_modules/texvcjs/lib/texutil.js
@@ -498,31 +498,31 @@
 ]);
 
 module.exports.other_literals3 = obj2map({
-\\C: \\mathbb {C},
-\\H: \\mathbb {H},
-\\N: \\mathbb {N},
-\\Q: \\mathbb {Q},
-\\R: \\mathbb {R},
-\\Z: \\mathbb {Z},
+\\C: \\mathbb{C},
+\\H: \\mathbb{H},
+\\N: \\mathbb{N},
+\\Q: \\mathbb{Q},
+\\R: \\mathbb{R},
+\\Z: \\mathbb{Z},
 \\alef: \\aleph,
 \\alefsym: \\aleph,
-\\Alpha: \\mathrm {A},
+\\Alpha: \\mathrm{A},
 \\and: \\land,
 \\ang: \\angle,
-\\Beta: \\mathrm {B},
+\\Beta: \\mathrm{B},
 \\bull: \\bullet,
-\\Chi: \\mathrm {X},
+\\Chi: \\mathrm{X},
 \\clubs: \\clubsuit,
-\\cnums: \\mathbb {C},
-\\Complex: \\mathbb {C},
+\\cnums: \\mathbb{C},
+\\Complex: \\mathbb{C},
 \\Dagger: \\ddagger,
 \\diamonds: \\diamondsuit,
 \\Doteq: \\doteqdot,
 \\doublecap: \\Cap,
 \\doublecup: \\Cup,
 \\empty: \\emptyset,
-\\Epsilon: \\mathrm {E},
-\\Eta: \\mathrm {H},
+\\Epsilon: \\mathrm{E},
+\\Eta: \\mathrm{H},
 \\exist: \\exists,
 \\ge: \\geq,
 \\gggtr: \\ggg,
@@ -532,9 +532,9 @@
 \\hearts: \\heartsuit,
 \\image: \\Im,
 \\infin: \\infty,
-\\Iota: \\mathrm {I},
+\\Iota: \\mathrm{I},
 \\isin: \\in,
-\\Kappa: \\mathrm {K},
+\\Kappa: \\mathrm{K},
 \\larr: \\leftarrow,
 \\Larr: \\Leftarrow,
 \\lArr: \\Leftarrow,
@@ -542,13 +542,13 @@
 \\lrarr: \\leftrightarrow,
 \\Lrarr: \\Leftrightarrow,
 \\lrArr: \\Leftrightarrow,
-\\Mu: \\mathrm {M},
-\\natnums: \\mathbb {N},
+\\Mu: \\mathrm{M},
+\\natnums: \\mathbb{N},
 \\ne: \\neq,
-\\Nu: \\mathrm {N},
+\\Nu: \\mathrm{N},
 \\O: \\emptyset,
-\\omicron: \\mathrm {o},
-\\Omicron: \\mathrm {O},
+\\omicron: \\mathrm{o},
+\\Omicron: \\mathrm{O},
 \\or: \\lor,
 \\part: \\partial,
 \\plusmn: \\pm,
@@ -556,21 +556,21 @@
 \\Rarr: \\Rightarrow,
 \\rArr: \\Rightarrow,
 \\real: \\Re,
-\\reals: \\mathbb {R},
-\\Reals: \\mathbb {R},
+\\reals: \\mathbb{R},
+\\Reals: \\mathbb{R},
 \\restriction: \\upharpoonright,
-\\Rho: \\mathrm {P},
+\\Rho: \\mathrm{P},
 \\sdot: \\cdot,
 \\sect: \\S,
 \\spades: \\spadesuit,
 \\sub: \\subset,
 \\sube: \\subseteq,
 \\supe: \\supseteq,
-\\Tau: \\mathrm {T},
+\\Tau: \\mathrm{T},
 \\thetasym: \\vartheta,
 \\varcoppa: \\mbox{\\coppa},
 \\weierp: \\wp,
-\\Zeta: \\mathrm {Z}
+\\Zeta: \\mathrm{Z}
 });
 
 module.exports.big_literals = arr2set([
diff --git a/node_modules/texvcjs/node_modules/commander/package.json 
b/node_modules/texvcjs/node_modules/commander/package.json
index 3ad8e9b..8f3f2d0 100644
--- a/node_modules/texvcjs/node_modules/commander/package.json
+++ b/node_modules/texvcjs/node_modules/commander/package.json
@@ -30,42 +30,11 @@
   files: [
 index.js
   ],
-  gitHead: 7e9f407ec03d4371a478c2fe417db4998ecb6169,
+  readme: # Commander.js\n\n  The complete solution for 
[node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's 
[commander](https://github.com/visionmedia/commander).\n\n [![Build 
Status](https://api.travis-ci.org/visionmedia/commander.js.svg)](http://travis-ci.org/visionmedia/commander.js)\n\n##
 Installation\n\n$ npm install commander\n\n## Option parsing\n\n Options 
with commander are defined with the `.option()` method, also serving as 
documentation for the options. The example below parses args and options from 
`process.argv`, leaving remaining args as the `program.args` array which were 
not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module 
dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n  
.version('0.0.1')\n  .option('-p, --peppers', 'Add peppers')\n  .option('-P, 
--pineapple', 'Add pineapple')\n  .option('-b, --bbq', 'Add bbq 

[MediaWiki-commits] [Gerrit] Fix: FakeDatabasUpdater::setAppliedUpdates - change (mediawiki/core)

2014-10-13 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix: FakeDatabasUpdater::setAppliedUpdates
..

Fix: FakeDatabasUpdater::setAppliedUpdates

To be consistent with DatabaseUpdater::setAppliedUpdates
the second arg $updates is now optional.
This caused a problem at
https://travis-ci.org/Krinkle/mediawiki-core/jobs/37801162

Change-Id: Ida2adfe30099ea4c65f0c16fafc4eae6603fc93a
---
M tests/phpunit/includes/installer/DatabaseUpdaterTest.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/166405/1

diff --git a/tests/phpunit/includes/installer/DatabaseUpdaterTest.php 
b/tests/phpunit/includes/installer/DatabaseUpdaterTest.php
index 29c3052..a05acbd 100644
--- a/tests/phpunit/includes/installer/DatabaseUpdaterTest.php
+++ b/tests/phpunit/includes/installer/DatabaseUpdaterTest.php
@@ -272,8 +272,8 @@
public function canUseNewUpdatelog() {
return true;
}
-
-   public function setAppliedUpdates( $version, $updates ) {
+   
+   public function setAppliedUpdates( $version, $updates = array() ) {
parent::setAppliedUpdates( $version, $updates );
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida2adfe30099ea4c65f0c16fafc4eae6603fc93a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Allow the default rendering modes on beta - change (operations/mediawiki-config)

2014-10-13 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Allow the default rendering modes on beta
..

Allow the default rendering modes on beta

Client side MathJax rendering will become
one mode that is avaible per default in
Math 2.0. Overwriting the default value
with a setting that does not include the
MathJax rendering mode, disables MathJax.

Change-Id: I22c35070fb7300c4390136bbc2140b55dccf164e
---
M wmf-config/CommonSettings-labs.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/10/166410/1

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index b47ae0b..029f640 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -146,7 +146,6 @@
 if( $wmgUseMath ) {
$wgMathFileBackend = false;
$wgMathDirectory   = '/data/project/upload7/math';
-   $wgMathValidModes = array( MW_MATH_PNG, MW_MATH_SOURCE, MW_MATH_MATHML 
);
$wgMathMathMLUrl = 'http://deployment-mathoid.eqiad.wmflabs:10042';
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I22c35070fb7300c4390136bbc2140b55dccf164e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Fix centering of PNG image in display mode. - change (mediawiki...Math)

2014-10-12 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Fix centering of PNG image in display mode.
..


Fix centering of PNG image in display mode.

Revert the mistake made in https://gerrit.wikimedia.org/r/#/c/139120.

Change-Id: I31420ba3ab1e1b47c3e7307ac4a9aca2a6a8223f
---
M modules/ext.math.css
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/modules/ext.math.css b/modules/ext.math.css
index dbd9477..814021a 100644
--- a/modules/ext.math.css
+++ b/modules/ext.math.css
@@ -39,7 +39,7 @@
 
 /* Default style for the PNG fallback. */
 img.mwe-math-fallback-png-inline { display: inline; vertical-align: middle; }
-img.mwe-math-fallback-png-display { display: block; }
+img.mwe-math-fallback-png-display { display: block; margin-left: auto; 
margin-right: auto; }
 
 /* Default style for the source fallback. */
 .mwe-math-fallback-source-inline { display: inline; vertical-align: middle; }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I31420ba3ab1e1b47c3e7307ac4a9aca2a6a8223f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Frédéric Wang fred.w...@free.fr
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Rename fallback-svg and fallback-png to fallback-image - change (mediawiki...Math)

2014-10-12 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Rename fallback-svg and fallback-png to fallback-image
..


Rename fallback-svg and fallback-png to fallback-image

- Merge fallback-svg and fallback-png into one fallback-image class.
- Move the vertical centering of PNG to MathTexvc and ext.math.js.
- Remove img from ext.math.css to reduce CSS specificity and make
  style easier to override by user stylesheets.
- Add a comment about the !important rules for centering in
  display mode.
- Only load ext.math.scripts in MathML mode.

Bug: 71955
Change-Id: If8ee1cf6453257a0a2f6aa186d4007954a8e5d8e
---
M Math.hooks.php
M MathMathML.php
M MathTexvc.php
M modules/ext.math.css
M modules/ext.math.js
5 files changed, 20 insertions(+), 17 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/Math.hooks.php b/Math.hooks.php
index 47bdf0c..e2ef1db 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -134,8 +134,9 @@
$parser-getOutput()-addModules( array( 
'ext.math.mathjax.enabler' ) );
}
$parser-getOutput()-addModuleStyles( array( 'ext.math.styles' 
) );
-   $parser-getOutput()-addModules( array( 'ext.math.scripts' ) );
-
+   if ( $mode == MW_MATH_MATHML ) {
+   $parser-getOutput()-addModules( array( 
'ext.math.scripts' ) );
+   }
// Writes cache if rendering was successful
$renderer-writeCache();
wfProfileOut( __METHOD__ );
diff --git a/MathMathML.php b/MathMathML.php
index 08b7bf2..789bc2e 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -399,7 +399,7 @@
private function getClassName( $fallback = false ) {
$class = mwe-math-;
if ( $fallback ) {
-   $class .= 'fallback-svg-';
+   $class .= 'fallback-image-';
} else {
$class .= 'mathml-';
}
diff --git a/MathTexvc.php b/MathTexvc.php
index 057007c..fe2004d 100644
--- a/MathTexvc.php
+++ b/MathTexvc.php
@@ -135,12 +135,15 @@
$attributes = array(
// the former class name was 'tex'
// for backwards compatibility we keep that classname
-   'class' = 'mwe-math-fallback-png-inline tex',
+   'class' = 'mwe-math-fallback-image-inline tex',
'alt' = $this-getTex()
);
if ( $this-getMathStyle() === MW_MATHSTYLE_DISPLAY ){
// if DisplayStyle is true, the equation will be 
centered in a new line
-   $attributes[ 'class' ] = 'mwe-math-fallback-png-display 
tex';
+   $attributes[ 'class' ] = 
'mwe-math-fallback-image-display tex';
+   } else {
+   // Otherwise, do the vertical alignment.
+   $attributes[ 'style' ] = 'vertical-align: middle;';
}
return Xml::element( 'img',
$this-getAttributes(
diff --git a/modules/ext.math.css b/modules/ext.math.css
index 68574f5..670953e 100644
--- a/modules/ext.math.css
+++ b/modules/ext.math.css
@@ -33,13 +33,11 @@
 src: url(./LatinModern/latinmodern-math.woff);
 }
 
-/* Default style for the SVG fallback. */
-img.mwe-math-fallback-svg-inline { display: inline; }
-img.mwe-math-fallback-svg-display { display: block; margin-left: auto 
!important; margin-right: auto !important; }
-
-/* Default style for the PNG fallback. */
-img.mwe-math-fallback-png-inline { display: inline; vertical-align: middle; }
-img.mwe-math-fallback-png-display { display: block; margin-left: auto; 
margin-right: auto; }
+/* Default style for the image fallback. */
+/* Note: We had to use !important rules because of conflicts with the style
+   generated by Mathoid. See https://gerrit.wikimedia.org/r/#/c/166213/ */
+.mwe-math-fallback-image-inline { display: inline; }
+.mwe-math-fallback-image-display { display: block; margin-left: auto 
!important; margin-right: auto !important; }
 
 /* Default style for the source fallback. */
 .mwe-math-fallback-source-inline { display: inline; vertical-align: middle; }
@@ -60,6 +58,6 @@
 height: auto;
 opacity: 1;
 }
-.mwe-math-mathml-inline + img.mwe-math-fallback-svg-inline,
-.mwe-math-mathml-display + img.mwe-math-fallback-svg-display { display: 
none !important; }
+.mwe-math-mathml-inline + .mwe-math-fallback-image-inline,
+.mwe-math-mathml-display + .mwe-math-fallback-image-display { display: 
none !important; }
 }
diff --git a/modules/ext.math.js b/modules/ext.math.js
index 2f6e5d1..5a88a0c 100644
--- a/modules/ext.math.js
+++ b/modules/ext.math.js
@@ -6,18 +6,19 @@
// If MathPlayer is installed we show the MathML rendering.
if 

[MediaWiki-commits] [Gerrit] Fix Debian packaging by removing MathJax directory - change (mediawiki...mathoid)

2014-10-12 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Fix Debian packaging by removing MathJax directory
..


Fix Debian packaging by removing MathJax directory

The mathjax source is now nested inside of MathJaxNode.

Change-Id: I6ed988ae1b0da05ce44bb559a8ccb5af7fa7cddd
---
M debian/mathoid.install
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/debian/mathoid.install b/debian/mathoid.install
index 183bba7..356780d 100644
--- a/debian/mathoid.install
+++ b/debian/mathoid.install
@@ -2,7 +2,5 @@
 *.{js,json,txt,html,md} usr/lib/mathoid/
 # node modules
 node_modules/ usr/lib/mathoid/
-#MathJax
-MathJax/ usr/lib/mathoid/
 #MathJaxNode
-MathJaxNode/ usr/lib/mathoid/
\ No newline at end of file
+MathJaxNode/ usr/lib/mathoid/

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ed988ae1b0da05ce44bb559a8ccb5af7fa7cddd
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: GWicke gwi...@wikimedia.org
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Use texvcjs for TeX sanitization - change (mediawiki...mathoid)

2014-10-12 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Use texvcjs for TeX sanitization
..


Use texvcjs for TeX sanitization

- return 'sanetex' attribute with the sanitized tex source
- detabify
- if the input can not be sanitized an error is returned
- note: mathoid uses the original user input for the actual
  processing and not sanetex

Change-Id: I20a4431a1277bb2c7a7a8bfadc5a7ef803f7e2ab
---
M mathoid-worker.js
A node_modules/texvcjs/.jshintignore
A node_modules/texvcjs/.jshintrc
A node_modules/texvcjs/.npmignore
A node_modules/texvcjs/.travis.yml
A node_modules/texvcjs/CHANGELOG.md
A node_modules/texvcjs/README.md
A node_modules/texvcjs/TODO.md
A node_modules/texvcjs/bin/texvcjs
A node_modules/texvcjs/lib/ast.js
A node_modules/texvcjs/lib/astutil.js
A node_modules/texvcjs/lib/build-parser.js
A node_modules/texvcjs/lib/index.js
A node_modules/texvcjs/lib/parser.js
A node_modules/texvcjs/lib/parser.pegjs
A node_modules/texvcjs/lib/render.js
A node_modules/texvcjs/lib/texutil.js
A node_modules/texvcjs/node_modules/commander/Readme.md
A node_modules/texvcjs/node_modules/commander/index.js
A node_modules/texvcjs/node_modules/commander/package.json
A node_modules/texvcjs/package.json
A node_modules/texvcjs/test/all.js
A node_modules/texvcjs/test/api.js
A node_modules/texvcjs/test/ast.js
A node_modules/texvcjs/test/contains.js
A node_modules/texvcjs/test/en-wiki-formulae.js
A node_modules/texvcjs/test/en-wiki-formulae.txt
A node_modules/texvcjs/test/mocha.opts
A node_modules/texvcjs/test/parser.js
A node_modules/texvcjs/test/render.js
M package.json
31 files changed, 298,732 insertions(+), 70 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I20a4431a1277bb2c7a7a8bfadc5a7ef803f7e2ab
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: GWicke gwi...@wikimedia.org
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add simple API test runner - change (mediawiki...mathoid)

2014-10-12 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Add simple API test runner
..


Add simple API test runner

Bug: 71755
Change-Id: I996a1f5b602c316adbdaf7a03aceeec6e8c4b0e3
---
A .travis.yml
M mathoid-worker.js
A node_modules/preq/index.js
A node_modules/preq/node_modules/bluebird/LICENSE
A node_modules/preq/node_modules/bluebird/README.md
A node_modules/preq/node_modules/bluebird/js/main/any.js
A node_modules/preq/node_modules/bluebird/js/main/assert.js
A node_modules/preq/node_modules/bluebird/js/main/async.js
A node_modules/preq/node_modules/bluebird/js/main/bluebird.js
A node_modules/preq/node_modules/bluebird/js/main/call_get.js
A node_modules/preq/node_modules/bluebird/js/main/cancel.js
A node_modules/preq/node_modules/bluebird/js/main/captured_trace.js
A node_modules/preq/node_modules/bluebird/js/main/catch_filter.js
A node_modules/preq/node_modules/bluebird/js/main/direct_resolve.js
A node_modules/preq/node_modules/bluebird/js/main/each.js
A node_modules/preq/node_modules/bluebird/js/main/errors.js
A node_modules/preq/node_modules/bluebird/js/main/errors_api_rejection.js
A node_modules/preq/node_modules/bluebird/js/main/es5.js
A node_modules/preq/node_modules/bluebird/js/main/filter.js
A node_modules/preq/node_modules/bluebird/js/main/finally.js
A node_modules/preq/node_modules/bluebird/js/main/generators.js
A node_modules/preq/node_modules/bluebird/js/main/join.js
A node_modules/preq/node_modules/bluebird/js/main/map.js
A node_modules/preq/node_modules/bluebird/js/main/nodeify.js
A node_modules/preq/node_modules/bluebird/js/main/progress.js
A node_modules/preq/node_modules/bluebird/js/main/promise.js
A node_modules/preq/node_modules/bluebird/js/main/promise_array.js
A node_modules/preq/node_modules/bluebird/js/main/promise_resolver.js
A node_modules/preq/node_modules/bluebird/js/main/promisify.js
A node_modules/preq/node_modules/bluebird/js/main/props.js
A node_modules/preq/node_modules/bluebird/js/main/queue.js
A node_modules/preq/node_modules/bluebird/js/main/race.js
A node_modules/preq/node_modules/bluebird/js/main/reduce.js
A node_modules/preq/node_modules/bluebird/js/main/schedule.js
A node_modules/preq/node_modules/bluebird/js/main/settle.js
A node_modules/preq/node_modules/bluebird/js/main/some.js
A node_modules/preq/node_modules/bluebird/js/main/synchronous_inspection.js
A node_modules/preq/node_modules/bluebird/js/main/thenables.js
A node_modules/preq/node_modules/bluebird/js/main/timers.js
A node_modules/preq/node_modules/bluebird/js/main/using.js
A node_modules/preq/node_modules/bluebird/js/main/util.js
A node_modules/preq/node_modules/bluebird/js/zalgo/any.js
A node_modules/preq/node_modules/bluebird/js/zalgo/assert.js
A node_modules/preq/node_modules/bluebird/js/zalgo/async.js
A node_modules/preq/node_modules/bluebird/js/zalgo/bluebird.js
A node_modules/preq/node_modules/bluebird/js/zalgo/call_get.js
A node_modules/preq/node_modules/bluebird/js/zalgo/cancel.js
A node_modules/preq/node_modules/bluebird/js/zalgo/captured_trace.js
A node_modules/preq/node_modules/bluebird/js/zalgo/catch_filter.js
A node_modules/preq/node_modules/bluebird/js/zalgo/direct_resolve.js
A node_modules/preq/node_modules/bluebird/js/zalgo/each.js
A node_modules/preq/node_modules/bluebird/js/zalgo/errors.js
A node_modules/preq/node_modules/bluebird/js/zalgo/errors_api_rejection.js
A node_modules/preq/node_modules/bluebird/js/zalgo/es5.js
A node_modules/preq/node_modules/bluebird/js/zalgo/filter.js
A node_modules/preq/node_modules/bluebird/js/zalgo/finally.js
A node_modules/preq/node_modules/bluebird/js/zalgo/generators.js
A node_modules/preq/node_modules/bluebird/js/zalgo/join.js
A node_modules/preq/node_modules/bluebird/js/zalgo/map.js
A node_modules/preq/node_modules/bluebird/js/zalgo/nodeify.js
A node_modules/preq/node_modules/bluebird/js/zalgo/progress.js
A node_modules/preq/node_modules/bluebird/js/zalgo/promise.js
A node_modules/preq/node_modules/bluebird/js/zalgo/promise_array.js
A node_modules/preq/node_modules/bluebird/js/zalgo/promise_resolver.js
A node_modules/preq/node_modules/bluebird/js/zalgo/promisify.js
A node_modules/preq/node_modules/bluebird/js/zalgo/props.js
A node_modules/preq/node_modules/bluebird/js/zalgo/queue.js
A node_modules/preq/node_modules/bluebird/js/zalgo/race.js
A node_modules/preq/node_modules/bluebird/js/zalgo/reduce.js
A node_modules/preq/node_modules/bluebird/js/zalgo/schedule.js
A node_modules/preq/node_modules/bluebird/js/zalgo/settle.js
A node_modules/preq/node_modules/bluebird/js/zalgo/some.js
A node_modules/preq/node_modules/bluebird/js/zalgo/synchronous_inspection.js
A node_modules/preq/node_modules/bluebird/js/zalgo/thenables.js
A node_modules/preq/node_modules/bluebird/js/zalgo/timers.js
A node_modules/preq/node_modules/bluebird/js/zalgo/using.js
A node_modules/preq/node_modules/bluebird/js/zalgo/util.js
A node_modules/preq/node_modules/bluebird/package.json
A 

[MediaWiki-commits] [Gerrit] Make texvcjs compatible to texvc - change (mediawiki...mathoid)

2014-10-12 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Make texvcjs compatible to texvc
..

Make texvcjs compatible to texvc

Change-Id: I7508b273ef9c0c9c0084e87b968af9e69d14a7e9
---
M node_modules/texvcjs/lib/texutil.js
1 file changed, 25 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/53/166353/1

diff --git a/node_modules/texvcjs/lib/texutil.js 
b/node_modules/texvcjs/lib/texutil.js
index a2d6e99..e36a5e8 100644
--- a/node_modules/texvcjs/lib/texutil.js
+++ b/node_modules/texvcjs/lib/texutil.js
@@ -498,31 +498,31 @@
 ]);
 
 module.exports.other_literals3 = obj2map({
-\\C: \\mathbb {C},
-\\H: \\mathbb {H},
-\\N: \\mathbb {N},
-\\Q: \\mathbb {Q},
-\\R: \\mathbb {R},
-\\Z: \\mathbb {Z},
+\\C: \\mathbb{C},
+\\H: \\mathbb{H},
+\\N: \\mathbb{N},
+\\Q: \\mathbb{Q},
+\\R: \\mathbb{R},
+\\Z: \\mathbb{Z},
 \\alef: \\aleph,
 \\alefsym: \\aleph,
-\\Alpha: \\mathrm {A},
+\\Alpha: \\mathrm{A},
 \\and: \\land,
 \\ang: \\angle,
-\\Beta: \\mathrm {B},
+\\Beta: \\mathrm{B},
 \\bull: \\bullet,
-\\Chi: \\mathrm {X},
+\\Chi: \\mathrm{X},
 \\clubs: \\clubsuit,
-\\cnums: \\mathbb {C},
-\\Complex: \\mathbb {C},
+\\cnums: \\mathbb{C},
+\\Complex: \\mathbb{C},
 \\Dagger: \\ddagger,
 \\diamonds: \\diamondsuit,
 \\Doteq: \\doteqdot,
 \\doublecap: \\Cap,
 \\doublecup: \\Cup,
 \\empty: \\emptyset,
-\\Epsilon: \\mathrm {E},
-\\Eta: \\mathrm {H},
+\\Epsilon: \\mathrm{E},
+\\Eta: \\mathrm{H},
 \\exist: \\exists,
 \\ge: \\geq,
 \\gggtr: \\ggg,
@@ -532,9 +532,9 @@
 \\hearts: \\heartsuit,
 \\image: \\Im,
 \\infin: \\infty,
-\\Iota: \\mathrm {I},
+\\Iota: \\mathrm{I},
 \\isin: \\in,
-\\Kappa: \\mathrm {K},
+\\Kappa: \\mathrm{K},
 \\larr: \\leftarrow,
 \\Larr: \\Leftarrow,
 \\lArr: \\Leftarrow,
@@ -542,13 +542,13 @@
 \\lrarr: \\leftrightarrow,
 \\Lrarr: \\Leftrightarrow,
 \\lrArr: \\Leftrightarrow,
-\\Mu: \\mathrm {M},
-\\natnums: \\mathbb {N},
+\\Mu: \\mathrm{M},
+\\natnums: \\mathbb{N},
 \\ne: \\neq,
-\\Nu: \\mathrm {N},
+\\Nu: \\mathrm{N},
 \\O: \\emptyset,
-\\omicron: \\mathrm {o},
-\\Omicron: \\mathrm {O},
+\\omicron: \\mathrm{o},
+\\Omicron: \\mathrm{O},
 \\or: \\lor,
 \\part: \\partial,
 \\plusmn: \\pm,
@@ -556,21 +556,21 @@
 \\Rarr: \\Rightarrow,
 \\rArr: \\Rightarrow,
 \\real: \\Re,
-\\reals: \\mathbb {R},
-\\Reals: \\mathbb {R},
+\\reals: \\mathbb{R},
+\\Reals: \\mathbb{R},
 \\restriction: \\upharpoonright,
-\\Rho: \\mathrm {P},
+\\Rho: \\mathrm{P},
 \\sdot: \\cdot,
 \\sect: \\S,
 \\spades: \\spadesuit,
 \\sub: \\subset,
 \\sube: \\subseteq,
 \\supe: \\supseteq,
-\\Tau: \\mathrm {T},
+\\Tau: \\mathrm{T},
 \\thetasym: \\vartheta,
 \\varcoppa: \\mbox{\\coppa},
 \\weierp: \\wp,
-\\Zeta: \\mathrm {Z}
+\\Zeta: \\mathrm{Z}
 });
 
 module.exports.big_literals = arr2set([

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7508b273ef9c0c9c0084e87b968af9e69d14a7e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Merge recent changes from MathJax - change (mediawiki...mathoid)

2014-10-12 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Merge recent changes from MathJax
..

Merge recent changes from MathJax

Fixes problems with align environment and
invalid XML markup (bcc2390).

Bug: 66572
Change-Id: If6739965b4c7d9110f489e5c973a7bfa0e8d329f
---
M MathJaxNode/mathjax/unpacked/extensions/toMathML.js
M MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js
M MathJaxNode/mathjax/unpacked/jax/output/NativeMML/jax.js
M mathoid-worker.js
4 files changed, 66 insertions(+), 65 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/58/166358/1

diff --git a/MathJaxNode/mathjax/unpacked/extensions/toMathML.js 
b/MathJaxNode/mathjax/unpacked/extensions/toMathML.js
index 61fb02a..aae34f7 100644
--- a/MathJaxNode/mathjax/unpacked/extensions/toMathML.js
+++ b/MathJaxNode/mathjax/unpacked/extensions/toMathML.js
@@ -52,13 +52,14 @@
 
 toMathMLattributes: function () {
   var attr = [], defaults = this.defaults;
-  var copy = (this.attrNames||MML.copyAttributeNames), skip = 
MML.skipAttributes;
+  var names = (this.attrNames||MML.copyAttributeNames),
+  skip = MML.skipAttributes, copy = MML.copyAttributes;
 
   if (this.type === math  (!this.attr || !this.attr.xmlns))
 {attr.push('xmlns=http://www.w3.org/1998/Math/MathML;')}
   if (!this.attrNames) {
 if (this.type === mstyle) {defaults = MML.math.prototype.defaults}
-for (var id in defaults) {if (!skip[id]  
defaults.hasOwnProperty(id)) {
+for (var id in defaults) {if (!skip[id]  !copy[id]  
defaults.hasOwnProperty(id)) {
   if (this[id] != null  this[id] !== defaults[id]) {
 var value = this[id]; delete this[id];
 if (this.Get(id) !== value) 
{attr.push(id+'='+this.toMathMLattribute(value)+'')}
@@ -66,10 +67,10 @@
   }
 }}
   }
-  for (var i = 0, m = copy.length; i  m; i++) {
-if (copy[i] === class) continue;  // this is handled separately below
-value = (this.attr||{})[copy[i]]; if (value == null) {value = 
this[copy[i]]}
-if (value != null) 
{attr.push(copy[i]+'='+this.toMathMLquote(value)+'')}
+  for (var i = 0, m = names.length; i  m; i++) {
+if (copy[names[i]] === 1  !defaults.hasOwnProperty(names[i])) 
continue;
+value = (this.attr||{})[names[i]]; if (value == null) {value = 
this[names[i]]}
+if (value != null) 
{attr.push(names[i]+'='+this.toMathMLquote(value)+'')}
   }
   this.toMathMLclass(attr);
   if (attr.length) {return  +attr.join( )} else {return }
diff --git a/MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js 
b/MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js
index bff6b2f..c7c0ac6 100644
--- a/MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js
+++ b/MathJaxNode/mathjax/unpacked/jax/element/mml/jax.js
@@ -4,21 +4,21 @@
 /*
  *
  *  MathJax/jax/element/mml/jax.js
- *
+ *  
  *  Implements the MML ElementJax that holds the internal represetation
  *  of the mathematics on the page.  Various InputJax will produce this
  *  format, and the OutputJax will display it in various formats.
  *
  *  -
- *
+ *  
  *  Copyright (c) 2009-2014 The MathJax Consortium
- *
+ * 
  *  Licensed under the Apache License, Version 2.0 (the License);
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
- *
+ * 
  *  http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an AS IS BASIS,
  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -214,14 +214,17 @@
 NONE:   -1
   },
   TEXCLASSNAMES: [ORD, OP, BIN, REL, OPEN, CLOSE, PUNCT, 
INNER, VCENTER],
+  skipAttributes: {
+texClass:true, useHeight:true, texprimestyle:true
+  },
   copyAttributes: {
+displaystyle:1, scriptlevel:1, open:1, close:1, form:1,
 fontfamily:true, fontsize:true, fontweight:true, fontstyle:true,
 color:true, background:true,
-id:true, class:true, href:true, style:true
+id:true, class:1, href:true, style:true
   },
-  skipAttributes: {texClass: true, useHeight: true, texprimestyle: true},
   copyAttributeNames: [
-open, close, form,  // force these to be copied
+displaystyle, scriptlevel, open, close, form,  // force these to 
be copied
 fontfamily, fontsize, fontweight, fontstyle,
 color, background,
 id, class, href, style
@@ -254,7 +257,7 @@
   texClass: true
 },
 linebreakContainer: false,
-
+
 Init: function () {
   this.data = [];
   if (this.inferRow  !(arguments.length === 1  arguments[0].inferred))
@@ -435,7 +438,7 

[MediaWiki-commits] [Gerrit] Avoid that links break styles - change (mediawiki...MathSearch)

2014-10-12 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Avoid that links break styles
..

Avoid that links break styles

Wrapping the links to the FormulaInfo specialpage
avoids that the styles from the Math extension are broken.
The reason for that is that unclosed p-Tags prevent
cause invalid markup that is fixed badly by the browser.

Change-Id: If2bef6eb4af038174b8600515cfac1db9127830c
---
M MathSearch.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/59/166359/1

diff --git a/MathSearch.hooks.php b/MathSearch.hooks.php
index 202f079..cab93d8 100644
--- a/MathSearch.hooks.php
+++ b/MathSearch.hooks.php
@@ -179,7 +179,7 @@
static function addLinkToFormulaInfoPage( MathRenderer $Renderer, 
$Result = null, $pid = 0, $eid = 0 ) {
self::setMathId( $eid , $Renderer );
$url = SpecialPage::getTitleFor( 'FormulaInfo' )-getLocalUrl( 
array( 'pid' = $pid, 'eid' = $eid ) );
-   $Result = a href=\$url\ id=\$eid\ 
style=\color:inherit;\$Result/a;
+   $Result = diva href=\$url\ id=\$eid\ 
style=\color:inherit;\$Result/a/div;
return true;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2bef6eb4af038174b8600515cfac1db9127830c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Cleanup after the removal of the PNG fallback - change (mediawiki...Math)

2014-10-11 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Cleanup after the removal of the PNG fallback
..


Cleanup after the removal of the PNG fallback

- remove the default display: none style on the SVG fallback
- remove the IE CSS hacks from ext.math.css
- add a client-side implementation of the PNG fallback

Bug: 71912
Change-Id: I91b11313aae25c4d05f8f2333d2f21537c9b8887
---
M MathMathML.php
M modules/ext.math.css
M modules/ext.math.js
3 files changed, 21 insertions(+), 20 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/MathMathML.php b/MathMathML.php
index 332454b..d1554c2 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -382,12 +382,11 @@
$attribs = array();
if ( $classOverride === false ) { // $class = '' suppresses 
class attribute
$class = $this-getClassName( true, $png );
-   $style = $png ? '' : 'display: none;';
} else {
$class  = $classOverride;
-   $style = '';
}
 
+   $style = '';
if ( !$png ) {
$this-correctSvgStyle( $this-getSvg(), $style );
}
@@ -452,9 +451,6 @@
}
$output .= Xml::tags( $element, array( 'class' = 
$this-getClassName(), 'style' = 'display: none;'  ), $mml );
$output .= $this-getFallbackImage( $this-getMode() ) . \n;
-   // TODO: Implement PNG image fallbacks without loading images in
-   // browsers that support MathML or SVG!
-   // $output .= $this-getFallbackImage( MW_MATH_PNG ) . \n;
$output .= HTML::closeElement( $element );
return $output;
}
diff --git a/modules/ext.math.css b/modules/ext.math.css
index 6b9b32b..dbd9477 100644
--- a/modules/ext.math.css
+++ b/modules/ext.math.css
@@ -33,9 +33,9 @@
 src: url(./LatinModern/latinmodern-math.woff);
 }
 
-/* Default style for SVG. */
-img.mwe-math-fallback-svg-inline { display: none; }
-img.mwe-math-fallback-svg-display { display: none; margin-left: auto; 
margin-right: auto; }
+/* Default style for the SVG fallback. */
+img.mwe-math-fallback-svg-inline { display: inline; }
+img.mwe-math-fallback-svg-display { display: block; margin-left: auto; 
margin-right: auto; }
 
 /* Default style for the PNG fallback. */
 img.mwe-math-fallback-png-inline { display: inline; vertical-align: middle; }
@@ -49,13 +49,6 @@
 /* Browser-specific hacks are bad but let's use that for now...
See http://browserhacks.com/ */
 
-/* For all browsers but IE  9, hide the PNG fallback and show the SVG instead.
-   We override the default style for PNG and SVG above */
-:root *  img.mwe-math-fallback-svg-inline { display: inline !important; }
-:root *  img.mwe-math-fallback-svg-display { display: block !important; }
-:root *  img.mwe-math-fallback-svg-inline + img.mwe-math-fallback-png-inline,
-:root *  img.mwe-math-fallback-svg-display + 
img.mwe-math-fallback-png-display { display: none; }
-
 @-moz-document url-prefix() {
 /* For Gecko browsers, hide the SVG fallback and show the MathML instead.
We override the style for SVG and MathML above */
@@ -67,6 +60,6 @@
 height: auto;
 opacity: 1;
 }
-:root *  .mwe-math-mathml-inline + img.mwe-math-fallback-svg-inline,
-:root *  .mwe-math-mathml-display + img.mwe-math-fallback-svg-display { 
display: none !important; }
+.mwe-math-mathml-inline + img.mwe-math-fallback-svg-inline,
+.mwe-math-mathml-display + img.mwe-math-fallback-svg-display { display: 
none !important; }
 }
diff --git a/modules/ext.math.js b/modules/ext.math.js
index a043014..48c84ed 100644
--- a/modules/ext.math.js
+++ b/modules/ext.math.js
@@ -1,10 +1,22 @@
 ( function ( $ ) {
'use strict';
+   // These constants are taken from Math.php
+   var MW_MATH_PNG = 0, MW_MATH_MATHML = 5;
+
// If MathPlayer is installed we show the MathML rendering.
if (navigator.userAgent.indexOf('MathPlayer')  -1) {
$( '.mwe-math-mathml-a11y' ).removeClass( 
'mwe-math-mathml-a11y' );
-   $( 'img' ).removeClass( 'mwe-math-fallback-svg-inline 
mwe-math-fallback-svg-display' );
+   $( 'img.mwe-math-fallback-svg-inline, 
img.mwe-math-fallback-svg-display' ).css( 'display', 'none' );
+   return;
}
-   // FIXME: for browsers without SVG support, the img fallback should be
-   // updated to point to PNG images.
+
+   // We verify whether SVG as img is supported and otherwise use the
+   // PNG fallback. See 
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/svg/asimg.js
+   if 
(!document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image',
 '1.1')) {
+   $( 

[MediaWiki-commits] [Gerrit] Avoid calling readFromDatabase in source mode - change (mediawiki...Math)

2014-10-11 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Avoid calling readFromDatabase in source mode
..

Avoid calling readFromDatabase in source mode

In source mode there is no database cache,
so we do not need to call readFromDatabase there.

Change-Id: I791eab923f5ed6e0a3e28dbaf49ba1ae8fdb6cdc
---
M MathRenderer.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/MathRenderer.php b/MathRenderer.php
index c214a23..6784ff4 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -610,7 +610,7 @@
// equation was already checked or checking is disabled
return true;
} else {
-   if( (int) $wgMathDisableTexFilter == MW_MATH_CHECK_NEW 
){
+   if( (int) $wgMathDisableTexFilter == MW_MATH_CHECK_NEW 
 $this-mode != MW_MATH_SOURCE ){
if( $this-readFromDatabase() ){
return true;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I791eab923f5ed6e0a3e28dbaf49ba1ae8fdb6cdc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Improvements to the PNG fallback style. - change (mediawiki...Math)

2014-10-11 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Improvements to the PNG fallback style.
..


Improvements to the PNG fallback style.

- create a new img tag to avoid copying unwanted style from the SVG fallback.
- keep the legacy tex class for consistency with the PNG mode.

Bug: 71912
Change-Id: Ibe4683d2898b49fda190e2f1535cab1b952250b0
---
M modules/ext.math.js
1 file changed, 11 insertions(+), 5 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/modules/ext.math.js b/modules/ext.math.js
index 48c84ed..2f6e5d1 100644
--- a/modules/ext.math.js
+++ b/modules/ext.math.js
@@ -1,7 +1,7 @@
 ( function ( $ ) {
'use strict';
-   // These constants are taken from Math.php
-   var MW_MATH_PNG = 0, MW_MATH_MATHML = 5;
+   // The MW_MATH_PNG and MW_MATH_MATHML constants are taken from Math.php
+   var MW_MATH_PNG = 0, MW_MATH_MATHML = 5, img;
 
// If MathPlayer is installed we show the MathML rendering.
if (navigator.userAgent.indexOf('MathPlayer')  -1) {
@@ -14,9 +14,15 @@
// PNG fallback. See 
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/svg/asimg.js
if 
(!document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image',
 '1.1')) {
$( 'img.mwe-math-fallback-svg-inline, 
img.mwe-math-fallback-svg-display' ).each(function() {
-   this.setAttribute('src', this.src.replace('mode=' + 
MW_MATH_MATHML, 'mode=' + MW_MATH_PNG));
+   // Create a new PNG image to use as the fallback.
+   img = document.createElement('img');
+   img.setAttribute( 'src', this.src.replace('mode=' + 
MW_MATH_MATHML, 'mode=' + MW_MATH_PNG) );
+   img.setAttribute( 'class', 'tex mwe-math-fallback-png-' 
+ ($( this ).hasClass('mwe-math-fallback-svg-inline') ? 'inline' : 'display') );
+   img.setAttribute( 'aria-hidden', 'true' );
+   this.parentNode.insertBefore( img, this );
+
+   // Hide the SVG fallback.
+   $( this ).css( 'display', 'none' );
});
-   $( 'img.mwe-math-fallback-svg-inline' ).removeClass( 
'mwe-math-fallback-svg-inline' ).addClass( 'mwe-math-fallback-png-inline' );
-   $( 'img.mwe-math-fallback-svg-display' ).removeClass( 
'mwe-math-fallback-svg-display' ).addClass( 'mwe-math-fallback-png-display' );
}
 }( jQuery ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe4683d2898b49fda190e2f1535cab1b952250b0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Frédéric Wang fred.w...@free.fr
Gerrit-Reviewer: Frédéric Wang fred.w...@free.fr
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add TeX annotation to MathML again - change (mediawiki...mathoid)

2014-10-11 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Add TeX annotation to MathML again
..


Add TeX annotation to MathML again

After mathoid's upgrade, the TeX annotation is no longer generated.
We use the new MathJax's config option semantics to fix that.

Bug: 71673
Change-Id: I79cf4e0ac40feae97da1dad8a172a6fc0d7987de
---
M mathoid-worker.js
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/mathoid-worker.js b/mathoid-worker.js
index 76dd0a7..e1f2db9 100644
--- a/mathoid-worker.js
+++ b/mathoid-worker.js
@@ -28,7 +28,8 @@
process.exit(1);
 }
 
-mjAPI.config({MathJax: {SVG: {font: font}}, displayError: true});
+mjAPI.config({MathJax: {SVG: {font: font}, menuSettings: {semantics: true}},
+  displayError: true});
 mjAPI.start();
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I79cf4e0ac40feae97da1dad8a172a6fc0d7987de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Frédéric Wang fred.w...@free.fr
Gerrit-Reviewer: GWicke gwi...@wikimedia.org
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Temporary fix to correct non well formed XML markup - change (mediawiki...Math)

2014-10-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Temporary fix to correct non well formed XML markup
..

Temporary fix to correct non well formed XML markup

Change-Id: I0362779a3b3db48a64fd4aca6230c317617e281d
---
M MathMathML.php
1 file changed, 5 insertions(+), 2 deletions(-)


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

diff --git a/MathMathML.php b/MathMathML.php
index b57d738..ad70c16 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -241,9 +241,12 @@
$jsonResult = json_decode( $res );
if ( $jsonResult  json_last_error() === 
JSON_ERROR_NONE ) {
if ( $jsonResult-success ) {
+   // temporary fix to replace non well 
formed XML generated by MathJax
+   $mml = preg_replace( 
'/displaystyle=true displaystyle=true/' , 'displaystyle=true' ,
+   $jsonResult-mml );
if ( $this-getMode() == 
MW_MATH_LATEXML ||
$this-inputType == 
'pmml' ||
-   $this-isValidMathML( 
$jsonResult-mml ) ) {
+   $this-isValidMathML( 
$mml ) ) {
$xmlObject = new XmlTypeCheck( 
$jsonResult-svg, null, false );
if ( ! $xmlObject-wellFormed ) 
{
$this-lastError = 
$this-getError( 'math_invalidxml', $host );
@@ -255,7 +258,7 @@
$this-setLog( 
$jsonResult-log );
}
if ( $this-getMode() != 
MW_MATH_LATEXML  $this-inputType != 'pmml') {
-   $this-setMathml( 
$jsonResult-mml );
+   $this-setMathml( $mml 
);
}
return true;
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0362779a3b3db48a64fd4aca6230c317617e281d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Strip duplicate displaystyle attribute returned by mathjax - change (mediawiki...mathoid)

2014-10-09 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Strip duplicate displaystyle attribute returned by mathjax
..


Strip duplicate displaystyle attribute returned by mathjax

Duplicate attributes are invalid XML, so this is a mathjax bug.

Change-Id: I5a9e77ccd293df9bad4ffaa3e4e8a389913b60e7
---
M mathoid-worker.js
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/mathoid-worker.js b/mathoid-worker.js
index 41d81d0..afc8551 100644
--- a/mathoid-worker.js
+++ b/mathoid-worker.js
@@ -83,6 +83,9 @@
data.success = true;
data.log = success;
}
+   if (data.mml) {
+   data.mml = data.mml.replace(/displaystyle=true 
(?=displaystyle)/, '');
+   }
res.writeHead(200,
{
'Content-Type': 'application/json'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5a9e77ccd293df9bad4ffaa3e4e8a389913b60e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: GWicke gwi...@wikimedia.org
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Massage SVG by removing some styles as well - change (mediawiki...mathoid)

2014-10-09 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Massage SVG by removing some styles as well
..


Massage SVG by removing some styles as well

Change-Id: I8d3cec0ee8a8c9368b7dca89e1d5e0c5683f946c
---
M mathoid-worker.js
1 file changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/mathoid-worker.js b/mathoid-worker.js
index afc8551..6f33763 100644
--- a/mathoid-worker.js
+++ b/mathoid-worker.js
@@ -83,9 +83,18 @@
data.success = true;
data.log = success;
}
+
+   // Temporary work-around for a duplicate attribute (invalid XML)
+   // returned by MathJax.
if (data.mml) {
data.mml = data.mml.replace(/displaystyle=true 
(?=displaystyle)/, '');
}
+
+   // Strip some styling returned by MathJax
+   if (data.svg) {
+   data.svg = 
data.svg.replace(/(style=[^]*)(?:margin|position):[^;]+;/, '$1');
+   }
+
res.writeHead(200,
{
'Content-Type': 'application/json'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d3cec0ee8a8c9368b7dca89e1d5e0c5683f946c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: GWicke gwi...@wikimedia.org
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Revert Disable failing latexml integration tests - change (mediawiki...Math)

2014-10-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Revert Disable failing latexml integration tests
..

Revert Disable failing latexml integration tests

This reverts commit 4c544f002b09e37c56e2c1d80700a2c95b07660a.

Change-Id: Ifafb5782e10e80240a282beb449ab069ad93c37f
---
A tests/MathLaTeXMLDatabaseTest.php
A tests/MathLaTeXMLTest.php
2 files changed, 162 insertions(+), 0 deletions(-)


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

diff --git a/tests/MathLaTeXMLDatabaseTest.php 
b/tests/MathLaTeXMLDatabaseTest.php
new file mode 100644
index 000..4f8e21b
--- /dev/null
+++ b/tests/MathLaTeXMLDatabaseTest.php
@@ -0,0 +1,110 @@
+?php
+/**
+* Test the database access and core functionality of MathRenderer.
+*
+* @group Math
+* @group Database (Used by needsDB)
+*/
+class MathLaTeXMLDatabaseTest extends MediaWikiTestCase {
+   public $renderer;
+   const SOME_TEX = a+b;
+   const SOME_HTML = asubb/sub;
+   const SOME_MATHML = iℏ∂_tΨ=H^Ψmrow\ci;
+   const SOME_LOG = Sample Log Text.;
+   const SOME_TIMESTAMP = 1272509157;
+   const SOME_SVG = ?xml /svg %%LIKE;'\ DROP TABLE math;;
+
+   /**
+* Helper function to test protected/private Methods
+* @param $name
+* @return ReflectionMethod
+*/
+   protected static function getMethod($name) {
+   $class = new ReflectionClass('MathLaTeXML');
+   $method = $class-getMethod($name);
+   $method-setAccessible(true);
+   return $method;
+   }
+
+
+   /**
+* creates a new database connection and a new math renderer
+* TODO: Check if there is a way to get database access without creating
+* the connection to the database explicitly
+* function addDBData() {
+*  $this-tablesUsed[] = 'math';
+* }
+* was not sufficient.
+*/
+   protected function setup() {
+   parent::setUp();
+   // TODO: figure out why this is necessary
+   $this-db = wfGetDB( DB_MASTER );
+   // Create a new instance of MathSource
+   $this-renderer = new MathLaTeXML( self::SOME_TEX );
+   self::setupTestDB( $this-db, mathtest );
+}
+   /**
+* Checks the tex and hash functions
+* @covers MathRenderer::getInputHash()
+*/
+   public function testInputHash() {
+   $expectedhash = $this-db-encodeBlob( pack( H32, md5( 
self::SOME_TEX ) ) );
+   $this-assertEquals( $expectedhash, 
$this-renderer-getInputHash() );
+   }
+
+   /**
+* Helper function to set the current state of the sample renderer 
instance to the test values
+*/
+   public function setValues() {
+   // set some values
+   $this-renderer-setTex( self::SOME_TEX );
+   $this-renderer-setMathml( self::SOME_MATHML );
+   }
+
+   /**
+* @covers MathLaTeXML::getMathTableName
+*/
+   public function testTableName() {
+   $fnGetMathTableName = self::getMethod( 'getMathTableName' );
+   $obj = new MathLaTeXML();
+   $tableName = $fnGetMathTableName-invokeArgs( $obj, array() );
+   $this-assertEquals( $tableName, mathlatexml, Wrong latexml 
table name );
+   }
+
+   /**
+* Checks the creation of the math table without debugging enabled.
+* @covers MathHooks::onLoadExtensionSchemaUpdates
+*/
+   public function testCreateTable() {
+   $this-setMwGlobals( 'wgMathValidModes', array( MW_MATH_LATEXML 
) );
+   $this-db-dropTable( mathlatexml, __METHOD__ );
+   $dbu = DatabaseUpdater::newForDB( $this-db );
+   $dbu-doUpdates( array( extensions ) );
+   $this-expectOutputRegex( '/(.*)Creating mathlatexml 
table(.*)/' );
+   $this-setValues();
+   $this-renderer-writeToDatabase();
+   $res = $this-db-select( mathlatexml, * );
+   $row = $res-fetchRow();
+   $this-assertEquals( 12,  sizeof( $row ) );
+   }
+
+   /**
+* Checks database access. Writes an entry and reads it back.
+* @depends testCreateTable
+* @covers MathRenderer::writeDatabaseEntry()
+* @covers MathRenderer::readDatabaseEntry()
+*/
+   public function testDBBasics() {
+   $this-setValues();
+   $this-renderer-writeToDatabase();
+
+   $renderer2 = $this-renderer = new MathLaTeXML( self::SOME_TEX 
);
+   $renderer2-readFromDatabase();
+   // comparing the class object does now work due to null values 
etc.
+   $this-assertEquals( $this-renderer-getTex(), 
$renderer2-getTex(), test if tex is the 

[MediaWiki-commits] [Gerrit] Fix: Load texvc macros from the TeX folder - change (mediawiki...mathoid)

2014-10-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix: Load texvc macros from the TeX folder
..

Fix: Load texvc macros from the TeX folder

The texvc extension file is located in the
TeX folder and not in the main extension folder

Change-Id: I7aae95c17462fd8675430f500199bef9cccd50ee
---
M MathJaxNode/mj-single.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/49/165849/1

diff --git a/MathJaxNode/mj-single.js b/MathJaxNode/mj-single.js
index 718415e..5154075 100644
--- a/MathJaxNode/mj-single.js
+++ b/MathJaxNode/mj-single.js
@@ -121,8 +121,8 @@
 //(users can override that)
 //
 jax: [input/TeX, input/MathML, input/AsciiMath, output/SVG],
-extensions: 
[tex2jax.js,mml2jax.js,asciimath2jax.js,toMathML.js,texvc.js],
-TeX: {extensions: 
window.Array(AMSmath.js,AMSsymbols.js,autoload-all.js)},
+extensions: [tex2jax.js,mml2jax.js,asciimath2jax.js,toMathML.js],
+TeX: {extensions: 
window.Array(AMSmath.js,AMSsymbols.js,autoload-all.js,texvc.js)},
 tex2jax: {inlineMath: [['$','$'],['\\(','\\)']], preview:none},
 mml2jax: {preview:none},
 asciimath2jax: {preview:none},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7aae95c17462fd8675430f500199bef9cccd50ee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Add missing texvc.js to the compressed foler - change (mediawiki...mathoid)

2014-10-09 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add missing texvc.js to the compressed foler
..

Add missing texvc.js to the compressed foler

Change-Id: I5b85f705bf44476b2167e71706e7de400a577ea5
---
A MathJax/extensions/TeX/texvc.js
1 file changed, 142 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/85/165885/1

diff --git a/MathJax/extensions/TeX/texvc.js b/MathJax/extensions/TeX/texvc.js
new file mode 100644
index 000..7cda370
--- /dev/null
+++ b/MathJax/extensions/TeX/texvc.js
@@ -0,0 +1,142 @@
+/**
+ * From 
https://en.wikipedia.org/wiki/User:Nageh/mathJax/config/TeX-AMS-texvc_HTML.js
+ */
+MathJax.Extension[TeX/texvc] = {
+  version: 2.3,
+};
+
+MathJax.Hub.Register.StartupHook(TeX Jax Ready,function () {
+  var VERSION = 1.0;
+
+  var MML = MathJax.ElementJax.mml;
+
+  var TEX = MathJax.InputJax.TeX;
+  var TEXDEF = TEX.Definitions;
+  
+  TEXDEF.Add({
+
+mathchar0mi: {
+  // Lowercase Greek letters
+  thetasym: '03B8',  // theta
+  koppa:'03DF',
+  stigma:   '03DB',
+  coppa:'03D9',  // archaic koppa
+
+  // Ord symbols
+  C:['0043',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  cnums:['0043',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  Complex:  ['0043',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  H:['210D',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  N:['004E',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  natnums:  ['004E',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  Q:['0051',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  R:['0052',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  reals:['0052',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  Reals:['0052',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  Z:['005A',{mathvariant: MML.VARIANT.DOUBLESTRUCK}],
+  sect: '00A7',  // S
+  P:'00B6',
+  AA:   ['00C5',{mathvariant: MML.VARIANT.NORMAL}],  // Å, used 
for Angstrom
+  alef: ['2135',{mathvariant: MML.VARIANT.NORMAL}],  // aleph
+  alefsym:  ['2135',{mathvariant: MML.VARIANT.NORMAL}],  // aleph
+  weierp:   ['2118',{mathvariant: MML.VARIANT.NORMAL}],  // wp
+  real: ['211C',{mathvariant: MML.VARIANT.NORMAL}],  // Re
+  part: ['2202',{mathvariant: MML.VARIANT.NORMAL}],  // partial
+  infin:['221E',{mathvariant: MML.VARIANT.NORMAL}],  // infty
+  empty:['2205',{mathvariant: MML.VARIANT.NORMAL}],  // emptyset
+  O:['2205',{mathvariant: MML.VARIANT.NORMAL}],  // emptyset 
(but should probably be Swedish O)
+  ang:  ['2220',{mathvariant: MML.VARIANT.NORMAL}],  // angle
+  exist:['2203',{mathvariant: MML.VARIANT.NORMAL}],  // exists
+  clubs:['2663',{mathvariant: MML.VARIANT.NORMAL}],  // clubsuit
+  diamonds: ['2662',{mathvariant: MML.VARIANT.NORMAL}],  // diamondsuit
+  hearts:   ['2661',{mathvariant: MML.VARIANT.NORMAL}],  // heartsuit
+  spades:   ['2660',{mathvariant: MML.VARIANT.NORMAL}],  // spadesuit
+  textvisiblespace: '2423'
+},
+
+mathchar0mo: {
+  // Binary operators
+  and:  '2227',  // land
+  or:   '2228',  // lor
+  bull: '2219',  // bullet
+  plusmn:   '00B1',  // pm
+  sdot: '22C5',  // cdot
+
+  // Binary relations
+  sup:  '2283',  // supset
+  sub:  '2282',  // subset
+  supe: '2287',  // supseteq
+  sube: '2286',  // subseteq
+  isin: '2208',  // in
+
+  hAar:   '21D4',  // Leftrightarrow [sic]
+  hArr:   '21D4',  // Leftrightarrow
+  Harr:   '21D4',  // Leftrightarrow
+  Lrarr:  '21D4',  // Leftrightarrow
+  lrArr:  '21D4',  // Leftrightarrow
+  lArr:   '21D0',  // Leftarrow
+  Larr:   '21D0',  // Leftarrow
+  rArr:   '21D2',  // Rightarrow
+  Rarr:   '21D2',  // Rightarrow
+  harr:   '2194',  // leftrightarrow
+  lrarr:  '2194',  // leftrightarrow
+  larr:   '2190',  // leftarrow
+  gets:   '2190',  // leftarrow
+  rarr:   '2192',   // rightarrow
+
+  // big ops
+  oiint:  ['222F',{texClass: MML.TEXCLASS.OP}],  // not part 
of texvc but nice to have
+  oiiint: ['2230',{texClass: MML.TEXCLASS.OP}]
+},
+
+mathchar7: {
+  // Uppercase Greek letters
+  Alpha:'0391',
+  Beta: '0392',
+  Epsilon:  '0395',
+  Zeta: '0396',
+  Eta:  '0397',
+  Iota: 

[MediaWiki-commits] [Gerrit] Add TeX annotation - change (mediawiki...mathoid)

2014-10-05 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add TeX annotation
..

Add TeX annotation

Adds the the tex annotation to the MathML element.

Bug: 71673
Change-Id: I8f7718bf9d39dad4a49038b7cc8c25f5471ac072
---
M MathJax/unpacked/jax/input/TeX/jax.js
M mathoid.config.json
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/79/164779/1

diff --git a/MathJax/unpacked/jax/input/TeX/jax.js 
b/MathJax/unpacked/jax/input/TeX/jax.js
index a6a660c..43c1c4c 100644
--- a/MathJax/unpacked/jax/input/TeX/jax.js
+++ b/MathJax/unpacked/jax/input/TeX/jax.js
@@ -2087,7 +2087,7 @@
   this.prefilterHooks.Execute(data); math = data.math;
   try {
 mml = TEX.Parse(math).mml();
-//mml = 
MML.semantics(mml,MML.annotation(math).With({encoding:application/x-tex}));
+mml = 
MML.semantics(mml,MML.annotation(math).With({encoding:application/x-tex}));
   } catch(err) {
 if (!err.texError) {throw err}
 mml = this.formatError(err,math,display,script);
diff --git a/mathoid.config.json b/mathoid.config.json
index 69a88e3..0967ef4 100644
--- a/mathoid.config.json
+++ b/mathoid.config.json
@@ -1 +1 @@
-{}
+{}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f7718bf9d39dad4a49038b7cc8c25f5471ac072
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Add TeX annotation - change (mediawiki...mathoid)

2014-10-05 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Add TeX annotation
..


Add TeX annotation

Adds the the tex annotation to the MathML element.

Bug: 71673
Change-Id: I8f7718bf9d39dad4a49038b7cc8c25f5471ac072
---
M MathJax/unpacked/jax/input/TeX/jax.js
M mathoid.config.json
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Frédéric Wang: Looks good to me, but someone else must approve
  Physikerwelt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MathJax/unpacked/jax/input/TeX/jax.js 
b/MathJax/unpacked/jax/input/TeX/jax.js
index a6a660c..43c1c4c 100644
--- a/MathJax/unpacked/jax/input/TeX/jax.js
+++ b/MathJax/unpacked/jax/input/TeX/jax.js
@@ -2087,7 +2087,7 @@
   this.prefilterHooks.Execute(data); math = data.math;
   try {
 mml = TEX.Parse(math).mml();
-//mml = 
MML.semantics(mml,MML.annotation(math).With({encoding:application/x-tex}));
+mml = 
MML.semantics(mml,MML.annotation(math).With({encoding:application/x-tex}));
   } catch(err) {
 if (!err.texError) {throw err}
 mml = this.formatError(err,math,display,script);
diff --git a/mathoid.config.json b/mathoid.config.json
index 69a88e3..0967ef4 100644
--- a/mathoid.config.json
+++ b/mathoid.config.json
@@ -1 +1 @@
-{}
+{}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f7718bf9d39dad4a49038b7cc8c25f5471ac072
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: Frédéric Wang fred.w...@free.fr
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Improve the way mathematical formulas are exposed to screen ... - change (mediawiki...Math)

2014-10-05 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Improve the way mathematical formulas are exposed to screen 
readers.
..


Improve the way mathematical formulas are exposed to screen readers.

- Mark the png and svg fallback as aria-hidden=true.
- For browsers without good enough MathML visual rendering, 
  hide the math tag in a way that still makes it accessible to 
  screen readers.

Bug: 66537
Change-Id: I7ecf07a4da669d927e11265fd497a813786c6410
---
M MathMathML.php
M modules/ext.math.css
2 files changed, 20 insertions(+), 5 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/MathMathML.php b/MathMathML.php
index 3d1a931..d4f19fe 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -393,7 +393,7 @@
if ( $class ) { $attribs['class'] = $class; }
if ( $style ) { $attribs['style'] = $style; }
// an alternative for svg might be an object with 
type=image/svg+xml
-   return Xml::element( 'img', $this-getAttributes( 'img', 
$attribs , array( 'src' = $url ) ) );
+   return Xml::element( 'img', $this-getAttributes( 'img', 
$attribs , array( 'src' = $url, 'aria-hidden' = 'true' ) ) );
}
 
 
diff --git a/modules/ext.math.css b/modules/ext.math.css
index dc3abde..72a9a35 100644
--- a/modules/ext.math.css
+++ b/modules/ext.math.css
@@ -8,8 +8,17 @@
 @namespace m url('http://www.w3.org/1998/Math/MathML');
 
 /* Default style for MathML. */
-.mwe-math-mathml-inline { display: none; }
-.mwe-math-mathml-display { display: none; margin-left: auto; margin-right: 
auto; }
+.mwe-math-mathml-inline { display: inline !important; }
+.mwe-math-mathml-display { display: block !important; margin-left: auto; 
margin-right: auto; }
+.mwe-math-mathml-inline, .mwe-math-mathml-display {
+/* We try to hide the MathML formula in a way that still makes it 
accessible to screen readers. */
+clip: rect(1px, 1px, 1px, 1px);
+overflow: hidden;
+position: absolute;
+width: 1px;
+height: 1px;
+opacity: 0;
+}
 m|math {
 /* Try OpenType MATH fonts, the WOFF fallback and the old math fonts */
 font-family: Cambria Math, Latin Modern Math, STIX Math, 
LatinModernMathWOFF, MathJax_Main, STIXGeneral, serif;
@@ -48,8 +57,14 @@
 @-moz-document url-prefix() {
 /* For Gecko browsers, hide the SVG fallback and show the MathML instead.
We override the style for SVG and MathML above */
-.mwe-math-mathml-inline { display: inline !important; }
-.mwe-math-mathml-display { display: block !important; }
+.mwe-math-mathml-inline, .mwe-math-mathml-display {
+clip: auto;
+overflow: visible;
+position: static;
+width: auto;
+height: auto;
+opacity: 1;
+}
 :root *  .mwe-math-mathml-inline + img.mwe-math-fallback-svg-inline,
 :root *  .mwe-math-mathml-display + img.mwe-math-fallback-svg-display { 
display: none !important; }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ecf07a4da669d927e11265fd497a813786c6410
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Frédéric Wang fred.w...@free.fr
Gerrit-Reviewer: Frédéric Wang fred.w...@free.fr
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add counter to DatabaseUpdater::setAppliedUpdates - change (mediawiki/core)

2014-09-23 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add counter to DatabaseUpdater::setAppliedUpdates
..

Add counter to DatabaseUpdater::setAppliedUpdates

The key was constructed depending on the current time only.
This method fails, if multiple updates are performed
within one second.

Bug: 71087
Change-Id: Id7e30298729b3abb1501a34fcc1ba4e45d2172f0
---
M includes/installer/DatabaseUpdater.php
A tests/phpunit/includes/installer/DatabaseUpdaterTest.php
2 files changed, 281 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/162286/1

diff --git a/includes/installer/DatabaseUpdater.php 
b/includes/installer/DatabaseUpdater.php
index 193d592..47a0005 100644
--- a/includes/installer/DatabaseUpdater.php
+++ b/includes/installer/DatabaseUpdater.php
@@ -31,6 +31,7 @@
  * @since 1.17
  */
 abstract class DatabaseUpdater {
+   static $updateCounter = 0;
 
/**
 * Array of updates to perform on the database
@@ -460,7 +461,8 @@
if ( !$this-canUseNewUpdatelog() ) {
return;
}
-   $key = updatelist-$version- . time();
+   $key = updatelist-$version- . time() . self::$updateCounter;
+   self::$updateCounter++;
$this-db-insert( 'updatelog',
array( 'ul_key' = $key, 'ul_value' = serialize( 
$updates ) ),
__METHOD__ );
diff --git a/tests/phpunit/includes/installer/DatabaseUpdaterTest.php 
b/tests/phpunit/includes/installer/DatabaseUpdaterTest.php
new file mode 100644
index 000..b9bbd2e
--- /dev/null
+++ b/tests/phpunit/includes/installer/DatabaseUpdaterTest.php
@@ -0,0 +1,278 @@
+?php
+
+class DatabaseUpdaterTest extends MediaWikiTestCase {
+
+   public function testSetAppliedUpdates() {
+   $db = new FakeDatabase();
+   $dbu = new FakeDatabaseUpdater( $db );
+   $dbu-setAppliedUpdates( test, array() );
+   $expected = updatelist-test- . time() . 0;
+   $actual = $db-lastInsertData['ul_key'];
+   $this-assertEquals( $expected, $actual, var_export( 
$db-lastInsertData, true ) );
+   $dbu-setAppliedUpdates( test, array() );
+   $expected = updatelist-test- . time() . 1;
+   $actual = $db-lastInsertData['ul_key'];
+   $this-assertEquals( $expected, $actual, var_export( 
$db-lastInsertData, true ) );
+   }
+}
+
+class FakeDatabase extends DatabaseBase {
+   public $lastInsertTable;
+   public $lastInsertData;
+
+   function __construct() {
+   }
+
+   function clearFlag( $arg ) {
+   }
+
+   function setFlag( $arg ) {
+   }
+
+   public function insert( $table, $a, $fname = __METHOD__, $options = 
array() ) {
+   $this-lastInsertTable = $table;
+   $this-lastInsertData = $a;
+   }
+
+   /**
+* Get the type of the DBMS, as it appears in $wgDBtype.
+*
+* @return string
+*/
+   function getType() {
+   // TODO: Implement getType() method.
+   }
+
+   /**
+* Open a connection to the database. Usually aborts on failure
+*
+* @param string $server Database server host
+* @param string $user Database user name
+* @param string $password Database user password
+* @param string $dbName Database name
+* @return bool
+* @throws DBConnectionError
+*/
+   function open( $server, $user, $password, $dbName ) {
+   // TODO: Implement open() method.
+   }
+
+   /**
+* Fetch the next row from the given result object, in object form.
+* Fields can be retrieved with $row-fieldname, with fields acting like
+* member variables.
+* If no more rows are available, false is returned.
+*
+* @param ResultWrapper|stdClass $res Object as returned from 
DatabaseBase::query(), etc.
+* @return stdClass|bool
+* @throws DBUnexpectedError Thrown if the database returns an error
+*/
+   function fetchObject( $res ) {
+   // TODO: Implement fetchObject() method.
+   }
+
+   /**
+* Fetch the next row from the given result object, in associative array
+* form. Fields are retrieved with $row['fieldname'].
+* If no more rows are available, false is returned.
+*
+* @param ResultWrapper $res Result object as returned from 
DatabaseBase::query(), etc.
+* @return array|bool
+* @throws DBUnexpectedError Thrown if the database returns an error
+*/
+   function fetchRow( $res ) {
+   // TODO: Implement fetchRow() method.
+   }
+
+   /**
+* Get the number of rows in a result object
+*

[MediaWiki-commits] [Gerrit] WIP: Workaround for JUnit bug - change (mediawiki...Math)

2014-09-19 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: WIP: Workaround for JUnit bug
..

WIP: Workaround for JUnit bug

(do not submit)

Change-Id: I195e88a16759e9d37c48f5a96da10500a36c3320
---
M tests/MathLaTeXMLDatabaseTest.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/08/161608/2

diff --git a/tests/MathLaTeXMLDatabaseTest.php 
b/tests/MathLaTeXMLDatabaseTest.php
index 4f8e21b..870a0f6 100644
--- a/tests/MathLaTeXMLDatabaseTest.php
+++ b/tests/MathLaTeXMLDatabaseTest.php
@@ -79,6 +79,7 @@
public function testCreateTable() {
$this-setMwGlobals( 'wgMathValidModes', array( MW_MATH_LATEXML 
) );
$this-db-dropTable( mathlatexml, __METHOD__ );
+   sleep(1);
$dbu = DatabaseUpdater::newForDB( $this-db );
$dbu-doUpdates( array( extensions ) );
$this-expectOutputRegex( '/(.*)Creating mathlatexml 
table(.*)/' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I195e88a16759e9d37c48f5a96da10500a36c3320
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] WIP: Workaround for JUnit bug - change (mediawiki...Math)

2014-09-19 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: WIP: Workaround for JUnit bug
..

WIP: Workaround for JUnit bug

JENKINS TEST JOB. DO NOT SUBMIT

Change-Id: Ifb09a7feed612ff4cbac95eda5db1b3c29ca1276
---
M tests/MathLaTeXMLDatabaseTest.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/tests/MathLaTeXMLDatabaseTest.php 
b/tests/MathLaTeXMLDatabaseTest.php
index 4f8e21b..870a0f6 100644
--- a/tests/MathLaTeXMLDatabaseTest.php
+++ b/tests/MathLaTeXMLDatabaseTest.php
@@ -79,6 +79,7 @@
public function testCreateTable() {
$this-setMwGlobals( 'wgMathValidModes', array( MW_MATH_LATEXML 
) );
$this-db-dropTable( mathlatexml, __METHOD__ );
+   sleep(1);
$dbu = DatabaseUpdater::newForDB( $this-db );
$dbu-doUpdates( array( extensions ) );
$this-expectOutputRegex( '/(.*)Creating mathlatexml 
table(.*)/' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb09a7feed612ff4cbac95eda5db1b3c29ca1276
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Add user feedback - change (mediawiki...MathSearch)

2014-09-16 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add user feedback
..

Add user feedback

Change-Id: I74fc3e07fc0e3efc4552fbb84e304721a15f6047
---
M SpecialUploadResult.php
A db/snippets/math_wmc_rank_success.sql
M i18n/en.json
3 files changed, 76 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/13/160613/1

diff --git a/SpecialUploadResult.php b/SpecialUploadResult.php
index 8d0d041..35b2af0 100644
--- a/SpecialUploadResult.php
+++ b/SpecialUploadResult.php
@@ -17,7 +17,7 @@
}
 
private static function formatErrors( $errors ) {
-   return wfMessage( 'math-wmc-Warnings' )-text() . ' ' . 
implode( br /, $errors );
+   return wfMessage( 'math-wmc-Warnings' )-text() . br / . 
implode( br /, $errors );
}
 
function execute( $query ) {
@@ -28,12 +28,18 @@
 
$this-getOutput()-addWikiText( wfMessage( 
'math-wmc-Introduction' )-text() );
$formDescriptor = $this-printRunSelector();
-   $formDescriptor['File'] = array( 'label-message' = 
'math-wmc-FileLabel',
+   $formDescriptor['File'] = array(
+   'label-message' = 'math-wmc-FileLabel',
'help-message' = 'math-wmc-FileHelp',
'class' = 'HTMLTextField',
'type' = 'file',
'required' = true,
'validation-callback' = array( $this, 'runFileCheck' ),
+   );
+   $formDescriptor['displayFormulae'] = array(
+   'label-message' = 'math-wmc-display-formulae-label',
+   'help-message' = 'math-wmc-display-formulae-help',
+   'type' = 'check',
);
 
$htmlForm = new HTMLForm( $formDescriptor, $this-getContext() 
);
@@ -111,7 +117,7 @@
function runFileCheck( ) {
$out = $this-getOutput();
 
-   $out-addWikiMsg( 'dt_import_importing' );
+
$uploadResult = ImportStreamSource::newFromUpload( 'wpFile' );
 
if ( ! $uploadResult-isOK() ) {
@@ -121,7 +127,7 @@
$source = $uploadResult-value;
 
$this-results = array();
-
+   $out-addWikiMsg( 'math-wmc-importing' );
$error_msg = $this-importFromFile( $source-mHandle );
 
if ( ! is_null( $error_msg ) ) {
@@ -157,14 +163,20 @@
$this-printResultRow( $result );
}
$this-getOutput()-addHTML('/table');
+   $this-displayFeedback();
return true;
}
 
private function printResultRow( $row ){
$md5 = MathObject::hash2md5( $row['math_inputhash'] );
-   $renderer = MathRenderer::newFromMd5($md5);
-   if ( $renderer-render() ){
-   $renderedMath = $renderer-getHtmlOutput();
+   if( $this-getRequest()-getBool( wpdisplayFormulae ) ){
+   $this-getOutput()-addModuleStyles( array( 
'ext.math.styles' ) );
+   $renderer = MathLaTeXML::newFromMd5($md5);
+   if ( $renderer-render() ){
+   $renderedMath = $renderer-getHtmlOutput();
+   } else {
+   $renderedMath = $md5;
+   }
} else {
$renderedMath = $md5;
}
@@ -278,4 +290,44 @@
'rank' = $rank,
'math_inputhash' = $fHash );
}
+
+   private function displayFeedback(){
+   $runId=$this-runID;
+   $dbr=wfGetDB(DB_SLAVE);
+   $res = $dbr-select(
+   
array('l'='math_wmc_rank_levels','r'='math_wmc_ref','math_wmc_results'),
+   array( 'count(DISTINCT `r`.`qId`)  AS `c`',
+   '`l`.`level`AS `level`'),
+   array( (`math_wmc_results`.`rank` = `l`.`level`) ,
+   'runId'=$runId,
+   '`math_wmc_results`.`oldId` = `r`.`oldId`',
+   '`math_wmc_results`.`qId` = `r`.`qId`'
+   ),
+   __METHOD__,
+   array( 'GROUP BY' = '`l`.`level`',
+   'ORDER BY' = 'count(DISTINCT `r`.`qId`) DESC')
+   );
+   if ( ! $res || $res-numRows() == 0 ){
+   $this-getOutput()-addWikiText( Score is 0. Check 
your submission);
+   return ;
+   } else {
+   $this-getOutput()-addWikiText( '''Scored in  . 
$res-numRows() .  

[MediaWiki-commits] [Gerrit] Fix: Counter in math indexing script - change (mediawiki...MathSearch)

2014-09-16 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix: Counter in math indexing script
..

Fix: Counter in math indexing script

The couter that assigns subsequent equations numbers was
not increased. Therefore all equations got the number 0.

Change-Id: If6062570dde3d1145d716f7117dd9345682e34c9
---
M maintenance/UpdateMath.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/46/160646/1

diff --git a/maintenance/UpdateMath.php b/maintenance/UpdateMath.php
index 577ab6f..b646748 100644
--- a/maintenance/UpdateMath.php
+++ b/maintenance/UpdateMath.php
@@ -164,6 +164,7 @@
if ( $this-getOption( hooks, true ) ) {
wfRunHooks( 'MathFormulaRendered', 
array( $renderer, $notused, $pid, $anchorID ) );
$this-time( hooks );
+   $anchorID++;
}
$renderer-writeCache($this-dbw);
$this-time(write Cache);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6062570dde3d1145d716f7117dd9345682e34c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Add user feedback - change (mediawiki...MathSearch)

2014-09-16 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Add user feedback
..


Add user feedback

Change-Id: I74fc3e07fc0e3efc4552fbb84e304721a15f6047
---
M SpecialUploadResult.php
A db/snippets/math_wmc_rank_success.sql
M i18n/en.json
M i18n/qqq.json
4 files changed, 81 insertions(+), 9 deletions(-)

Approvals:
  Siebrand: Looks good to me, but someone else must approve
  Physikerwelt: Looks good to me, approved



diff --git a/SpecialUploadResult.php b/SpecialUploadResult.php
index 8d0d041..35b2af0 100644
--- a/SpecialUploadResult.php
+++ b/SpecialUploadResult.php
@@ -17,7 +17,7 @@
}
 
private static function formatErrors( $errors ) {
-   return wfMessage( 'math-wmc-Warnings' )-text() . ' ' . 
implode( br /, $errors );
+   return wfMessage( 'math-wmc-Warnings' )-text() . br / . 
implode( br /, $errors );
}
 
function execute( $query ) {
@@ -28,12 +28,18 @@
 
$this-getOutput()-addWikiText( wfMessage( 
'math-wmc-Introduction' )-text() );
$formDescriptor = $this-printRunSelector();
-   $formDescriptor['File'] = array( 'label-message' = 
'math-wmc-FileLabel',
+   $formDescriptor['File'] = array(
+   'label-message' = 'math-wmc-FileLabel',
'help-message' = 'math-wmc-FileHelp',
'class' = 'HTMLTextField',
'type' = 'file',
'required' = true,
'validation-callback' = array( $this, 'runFileCheck' ),
+   );
+   $formDescriptor['displayFormulae'] = array(
+   'label-message' = 'math-wmc-display-formulae-label',
+   'help-message' = 'math-wmc-display-formulae-help',
+   'type' = 'check',
);
 
$htmlForm = new HTMLForm( $formDescriptor, $this-getContext() 
);
@@ -111,7 +117,7 @@
function runFileCheck( ) {
$out = $this-getOutput();
 
-   $out-addWikiMsg( 'dt_import_importing' );
+
$uploadResult = ImportStreamSource::newFromUpload( 'wpFile' );
 
if ( ! $uploadResult-isOK() ) {
@@ -121,7 +127,7 @@
$source = $uploadResult-value;
 
$this-results = array();
-
+   $out-addWikiMsg( 'math-wmc-importing' );
$error_msg = $this-importFromFile( $source-mHandle );
 
if ( ! is_null( $error_msg ) ) {
@@ -157,14 +163,20 @@
$this-printResultRow( $result );
}
$this-getOutput()-addHTML('/table');
+   $this-displayFeedback();
return true;
}
 
private function printResultRow( $row ){
$md5 = MathObject::hash2md5( $row['math_inputhash'] );
-   $renderer = MathRenderer::newFromMd5($md5);
-   if ( $renderer-render() ){
-   $renderedMath = $renderer-getHtmlOutput();
+   if( $this-getRequest()-getBool( wpdisplayFormulae ) ){
+   $this-getOutput()-addModuleStyles( array( 
'ext.math.styles' ) );
+   $renderer = MathLaTeXML::newFromMd5($md5);
+   if ( $renderer-render() ){
+   $renderedMath = $renderer-getHtmlOutput();
+   } else {
+   $renderedMath = $md5;
+   }
} else {
$renderedMath = $md5;
}
@@ -278,4 +290,44 @@
'rank' = $rank,
'math_inputhash' = $fHash );
}
+
+   private function displayFeedback(){
+   $runId=$this-runID;
+   $dbr=wfGetDB(DB_SLAVE);
+   $res = $dbr-select(
+   
array('l'='math_wmc_rank_levels','r'='math_wmc_ref','math_wmc_results'),
+   array( 'count(DISTINCT `r`.`qId`)  AS `c`',
+   '`l`.`level`AS `level`'),
+   array( (`math_wmc_results`.`rank` = `l`.`level`) ,
+   'runId'=$runId,
+   '`math_wmc_results`.`oldId` = `r`.`oldId`',
+   '`math_wmc_results`.`qId` = `r`.`qId`'
+   ),
+   __METHOD__,
+   array( 'GROUP BY' = '`l`.`level`',
+   'ORDER BY' = 'count(DISTINCT `r`.`qId`) DESC')
+   );
+   if ( ! $res || $res-numRows() == 0 ){
+   $this-getOutput()-addWikiText( Score is 0. Check 
your submission);
+   return ;
+   } else {
+   $this-getOutput()-addWikiText( '''Scored in  . 
$res-numRows() .  

[MediaWiki-commits] [Gerrit] Make Mathoid role configurable via hiera - change (mediawiki/vagrant)

2014-09-16 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Make Mathoid role configurable via hiera
..

Make Mathoid role configurable via hiera

Change-Id: I877efa2877843d60a43392da1a68e54991703000
---
M puppet/hieradata/common.yaml
M puppet/modules/mathoid/manifests/init.pp
M puppet/modules/role/manifests/mathoid.pp
3 files changed, 19 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/94/160694/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 84251b9..02953ba 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -58,3 +58,7 @@
 scholarships::deploy_dir: /vagrant/scholarships
 scholarships::cache_dir: /var/cache/scholarships
 scholarships::log_file: /vagrant/logs/scholarships.log
+
+mathoid::base_path: /vagrant/mathoid
+mathoid::node_path: /vagrant/mathoid/node_modules
+mathoid::conf_path: /vagrant/mathoid/mathoid.config.json
diff --git a/puppet/modules/mathoid/manifests/init.pp 
b/puppet/modules/mathoid/manifests/init.pp
index 908ed17..33a18f2 100644
--- a/puppet/modules/mathoid/manifests/init.pp
+++ b/puppet/modules/mathoid/manifests/init.pp
@@ -34,8 +34,8 @@
 
 file { $conf_path:
 ensure  = present,
-owner   = mathoid,
-group   = mathoid,
+owner   = www-data,
+group   = www-data,
 mode= '0644',
 content = template('mathoid/config.erb'),
 }
diff --git a/puppet/modules/role/manifests/mathoid.pp 
b/puppet/modules/role/manifests/mathoid.pp
index 27d4a17..9910a35 100644
--- a/puppet/modules/role/manifests/mathoid.pp
+++ b/puppet/modules/role/manifests/mathoid.pp
@@ -1,10 +1,18 @@
 class role::mathoid {
 
+git::clone{'mediawiki/services/mathoid':
+directory = hiera('mathoid::base_path', '/vagrant/mathoid'),
+}
+
+file { '/vagrant/logs/mathoid':
+ensure = directory,
+mode = '0755',
+owner = 'www-data',
+group = 'vagrant',
+}
+
 class { '::mathoid':
-base_path = '/srv/mathoid',
-node_path = '/srv/mathoid/node_modules',
-conf_path = '/srv/mathoid/mathoid.config.json',
-log_dir   = '/vagrant/log/mathoid',
+log_dir   = '/vagrant/logs/mathoid',
 require   = Git::Clone['mediawiki/services/mathoid'],
 }
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I877efa2877843d60a43392da1a68e54991703000
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Fix: Missing parent::tearDown() call - change (mediawiki...Math)

2014-09-15 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix: Missing parent::tearDown() call
..

Fix: Missing parent::tearDown() call

Change-Id: I9418205479053c4129b6a9b888e38150799edcc5
---
M tests/MathInputCheckTexvcTest.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/tests/MathInputCheckTexvcTest.php 
b/tests/MathInputCheckTexvcTest.php
index 2e77a2b..042f985 100644
--- a/tests/MathInputCheckTexvcTest.php
+++ b/tests/MathInputCheckTexvcTest.php
@@ -87,6 +87,7 @@
 * This method is called after a test is executed.
 */
protected function tearDown() {
+   parent::tearDown();
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9418205479053c4129b6a9b888e38150799edcc5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Fine grained options for wgMathDisableTeXFilter - change (mediawiki...Math)

2014-09-06 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fine grained options for wgMathDisableTeXFilter
..

Fine grained options for wgMathDisableTeXFilter

Add new option to filter only new input.
Now the complete list of possible settings is:
MW_MATH_CHECK_ALWAYS  backwards compatible to false
MW_MATH_CHECK_NEVER   backwards compatible to true
MW_MATH_CHECK_NEW new option

Change-Id: I455b41c8b8d918f4c34f6c115194d227a8394e0a
---
M Math.hooks.php
M Math.php
M MathRenderer.php
3 files changed, 33 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/45/158845/3

diff --git a/Math.hooks.php b/Math.hooks.php
index 65819a1..6a9701a 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -111,14 +111,13 @@
 
$renderer = MathRenderer::getRenderer( $content, $attributes, 
$mode );
 
-   if ( !$wgMathDisableTexFilter ) {
-   $checkResult = $renderer-checkTex();
+   $checkResult = $renderer-checkTex();
 
-   if ( $checkResult !== true ) {
-   // Returns the error message
-   return $renderer-getLastError();
-   }
+   if ( $checkResult !== true ) {
+   // Returns the error message
+   return $renderer-getLastError();
}
+
if ( $renderer-render() ) {
wfDebugLog( Math , Rendering successful. Writing 
output );
$renderedMath = $renderer-getHtmlOutput();
diff --git a/Math.php b/Math.php
index c85bdb9..52d41d7 100644
--- a/Math.php
+++ b/Math.php
@@ -188,12 +188,22 @@
  * The link to the texvccheck executable
  */
 $wgMathTexvcCheckExecutable = __DIR__ . '/texvccheck/texvccheck';
-/**
- * Option to disable the tex filter. If set to true any LaTeX espression is 
parsed
- * this can be a potential security risk. If set to false only a subset of the 
TeX
- * commands is allowed. See the wikipedia page Help:Math for details.
+
+/**@{
+ * Math check constants
  */
-$wgMathDisableTexFilter = false;
+define( 'MW_MATH_CHECK_ALWAYS', 0 ); /// backwards compatible to false
+define( 'MW_MATH_CHECK_NEVER' , 1 );   /// backwards compatible to true
+define( 'MW_MATH_CHECK_NEW'   , 2 );
+/**@}*/
+/**
+ * Option to disable the tex filter. If set to MW_MATH_CHECK_NONE any LaTeX 
expression is parsed.
+ * This can be a potential security risk. If set to MW_MATH_CHECK_ALWAYS only 
a subset of the TeX
+ * commands is allowed. See the Wikipedia page Help:Math for details about the 
allowed commands.
+ * MW_MATH_CHECK_NEW checks only new equations
+ *
+ */
+$wgMathDisableTexFilter = MW_MATH_CHECK_ALWAYS;
 
 /** Stores debug information in the database and provides more detailed debug 
output */
 $wgMathDebug = false;
diff --git a/MathRenderer.php b/MathRenderer.php
index 8e46583..21f7fca 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -262,7 +262,7 @@
wfProfileIn( __METHOD__ );
/** @var DatabaseBase */
$dbr = wfGetDB( DB_SLAVE );
-   /** @var ResultWrapper asdf */
+   /** @var ResultWrapper */
$rpage = $dbr-selectRow( $this-getMathTableName(),
$this-dbInArray(),
array( 'math_inputhash' = $this-getInputHash() ),
@@ -600,8 +600,18 @@
return $this-texSecure;
}
 
+   /**
+* @global $wgMathDisableTexFilter
+* @return bool
+*/
public function checkTex() {
-   if ( !$this-texSecure ) {
+   global $wgMathDisableTexFilter;
+   if ( !$this-texSecure || (int) $wgMathDisableTexFilter == 
MW_MATH_CHECK_NEVER ) {
+   if( (int) $wgMathDisableTexFilter == MW_MATH_CHECK_NEW 
){
+   if( $this-readFromDatabase() ){
+   return true;
+   }
+   }
$checker = new MathInputCheckTexvc( $this-userInputTex 
);
if ( $checker-isValid() ) {
$this-setTex( $checker-getValidTex() );
@@ -611,9 +621,8 @@
$this-lastError = $checker-getError();
return false;
}
-   } else {
-   return true;
}
+   return true;
}
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I455b41c8b8d918f4c34f6c115194d227a8394e0a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: 

[MediaWiki-commits] [Gerrit] Avoid unnecessary database reads - change (mediawiki...Math)

2014-09-06 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Avoid unnecessary database reads
..

Avoid unnecessary database reads

 Use the cached function isInDatabase rather than readFromDatabase to
 avoid unnecessary read operations on the database.

 Currently, readFromDatabase is usually called only once during instance
 livetime. But after I455b41c8b8d918f4c34f6c115194d227a8394e0a has bben
 merged chances are that it's called twice.

Change-Id: I6434195ad1d323a578a8fdca1b4555e11ab30a15
---
M MathLaTeXML.php
M MathMathML.php
M MathTexvc.php
3 files changed, 5 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/46/158846/2

diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index b30a820..4915058 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -182,8 +182,7 @@
$renderer = new MathMathML( $this-getTex() );
$renderer-setMathml( $this-getMathml() );
$renderer-setMode( MW_MATH_LATEXML );
-   $renderer-setPurge( true );
-   $res = $renderer-render();
+   $res = $renderer-render( true );
if ( $res == true ) {
$this-svg = $renderer-getSvg();
} else {
diff --git a/MathMathML.php b/MathMathML.php
index 82eea5e..3d1a931 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -104,7 +104,7 @@
wfDebugLog( Math, Rerendering was requested. );
return true;
} else {
-   $dbres = $this-readFromDatabase();
+   $dbres = $this-isInDatabase();
if ( $dbres ) {
if ( $this-isValidMathML( $this-getMathml() ) 
) {
wfDebugLog( Math, Valid MathML entry 
found in database. );
diff --git a/MathTexvc.php b/MathTexvc.php
index f5e4f61..057007c 100644
--- a/MathTexvc.php
+++ b/MathTexvc.php
@@ -387,7 +387,7 @@
global $wgMathCheckFiles;
 
wfProfileIn( __METHOD__ );
-   if ( $this-readFromDatabase() ) {
+   if ( $this-isInDatabase() ) {
if ( !$wgMathCheckFiles ) {
// Short-circuit the file existence  migration 
checks
wfProfileOut( __METHOD__ );
@@ -413,8 +413,8 @@
return $backend-getFileContents( array( 'src' = 
$this-getHashPath() . / . $this-getHash() . '.png' ) );
}
 
-   public function readFromDatabase() {
-   $return = parent::readFromDatabase();
+   public function isInDatabase() {
+   $return = parent::isInDatabase();
if ( $this-hash  $return ) {
return true;
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6434195ad1d323a578a8fdca1b4555e11ab30a15
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: CSteipp cste...@wikimedia.org
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Fix: problems in i18n files - change (mediawiki...MathSearch)

2014-09-04 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix: problems in i18n files
..

Fix: problems in i18n files

Change-Id: I1f50792a322e52d2c9ae10cc64ff5fa5b3d55f50
---
M SpecialUploadResult.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 52 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/63/158363/1

diff --git a/SpecialUploadResult.php b/SpecialUploadResult.php
index a3bbed3..8d0d041 100644
--- a/SpecialUploadResult.php
+++ b/SpecialUploadResult.php
@@ -17,7 +17,7 @@
}
 
private static function formatErrors( $errors ) {
-   return wfMessage( 'wmcWarnings' )-text() . ' ' . implode( br 
/, $errors );
+   return wfMessage( 'math-wmc-Warnings' )-text() . ' ' . 
implode( br /, $errors );
}
 
function execute( $query ) {
@@ -26,10 +26,10 @@
throw new PermissionsError( 'mathwmcsubmit' );
}
 
-   $this-getOutput()-addWikiText( wfMessage( 'wmcIntroduction' 
)-text() );
+   $this-getOutput()-addWikiText( wfMessage( 
'math-wmc-Introduction' )-text() );
$formDescriptor = $this-printRunSelector();
-   $formDescriptor['File'] = array( 'label-message' = 
'wmcFileLabel',
-   'help-message' = 'wmcFileHelp',
+   $formDescriptor['File'] = array( 'label-message' = 
'math-wmc-FileLabel',
+   'help-message' = 'math-wmc-FileHelp',
'class' = 'HTMLTextField',
'type' = 'file',
'required' = true,
@@ -54,10 +54,10 @@
}
//Probably we want to add more field in the future
$formFields['run'] = array( 'type' = 'selectorother',
-   'label-message' = 'wmcSelectRun',
+   'label-message' = 'math-wmc-SelectRun',
'options' = $options,
'required' = true,
-   'help-message' = 'wmcSelectRunHelp',
+   'help-message' = 'math-wmc-SelectRunHelp',
'filter-callback' = array( $this, 'runSelectorFilter' 
),
'validation-callback' = array( $this, 
'runValidatorFilter' ),
 //'section' = 'wmcSectionRun'
@@ -81,13 +81,13 @@
array( 'isDraft' = true, 'userID' = 
$uID, 'runName' = $run ) );
if ( $success ) {
$this-runID = $dbw-insertId();
-   $this-getOutput()-addWikiMsg( 
'wmcRunAdded', $run, $this-runID );
+   $this-getOutput()-addWikiMsg( 
'math-wmc-RunAdded', $run, $this-runID );
} else {
$this-runID = false;
-   $this-getOutput()-addWikiMsg( 
'wmcRunAddError', $run );
+   $this-getOutput()-addWikiMsg( 
'math-wmc-RunAddError', $run );
}
} else {
-   $this-getOutput()-addWikiMsg( 
'wmcRunAddExist', $run, $exists );
+   $this-getOutput()-addWikiMsg( 
'math-wmc-RunAddExist', $run, $exists );
$this-runID = false;
}
} else {
@@ -102,7 +102,7 @@
$res = $dbr-selectField( 'math_wmc_runs', 'runName',
array( 'isDraft' = true, 'userID' = $uID, 'runId' = 
$this-runID ) );
if ( ! $res ) {
-   return wfMessage( 'wmcSelectRunHelp' )-text();
+   return wfMessage( 'math-wmc-SelectRunHelp' )-text();
} else {
return true;
}
@@ -140,7 +140,7 @@
}
 
function processInput(  ) {
-   $this-getOutput()-addWikiMsg( wmcSubmissionSuccess );
+   $this-getOutput()-addWikiMsg( math-wmc-SubmissionSuccess );
self::deleteRun( $this-runID );
$dbw = wfGetDB( DB_MASTER );
//TODO: Find adequate API call
@@ -224,7 +224,7 @@
// check header line
$uploadedHeaders = $table[0];
if ( $uploadedHeaders != $this-columnHeaders ) {
-   $error_msg = wfMessage( 'importcsv_badheader' )-text();
+   $error_msg = wfMessage( 'math-wmc-bad-header' )-text();
return $error_msg;
}
$rank = 0;
@@ -239,17 +239,17 @@
$fId = trim( $line[1] );
$qValid = $this-isValidQId( $qId );
  

[MediaWiki-commits] [Gerrit] Revert Set wgMathDisableTexFilter to fix performance regres... - change (operations/mediawiki-config)

2014-09-04 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Revert Set wgMathDisableTexFilter to fix performance 
regression
..

Revert Set wgMathDisableTexFilter to fix performance regression

This reverts commit 63992ec03c15a9bff7f7212254fb19b8acb5e224.

See
Bug: 49169

Change-Id: I42f7afc29a7c794f4d70d7f15ecabcc56b2cc202
---
M wmf-config/CommonSettings.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/59/158559/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index e60b82d..fd38f8f 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2027,7 +2027,6 @@
$wgMathDirectory   = '/mnt/upload7/math'; // just for sanity
$wgMathPath= $wmgMathPath;
$wgUseMathJax  = true;
-   $wgMathDisableTexFilter = true; // severe performance regression; 
--Aaron
 }
 
 if ( $wmgUseBabel ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42f7afc29a7c794f4d70d7f15ecabcc56b2cc202
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] test testing (do not submit) - change (mediawiki...MathSearch)

2014-09-03 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: test testing (do not submit)
..

test testing (do not submit)

Change-Id: I6d211c0930d979a09908303d4c87112f36180f8b
---
M tests/BaseXSimpleTest.php
M tests/MathSearchHooksTest.php
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/83/158083/1

diff --git a/tests/BaseXSimpleTest.php b/tests/BaseXSimpleTest.php
index 5ae4d15..76160c9 100644
--- a/tests/BaseXSimpleTest.php
+++ b/tests/BaseXSimpleTest.php
@@ -10,7 +10,7 @@
 
protected function setUp(){
global $wgMathSearchBaseXSupport;
-   if ( ! $wgMathSearchBaseXSupport ) {
+   if ( ! $wgMathSearchBaseXSupport || true ) {
$this-markTestSkipped( 'This server does not support 
baseX.' );
}
$this-phpErrorLevel = intval( ini_get( 'error_reporting' ) );
diff --git a/tests/MathSearchHooksTest.php b/tests/MathSearchHooksTest.php
index 427..451241b 100644
--- a/tests/MathSearchHooksTest.php
+++ b/tests/MathSearchHooksTest.php
@@ -79,9 +79,12 @@
 
/**
 * Tests if ID's for math elements are replaced correctly
+* //TODO: Update test
+* @group ignore
 */
public function testNTCIRHook() {
//use Page-ID = 0 to avoid that the test tries to save 
something to the DB
+   return; //Skip test for the moment
$sample = $this-mathMLSample;
$this-assertTrue( 
MathSearchHooks::onMathFormulaRenderedNoLink( null, $sample, 0, 6 ), 'Hook did 
not return true' );
$this-assertContains( math.0.6.14.1.cmml, $sample, expected 
replaced id not found );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d211c0930d979a09908303d4c87112f36180f8b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Fix broken test - change (mediawiki...MathSearch)

2014-09-03 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Fix broken test
..


Fix broken test

The testNTCIRHook caused a null pointer error.
As a result jenkins can not execute other tests.

Change-Id: I6d211c0930d979a09908303d4c87112f36180f8b
---
M MathSearch.hooks.php
M tests/MathSearchHooksTest.php
2 files changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Physikerwelt: Looks good to me, approved



diff --git a/MathSearch.hooks.php b/MathSearch.hooks.php
index d5053eb..1a93653 100644
--- a/MathSearch.hooks.php
+++ b/MathSearch.hooks.php
@@ -55,7 +55,12 @@
}
 
private static function curId2OldId( $curId ){
-   return Title::newFromID( $curId )-getLatestRevID();
+   $title = Title::newFromID( $curId );
+   if ( $title ){
+   return Title::newFromID( $curId )-getLatestRevID();
+   } else {
+   return 0;
+   }
}
/**
 * Updates the formula index in the database
diff --git a/tests/MathSearchHooksTest.php b/tests/MathSearchHooksTest.php
index 427..e9b83f0 100644
--- a/tests/MathSearchHooksTest.php
+++ b/tests/MathSearchHooksTest.php
@@ -79,6 +79,8 @@
 
/**
 * Tests if ID's for math elements are replaced correctly
+* //TODO: Update test
+* @group ignore
 */
public function testNTCIRHook() {
//use Page-ID = 0 to avoid that the test tries to save 
something to the DB

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6d211c0930d979a09908303d4c87112f36180f8b
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: Chad ch...@wikimedia.org
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Check if file cache exist before accessing it. - change (mediawiki/core)

2014-09-01 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Check if file cache exist before accessing it.
..

Check if file cache exist before accessing it.

Bug: 70270
Change-Id: Id2535d9da45f77744786973583c54075a9c4f9a9
---
M includes/filerepo/RepoGroup.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/157760/1

diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php
index fab4216..3c02d3d 100644
--- a/includes/filerepo/RepoGroup.php
+++ b/includes/filerepo/RepoGroup.php
@@ -134,6 +134,7 @@
if ( empty( $options['ignoreRedirect'] )
 empty( $options['private'] )
 empty( $options['bypassCache'] )
+$this-cache
) {
$time = isset( $options['time'] ) ? $options['time'] : 
'';
$dbkey = $title-getDBkey();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2535d9da45f77744786973583c54075a9c4f9a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Fix: Profiler instance - change (mediawiki...DumpHTML)

2014-08-31 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Fix: Profiler instance
..

Fix: Profiler instance

Profiler is an abstract class. Chose factory method to get an instance.

Change-Id: I38c70d6e29c8c6d5b26c2675d8813d9b463cb027
---
M dumpHTML.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DumpHTML 
refs/changes/03/157503/1

diff --git a/dumpHTML.php b/dumpHTML.php
index 762ebf2..0ac3238 100644
--- a/dumpHTML.php
+++ b/dumpHTML.php
@@ -46,7 +46,7 @@
function wfSetupDump() {
global $wgProfileToDatabase, $wgProfileSampleRate;
// Override disabled profiling in maintenance scripts
-   Profiler::setInstance( new Profiler() );
+   Profiler::setInstance( Profiler::instance() );
$wgProfileToDatabase = false;
$wgProfileSampleRate = 1;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38c70d6e29c8c6d5b26c2675d8813d9b463cb027
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DumpHTML
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] WIP: Access to protected properties 1 - change (mediawiki...DumpHTML)

2014-08-31 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: WIP: Access to protected properties 1
..

WIP: Access to protected properties 1

Change-Id: I65249db667bf0e8964422b61132ec99d6b2c6d25
---
M dumpHTML.inc
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DumpHTML 
refs/changes/04/157504/1

diff --git a/dumpHTML.inc b/dumpHTML.inc
index 6d8b110..e2ea516 100644
--- a/dumpHTML.inc
+++ b/dumpHTML.inc
@@ -1160,8 +1160,9 @@
$this-directory = $directory;
$this-url = $url;
$this-name = $backend-getName();
-   $this-backend-thumbScriptUrl = false;
-   $this-backend-transformVia404 = false;
+   //TODO fix those line
+   //$this-backend-thumbScriptUrl = false;
+   //$this-backend-transformVia404 = false;
$this-backendUrl = $backend-getZoneUrl( 'public' );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65249db667bf0e8964422b61132ec99d6b2c6d25
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DumpHTML
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Stable IDs for NTCIR wmc1.02 - change (mediawiki...MathSearch)

2014-08-29 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Stable IDs for NTCIR wmc1.02
..


Stable IDs for NTCIR wmc1.02

Use stable IDs for the second round of NTCIR-11
Math 2 Wikipedia Subtask round 2.

Change-Id: Ic1cfa6c35515f7acfc4c03c88710e531de77cd7f
---
M MathSearch.hooks.php
M SpecialMathSearch.php
2 files changed, 8 insertions(+), 5 deletions(-)

Approvals:
  Physikerwelt: Verified; Looks good to me, approved



diff --git a/MathSearch.hooks.php b/MathSearch.hooks.php
index 65a492f..d5053eb 100644
--- a/MathSearch.hooks.php
+++ b/MathSearch.hooks.php
@@ -54,6 +54,9 @@
}
}
 
+   private static function curId2OldId( $curId ){
+   return Title::newFromID( $curId )-getLatestRevID();
+   }
/**
 * Updates the formula index in the database
 *
@@ -64,7 +67,7 @@
 */
private static function updateIndex($pid, $eid, $inputHash, $tex){
try {
-   $oldID = Title::newFromID( $pid )-getLatestRevID();
+   $oldID = self::curId2OldId( $pid );
$dbr = wfGetDB( DB_SLAVE );
$exists = $dbr-selectRow( 'mathindex',
array( 'mathindex_page_id', 'mathindex_anchor', 
'mathindex_inputhash' ),
@@ -192,9 +195,10 @@
self::updateIndex( $pid, $eid, 
$Renderer-getInputHash(), $Renderer-getTex() );
}
if ( preg_match( '#math(.*)?\sid=(?Pid[\w\.]+)#', $Result, 
$matches ) ) {
-   $oldId = $matches['id'];
-   $newID = math.$pid.$eid;
-   $Result = str_replace( $oldId, $newID, $Result );
+   $rendererId = $matches['id'];
+   $oldId = self::curId2OldId( $pid );
+   $newID = math.${oldId}.${eid};
+   $Result = str_replace( $rendererId, $newID, $Result );
}
return true;
}
diff --git a/SpecialMathSearch.php b/SpecialMathSearch.php
index a28eaa6..0ab2514 100644
--- a/SpecialMathSearch.php
+++ b/SpecialMathSearch.php
@@ -164,7 +164,6 @@
}
 
if ( $this-mathBackend  $this-textpattern ==  ) {
-   wfDebugLog( MathSearch, Starting output 
(notext mode) );
$results = $this-mathBackend-getResultSet();
if ( $results ) {
foreach ( $results as $pageID = $page 
) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1cfa6c35515f7acfc4c03c88710e531de77cd7f
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: Hashar has...@free.fr
Gerrit-Reviewer: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Unsupported characters - change (mediawiki...mathoid)

2014-08-28 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Unsupported characters
..

Unsupported characters

Currently Mathoid uses the font 'STIX-Web' but
this does not cover all characters allowed by
texvccheck.

Until the desired font Latin Modern supports
all characters allowed by texvccheck we'll use the font
'STIX-Web'.

Change-Id: I51a9c267e4495d42637dd8d43f4ca68064907e52
---
M mathoid-worker.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/90/156790/1

diff --git a/mathoid-worker.js b/mathoid-worker.js
index 601e187..0e701df 100644
--- a/mathoid-worker.js
+++ b/mathoid-worker.js
@@ -14,7 +14,7 @@
 var mjAPI = require(./MathJaxNode/mj-single.js);
 
 var format = TeX;
-var font = TeX;
+var font = STIX-Web;
 
 var config;
 
@@ -101,7 +101,7 @@
data.log = Error: + JSON.stringify(data.errors);
} else {
data.success = true;
-   data.log = success;
+   data.log = success converting + q ;
}
var jsonData = JSON.stringify(data);
errBuf = new Buffer(jsonData);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51a9c267e4495d42637dd8d43f4ca68064907e52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] wip improve error message - change (mediawiki...Math)

2014-08-28 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: wip improve error message
..

wip improve error message

Change-Id: I6a8201107f9280f0cba97509f19b97d8e248c99f
---
M MathMathML.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 10 insertions(+), 3 deletions(-)


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

diff --git a/MathMathML.php b/MathMathML.php
index 1dd8efc..82ead9f 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -265,8 +265,13 @@
} else {
// Do not print bad mathml. It's 
probably too verbose and might
// mess up the browser output.
-   $this-lastError = $this-getError( 
'math_invalidxml', $host );
-   wfDebugLog( 'Math', \nMathML 
InvalidMathML:
+if ( property_exists($jsonResult, 'log' ) ){
+$log = $jsonResult-log;
+} else {
+$log = wfMessage( 'math_unknown_error' 
)-inContentLanguage()-escaped();;
+}
+   $this-lastError = $this-getError( 
'math_mathoid_error', $host, log );
+   wfDebugLog( 'Math', Mathoid conversion 
error:
. var_export( array( 
'post' = $post, 'host' = $host
, 'result' = 
$res ), true ) . \n\n );
return false;
diff --git a/i18n/en.json b/i18n/en.json
index 5be1887..adf1f43 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -24,8 +24,9 @@
 math_output_error: Cannot store math image on filesystem.,
 math_timeout: $1 timeout from \$2\.,
 math_invalidresponse: $1: Invalid response (\$3\) from server 
\$2\:,
-math_invalidxml: MathML is invalid XML.,
+math_invalidxml: MathML or SVG is invalid XML.,
 math_invalidjson: $1 server response is invalid JSON.,
+math_mathoid_error: Conversion error. Server (\$1\) reported: \$2\,
 math_xmlversion: Warning: XML type check skipped! Check if your 
MediaWiki installation is version wmf/1.22wmf7 or newer.,
 math-visualeditor-mwmathinspector-title: Formula,
 math-preference-mwmathinspector-description: Add experimental support 
to VisualEditor for creating and editing of mathematical formulae for testing, 
ahead of general release. Please remember to always review your changes before 
saving when using experimental features.,
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ed6f875..5caae30 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -36,6 +36,7 @@
math_invalidxml: Used as error message.\n\nThis message follows the 
message {{msg-mw|Math failure}}.,
math_invalidjson: Used as error message.\n\nParameters:\n* $1 - 
rendering type (either LaTeXML or Mathoid)\n\nThis message follows the message 
{{msg-mw|Math failure}}.,
math_xmlversion: Warning that XML checking of MathML requires 
wmf/1.22wmf7 or newer.,
+math_mathoid_error:  Used as error message.\n\nFollows the message 
{{msg-mw|Math failure}}.\n\nParameters:\n* $1 - hostname\n* $2 - error message 
retrieved from the server,
math-visualeditor-mwmathinspector-title: Title for the inspector to 
edit nowikimath/nowiki formula blocks.\n{{Identical|Formula}},
math-preference-mwmathinspector-description: Used in 
[[Special:Preferences]].\n\nUsed as description for the checkbox to enable 
editing of mathematical formulae in VisualEditor.\n\nThe label for this 
checkbox is {{msg-mw|Math-preference-mwmathinspector-label}}.,
math-preference-mwmathinspector-discussion-link: {{optional|Used on 
[[Special:Preferences]] as a link to a page where users can discuss this Beta 
Feature. Defaults to a page on MediaWiki.org.}},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a8201107f9280f0cba97509f19b97d8e248c99f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Stable IDs for NTCIR wmc1.02 - change (mediawiki...MathSearch)

2014-08-28 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Stable IDs for NTCIR wmc1.02
..

Stable IDs for NTCIR wmc1.02

Use stable IDs for the second round of NTCIR-11
Math 2 Wikipedia Subtask round 2.

Change-Id: Ic1cfa6c35515f7acfc4c03c88710e531de77cd7f
---
M SpecialMathSearch.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/31/157031/1

diff --git a/SpecialMathSearch.php b/SpecialMathSearch.php
index a28eaa6..0ab2514 100644
--- a/SpecialMathSearch.php
+++ b/SpecialMathSearch.php
@@ -164,7 +164,6 @@
}
 
if ( $this-mathBackend  $this-textpattern ==  ) {
-   wfDebugLog( MathSearch, Starting output 
(notext mode) );
$results = $this-mathBackend-getResultSet();
if ( $results ) {
foreach ( $results as $pageID = $page 
) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1cfa6c35515f7acfc4c03c88710e531de77cd7f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] WIP:mathoid role for production - change (operations/puppet)

2014-08-27 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: WIP:mathoid role for production
..

WIP:mathoid role for production

Change-Id: Iadc5e539b92d0628d022b481756534613dc78ef6
---
M manifests/role/mathoid.pp
1 file changed, 53 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/42/156542/1

diff --git a/manifests/role/mathoid.pp b/manifests/role/mathoid.pp
index b9fc6dc..09d88f5 100644
--- a/manifests/role/mathoid.pp
+++ b/manifests/role/mathoid.pp
@@ -3,14 +3,59 @@
 # We do not have monitoring yet
 #@monitor_group { 'mathoid_eqiad': description = 'eqiad mathoid servers' }
 
-# Skipping production for now
-#class role::mathoid::production {
-#system::role { 'role::mathoid::production':
-#description = 'mathoid server'
-#}
-#
-#deployment::target { 'mathoid': }
-#}
+class role::mathoid::production {
+system::role { 'role::mathoid::production':
+description = 'mathoid server'
+}
+
+class { '::mathoid':
+  base_path = '/srv/deployment/mathoid/mathoid',
+  node_path = '/srv/deployment/mathoid/mathoid/node_modules',
+  conf_path = '/srv/deployment/mathoid/mathoid/mathoid.config.json',
+  log_dir   = '/var/log/mathoid',
+  require   = File[ '/srv/deployment/mathoid/mathoid' ]
+}
+
+file { '/srv/deployment/mathoid/mathoid':
+  ensure = directory,
+  owner = mathoid,
+  group = mathoid,
+  mode = '755',
+}
+
+deployment::target { 'mathoid': }
+
+group { 'mathoid':
+  ensure = present,
+  name   = 'mathoid',
+  system = true,
+}
+
+user { 'mathoid':
+  gid   = 'mathoid',
+  home  = '/srv/deployment/mathoid/mathoid',
+  managehome= true,
+  system= true,
+}
+
+# Beta mathoid server has some ferm DNAT rewriting rules (bug 45868) so we
+# have to explicitly allow mathoid port 10042
+ferm::service { 'http':
+  proto = 'tcp',
+  port  = '10042'
+}
+
+# Allow ssh access from the Jenkins master to the server where mathoid is
+# running
+include contint::firewall::labs
+
+# Instance got to be a Jenkins slave so we can update mathoid whenever a
+# change is made on mediawiki/services/mathoid repository
+include role::ci::slave::labs::common
+# Also need the slave scripts for multi-git.sh
+include contint::slave-scripts
+
+}
 
 class role::mathoid::beta {
 system::role { 'role::mathoid::beta':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadc5e539b92d0628d022b481756534613dc78ef6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] WIP: assign mathoid production hosts - change (operations/puppet)

2014-08-27 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: WIP: assign mathoid production hosts
..

WIP: assign mathoid production hosts

depends on Iadc5e539b92d0628d022b481756534613dc78ef6

Bug: 69990
Change-Id: Idb610901b17bf8a4698dff5769623591fcad01b7
RT: 6077
---
M manifests/site.pp
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/76/156576/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 7209d35..9ae7a9f 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2809,6 +2809,13 @@
 class { 'lvs::realserver':
 realserver_ips = ['10.2.2.28'],
 }
+
+if ( $::hostname == 'wtp1023' ) or ( $::hostname == 'wtp1024' ) {
+include role::mathoid::production
+#TODO: overwrite admin groups for mathoid
+#class { 'admin': groups = ['mathoid-roots',
+#'mathoid-admin'] }
+}
 }
 
 node 'ytterbium.wikimedia.org' {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb610901b17bf8a4698dff5769623591fcad01b7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] wip: mathoid role - change (mediawiki/vagrant)

2014-08-25 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: wip: mathoid role
..

wip: mathoid role

Change-Id: I6c14b350def9c24546a326ff59f6efad83a6e988
---
A puppet/modules/mathoid/manifests/init.pp
A puppet/modules/mathoid/templates/config.erb
A puppet/modules/mathoid/templates/logrotate.erb
A puppet/modules/mathoid/templates/upstart.erb
A puppet/modules/mathoid/tests/Makefile
A puppet/modules/mathoid/tests/mathoid.pp
A puppet/modules/role/manifests/mathoid.pp
7 files changed, 176 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/37/156137/1

diff --git a/puppet/modules/mathoid/manifests/init.pp 
b/puppet/modules/mathoid/manifests/init.pp
new file mode 100644
index 000..662fefb
--- /dev/null
+++ b/puppet/modules/mathoid/manifests/init.pp
@@ -0,0 +1,80 @@
+# == Class: mathoid
+#
+# mathoid is a node.js backend for the math rendering.
+#
+# === Parameters
+#
+# [*base_path*]
+#   Path to the mathoid code.
+# [*node_path*]
+#   Path to the node modules mathoid depends on.
+# [*conf_path*]
+#   Where to place the config file.
+# [*log_dir*]
+#   Place where mathoid can put log files. Assumed to be already existing and
+#   have write access to mathoid user.
+# [*port*]
+#   Port where to run the mathoid service. Defaults to 10042.
+
+#
+class mathoid(
+$base_path,
+$node_path,
+$conf_path,
+$log_dir,
+$port=10042
+) {
+# not required for vagrant (we clone via git here)
+# deployment::target { 'mathoid': }
+
+package { ['nodejs'
+# TODO Add dependency to node-jsdom once
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742347
+# is fixed
+  ]:
+ensure = present,
+}
+
+$log_file = ${log_dir}/main.log
+
+file { $log_dir:
+ensure = directory,
+owner  = mathoid,
+group  = mathoid,
+mode   = '0775',
+}
+
+file { $conf_path:
+ensure  = present,
+owner   = mathoid,
+group   = mathoid,
+mode= '0555',
+content = template('mathoid/config.erb'),
+}
+
+# The upstart configuration
+file { '/etc/init/mathoid.conf':
+ensure  = present,
+owner   = root,
+group   = root,
+mode= '0444',
+content = template('mathoid/upstart.erb'),
+}
+
+file { '/etc/logrotate.d/mathoid':
+ensure  = present,
+owner   = root,
+group   = root,
+mode= '0444',
+content = template('mathoid/logrotate.erb'),
+}
+
+service { 'mathoid':
+ensure = running,
+hasstatus  = true,
+hasrestart = true,
+provider   = 'upstart',
+require= File[$log_dir],
+subscribe  = File['/etc/init/mathoid.conf'],
+}
+}
diff --git a/puppet/modules/mathoid/templates/config.erb 
b/puppet/modules/mathoid/templates/config.erb
new file mode 100644
index 000..0967ef4
--- /dev/null
+++ b/puppet/modules/mathoid/templates/config.erb
@@ -0,0 +1 @@
+{}
diff --git a/puppet/modules/mathoid/templates/logrotate.erb 
b/puppet/modules/mathoid/templates/logrotate.erb
new file mode 100644
index 000..13649f9
--- /dev/null
+++ b/puppet/modules/mathoid/templates/logrotate.erb
@@ -0,0 +1,13 @@
+#
+### THIS FILE IS MANAGED BY PUPPET
+#
+
+%= @log_dir %/* {
+daily
+copytruncate
+missingok
+compress
+notifempty
+rotate 15
+size 256M
+}
diff --git a/puppet/modules/mathoid/templates/upstart.erb 
b/puppet/modules/mathoid/templates/upstart.erb
new file mode 100644
index 000..43eb3f1
--- /dev/null
+++ b/puppet/modules/mathoid/templates/upstart.erb
@@ -0,0 +1,25 @@
+#
+### THIS FILE IS MANAGED BY PUPPET
+#
+
+description Mathoid HTTP service
+
+start on (local-filesystems and net-device-up IFACE!=lo)
+stop on runlevel [!2345]
+
+# up ulimit -n a bit
+limit nofile 1 1
+
+setuid mathoid
+setgid mathoid
+
+env NODE_PATH=%= @node_path %
+env MATHOID_PORT=%= @port %
+
+respawn
+
+# wait 60 seconds for a graceful restart before killing the master
+kill timeout 60
+
+chdir %= @base_path %
+exec /usr/bin/nodejs mathoid.js  %= @log_file % 21
diff --git a/puppet/modules/mathoid/tests/Makefile 
b/puppet/modules/mathoid/tests/Makefile
new file mode 100644
index 000..76cd656
--- /dev/null
+++ b/puppet/modules/mathoid/tests/Makefile
@@ -0,0 +1,13 @@
+MANIFESTS=$(wildcard *.pp)
+OBJS=$(MANIFESTS:.pp=.po)
+TESTS_DIR=$(dir $(CURDIR))
+MODULE_DIR=$(TESTS_DIR:/=)
+MODULES_DIR=$(dir $(MODULE_DIR))
+
+all:   test
+
+test:  $(OBJS)
+
+%.po:  %.pp
+   puppet parser validate $
+   puppet apply 

[MediaWiki-commits] [Gerrit] MathML in default style - change (mediawiki...Math)

2014-08-25 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: MathML in default style
..

MathML in default style

In the default style MahtML was rendered as inline and
not as display-style which was consistent to the current
behaviour of the PNG rendering.

By using the 'inline-TeX' rendering type the
display rendering is done independent of the rendering
of the surrounding block layout.

Change-Id: I87e669d5dc71d6937d4cc987d306b3c4648773c4
---
M MathMathML.php
1 file changed, 4 insertions(+), 3 deletions(-)


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

diff --git a/MathMathML.php b/MathMathML.php
index e5ea73a..1dd8efc 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -212,9 +212,10 @@
} else {
if ( $this-getMathStyle() == 
MW_MATHSTYLE_INLINE_DISPLAYSTYLE ) {
// default preserve the (broken) layout as it 
was
-   $input = '{\\displaystyle ' . $input . '}';
-   }
-   $out = 'type=texq=' . rawurlencode( $input );
+   $out = 'type=inline-TeXq=' .rawurlencode( 
'{\\displaystyle ' . $input . '}' );
+   } else {
+$out = 'type=texq=' . rawurlencode( $input );
+}
}
wfDebugLog( Math, 'Get post data: ' . $out );
return $out;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87e669d5dc71d6937d4cc987d306b3c4648773c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Prevent Special:MathShowImage from showing bad content - change (mediawiki...Math)

2014-08-25 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Prevent Special:MathShowImage from showing bad content
..

Prevent Special:MathShowImage from showing bad content

This commit prohibits that the special-page MathShowImages
tries to display information that are not enabled via
config.

A typical example is that the Specialpage tries to
render PNG images for IE9 even though texvc was not
set up. This was reported as

Bug: 69693
Change-Id: Ifc5888152aa02c973eab959e963085f24a7b2a83
---
M SpecialMathShowImage.php
1 file changed, 9 insertions(+), 1 deletion(-)


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

diff --git a/SpecialMathShowImage.php b/SpecialMathShowImage.php
index d3fa70e..b223949 100644
--- a/SpecialMathShowImage.php
+++ b/SpecialMathShowImage.php
@@ -38,11 +38,19 @@
}
 
function execute( $par ) {
+global $wgMathValidModes, $wgMathEnableExperimentalInputFormats;
$request = $this-getRequest();
$hash = $request-getText( 'hash', '' );
$tex = $request-getText( 'tex', '');
-   $asciimath = $request-getText( 'asciimath', '');
+if( $wgMathEnableExperimentalInputFormats ){
+$asciimath = $request-getText( 'asciimath', '');
+} else {
+$asciimath = '';
+}
$this-mode = $request-getInt( 'mode', MW_MATH_MATHML );
+if( ! in_array( $this-mode, $wgMathValidModes ) ){
+$this-mode ( MW_MATH_MATHML );
+}
if ( $hash === ''  $tex === ''  $asciimath === '' ) {
$this-setHeaders( false );
echo $this-printSvgError( 'No Inputhash specified' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc5888152aa02c973eab959e963085f24a7b2a83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Revert Added a hook for modifications to MathJax - change (mediawiki...Math)

2014-08-19 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Revert Added a hook for modifications to MathJax
..

Revert Added a hook for modifications to MathJax

This reverts commit 0a8fbac418987b81993a4d41e52652096d90d3bc.

Change-Id: If4442d07e4d82e1f45211bb2b331221c62fadbb8
---
M Math.php
M modules/ext.math.mathjax.enabler.js
2 files changed, 0 insertions(+), 6 deletions(-)


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

diff --git a/Math.php b/Math.php
index 7773ca4..d5d295e 100644
--- a/Math.php
+++ b/Math.php
@@ -465,10 +465,6 @@
'scripts' = array( 'Fraktur/Bold/BasicLatin.js', 
'Fraktur/Bold/Other.js', 'Fraktur/Bold/PUA.js', 
'Fraktur/Regular/BasicLatin.js', 'Fraktur/Regular/Other.js', 
'Fraktur/Regular/PUA.js', 'SansSerif/Bold/BasicLatin.js', 
'SansSerif/Bold/CombDiacritMarks.js', 'SansSerif/Bold/Other.js', 
'SansSerif/Italic/BasicLatin.js', 'SansSerif/Italic/CombDiacritMarks.js', 
'SansSerif/Italic/Other.js', 'SansSerif/Regular/BasicLatin.js', 
'SansSerif/Regular/CombDiacritMarks.js', 'SansSerif/Regular/Other.js', 
'Script/Regular/BasicLatin.js', 'Typewriter/Regular/BasicLatin.js', 
'Typewriter/Regular/CombDiacritMarks.js', 'Typewriter/Regular/Other.js' )
) + $moduleTemplateSVG
 );
-$wgResourceModules += array(
-   'ext.math.mathjax.customize' = array(
-   'dependencies' = 'ext.math.mathjax.mathjax' )
-);
 
 $moduleTemplate = array(
 'localBasePath' = __DIR__ . '/modules',
diff --git a/modules/ext.math.mathjax.enabler.js 
b/modules/ext.math.mathjax.enabler.js
index be024a3..ec56d1e 100644
--- a/modules/ext.math.mathjax.enabler.js
+++ b/modules/ext.math.mathjax.enabler.js
@@ -103,8 +103,6 @@
mathJax.Init = function () {
// Configure MathJax
MathJax.Hub.Config( mathJax.config );
-   // This hook can be used to override MathJax configuration.
-   mw.loader.load( 'ext.math.mathjax.customize' );
MathJax.OutputJax.fontDir = mw.config.get( 
'wgExtensionAssetsPath' ) + '/Math/modules/MathJax/fonts';
 
// Redefine MathJax.Hub.Startup.Jax

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4442d07e4d82e1f45211bb2b331221c62fadbb8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] i18 for MathIndex special page - change (mediawiki...MathSearch)

2014-08-18 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: i18 for MathIndex special page
..

i18 for MathIndex special page

Change-Id: I3a0d4a5f7a067968f2a025ea632171db71ec3437
---
M MathSearch.alias.php
M i18n/en.json
2 files changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/39/154839/1

diff --git a/MathSearch.alias.php b/MathSearch.alias.php
index 5fb09f7..39c608a 100644
--- a/MathSearch.alias.php
+++ b/MathSearch.alias.php
@@ -15,6 +15,7 @@
'MathDebug' = array( 'MathDebug', 'Math Debug' ),
'FormulaInfo' = array( 'FormulaInfo', 'Formula Info' ),
'GetEquationsByQuery' = array( 'GetEquationsByQuery', 'Get Formulae by 
Query' ),
+   'MathIndex' = array( 'MathIndex', 'Math Index' ),
 );
 
 /** Arabic (العربية) */
diff --git a/i18n/en.json b/i18n/en.json
index efec38b..e0c8b55 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -6,6 +6,7 @@
 },
 mathsearch: Math search,
 formulainfo: Formula info,
+   mathindex: Math index,
 specialpages-group-mathsearch: Math search,
 mathsearch-desc: Integrates the [http://search.mathweb.org/about.html 
MathWeb Search] engine,
 getequationsbyquery: Get equations by query,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a0d4a5f7a067968f2a025ea632171db71ec3437
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Ignore local browsertest files - change (mediawiki...Math)

2014-08-14 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Ignore local browsertest files
..

Ignore local browsertest files

Change-Id: If4573c4ca0feb80a35a008133e55e91e82b68651
---
M .gitignore
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/.gitignore b/.gitignore
index ed865bf..868c8aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,5 @@
 modules/MathJax/unpacked/jax/output/SVG/fonts/Latin-Modern
 modules/MathJax/unpacked/jax/output/SVG/fonts/Neo-Euler
 modules/MathJax/unpacked/jax/output/SVG/fonts/STIX-Web
+tests/browser/.bundle
+tests/browser/.gem

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4573c4ca0feb80a35a008133e55e91e82b68651
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Protect MathML from Tidy - change (mediawiki/core)

2014-08-14 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Protect MathML from Tidy
..

Protect MathML from Tidy

MediaWiki installations that use the setting
$wgUseTidy = true; are unable to to output
MathML since the well defined MathML elements
are filtered out by Tidy. This was reported as
  http://sourceforge.net/p/tidy/patches/84/ .

This change hides MathML blocks from
Tidy.

Bug: 66516
Change-Id: Ib48b91238c3eddd6a86b62f6ce57801d7058f0d8
---
M includes/parser/MWTidy.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/154083/1

diff --git a/includes/parser/MWTidy.php b/includes/parser/MWTidy.php
index a108d2b..28dd100 100644
--- a/includes/parser/MWTidy.php
+++ b/includes/parser/MWTidy.php
@@ -44,6 +44,8 @@
 
protected $mMarkerIndex;
 
+   const MATH_REGEX = '#math(.*?)/math#s';
+
public function __construct() {
$this-mTokens = null;
$this-mUniqPrefix = null;
@@ -65,7 +67,9 @@
// ...and mw:toc markers
$wrappedtext = preg_replace_callback( '/\\\/?mw:toc\/',
array( $this, 'replaceCallback' ), $wrappedtext );
-
+   // ... and math tags
+   $wrappedtext = preg_replace_callback( self::MATH_REGEX,
+   array( $this, 'replaceCallback' ), $wrappedtext );
// Modify inline Microdata link and meta elements so they 
say html-link and html-meta so
// we can trick Tidy into not stripping them out by including 
them in tidy's new-empty-tags config
$wrappedtext = preg_replace( '!(link|meta)([^]*?)(/{0,1})!', 
'html-$1$2$3', $wrappedtext );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib48b91238c3eddd6a86b62f6ce57801d7058f0d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Protect MathML from Tidy - change (mediawiki...Math)

2014-08-13 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Protect MathML from Tidy
..

Protect MathML from Tidy

MediaWiki installations that use the setting
$wgUseTidy = true; are unable to to output
MathML since the well defined MathML elements
are filtered out by Tidy. This was reported as
  http://sourceforge.net/p/tidy/patches/84/ .

This change hides the MathML elements from
Tidy.

Bug 66516

Change-Id: I826c93fab32fb5012f609b22c378ea8a2590d6a7
---
M Math.hooks.php
M Math.php
2 files changed, 23 insertions(+), 3 deletions(-)


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

diff --git a/Math.hooks.php b/Math.hooks.php
index 65819a1..c1b419f 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -92,7 +92,7 @@
 * @return array
 */
static function mathTagHook( $content, $attributes, $parser ) {
-   global $wgUseMathJax, $wgMathDisableTexFilter;
+   global $wgUseMathJax, $wgMathDisableTexFilter, $wgUseTidy;
 
if ( trim( $content ) === '' ) { // bug 8372
return '';
@@ -138,12 +138,31 @@
 
// Writes cache if rendering was successful
$renderer-writeCache();
+   // Hide math output from Tidy
+   if ( $wgUseTidy ) {
+   $renderedMath = '!--untidy' .$renderedMath  . 
'untidy--';
+   }
wfProfileOut( __METHOD__ );
-
-   return array( $renderedMath, markerType = 'nowiki' );
+   return array( $renderedMath , markerType = 'nowiki' );
}
 
/**
+* Hook that restores the Math output that was hidden from Tidy
+*
+* @param $parser Parser link to the Parser object
+* @param $text string the page text
+* @return bool
+*/
+   static function onParserAfterTidy( $parser, $text ){
+   global $wgUseTidy;
+   if ( $wgUseTidy ){
+   wfProfileIn( __METHOD__ );
+   $text = preg_replace( 
'/(!--untidy)(.*?)(untidy--)/s','$2' ,$text );
+   wfProfileOut( __METHOD__ );
+   }
+   return true;
+   }
+   /**
 * Add the new math rendering options to Special:Preferences.
 *
 * @param $user Object: current User object
diff --git a/Math.php b/Math.php
index d5d295e..4a2d0bd 100644
--- a/Math.php
+++ b/Math.php
@@ -210,6 +210,7 @@
 $wgHooks['UnitTestsList'][] = 'MathHooks::onRegisterUnitTests';
 $wgHooks['PageRenderingHash'][] = 'MathHooks::onPageRenderingHash';
 $wgHooks['EditPageBeforeEditToolbar'][] = 
'MathHooks::onEditPageBeforeEditToolbar';
+$wgHooks['ParserAfterTidy'][] = 'MathHooks::onParserAfterTidy';
 
 $dir = __DIR__ . '/';
 $wgAutoloadClasses['MathHooks'] = $dir . 'Math.hooks.php';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I826c93fab32fb5012f609b22c378ea8a2590d6a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] WIP: run update.php with mwscript - change (mediawiki/core)

2014-08-12 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: WIP: run update.php with mwscript
..

WIP: run update.php with mwscript

Bug: 69434
Change-Id: Ice21f8bfda5aa6a8b96bfb787d7d0b55cbb86358
---
M maintenance/update.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/153601/1

diff --git a/maintenance/update.php b/maintenance/update.php
index 046d73c..4a5632f 100755
--- a/maintenance/update.php
+++ b/maintenance/update.php
@@ -1,4 +1,4 @@
-#!/usr/bin/env php
+#!/usr/bin/env mwscript
 ?php
 /**
  * Run all updaters.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice21f8bfda5aa6a8b96bfb787d7d0b55cbb86358
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Re-enable all Math modes on beta - change (operations/mediawiki-config)

2014-08-12 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Re-enable all Math modes on beta
..

Re-enable all Math modes on beta

Enable all Math modes on beta before merging
If92549c79066688c3a915e14792d2fab9785dc79

Bug: 66587
Bug: 66492
Change-Id: I4509708582407b080914c022757f606289559945
---
M wmf-config/CommonSettings-labs.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/10/153610/1

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 77bbc30..911a2d5 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -156,6 +156,8 @@
 if( $wmgUseMath ) {
$wgMathFileBackend = false;
$wgMathDirectory   = '/data/project/upload7/math';
+   $wgMathValidModes = array( MW_MATH_PNG, MW_MATH_SOURCE, MW_MATH_MATHML 
);
+   $wgMathMathMLUrl = 'http://deployment-mathoid.eqiad.wmflabs:10042';
 }
 
 // CORS (cross-domain AJAX, bug 20814)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4509708582407b080914c022757f606289559945
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Update npm modules to ubuntu14 - change (mediawiki...mathoid)

2014-08-11 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Update npm modules to ubuntu14
..

Update npm modules to ubuntu14

Ubunut 14 version of mathoid 0.2.5

Change-Id: I4d0eb9db7e4243c0cf09ec31b6ccf57b1027047a
---
M debian/changelog
M node_modules/express/node_modules/connect/node_modules/formidable/package.json
M node_modules/express/node_modules/connect/package.json
M node_modules/express/node_modules/mime/package.json
R node_modules/express/node_modules/mkdirp/.gitignore
C node_modules/express/node_modules/mkdirp/.gitignore.orig
A node_modules/express/node_modules/mkdirp/.gitignore.rej
A node_modules/express/node_modules/mkdirp/examples/pow.js.orig
A node_modules/express/node_modules/mkdirp/examples/pow.js.rej
M node_modules/express/node_modules/mkdirp/package.json
R node_modules/express/node_modules/qs/.gitignore
M node_modules/express/node_modules/qs/package.json
M node_modules/express/package.json
M 
node_modules/jsdom/node_modules/contextify/build/Release/.deps/Release/contextify.node.d
M 
node_modules/jsdom/node_modules/contextify/build/Release/.deps/Release/obj.target/contextify.node.d
M 
node_modules/jsdom/node_modules/contextify/build/Release/.deps/Release/obj.target/contextify/src/contextify.o.d
M node_modules/jsdom/node_modules/contextify/build/Release/contextify.node
M 
node_modules/jsdom/node_modules/contextify/build/Release/obj.target/contextify.node
M 
node_modules/jsdom/node_modules/contextify/build/Release/obj.target/contextify/src/contextify.o
M node_modules/jsdom/node_modules/contextify/build/binding.Makefile
M node_modules/jsdom/node_modules/contextify/build/config.gypi
M node_modules/jsdom/node_modules/contextify/build/contextify.target.mk
M node_modules/jsdom/node_modules/contextify/node_modules/bindings/package.json
M node_modules/jsdom/node_modules/contextify/node_modules/nan/package.json
M node_modules/jsdom/node_modules/contextify/package.json
A node_modules/jsdom/node_modules/cssom/README.mdown
M node_modules/jsdom/node_modules/cssom/package.json
M node_modules/jsdom/node_modules/cssstyle/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/domelementtype/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/domhandler/package.json
M node_modules/jsdom/node_modules/htmlparser2/node_modules/domutils/package.json
M node_modules/jsdom/node_modules/htmlparser2/node_modules/entities/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/package.json
M node_modules/jsdom/node_modules/htmlparser2/package.json
M node_modules/jsdom/node_modules/nwmatcher/package.json
M node_modules/jsdom/node_modules/xmlhttprequest/package.json
M node_modules/jsdom/package.json
A node_modules/querystring/.History.md.un~
A node_modules/querystring/.Readme.md.un~
A node_modules/querystring/.package.json.un~
M node_modules/querystring/package.json
A node_modules/querystring/test/.index.js.un~
M node_modules/request/CHANGELOG.md
M node_modules/request/README.md
M node_modules/request/index.js
M node_modules/request/node_modules/aws-sign2/package.json
M node_modules/request/node_modules/forever-agent/package.json
M node_modules/request/node_modules/form-data/node_modules/async/package.json
R 
node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.gitignore
M 
node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json
M 
node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json
M node_modules/request/node_modules/form-data/node_modules/mime/package.json
M node_modules/request/node_modules/form-data/package.json
M node_modules/request/node_modules/hawk/node_modules/boom/package.json
M node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
M node_modules/request/node_modules/hawk/node_modules/hoek/package.json
M node_modules/request/node_modules/hawk/node_modules/sntp/package.json
M node_modules/request/node_modules/hawk/package.json
M 
node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
M 
node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
M 
node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
M node_modules/request/node_modules/http-signature/package.json
M node_modules/request/node_modules/json-stringify-safe/package.json
M 

[MediaWiki-commits] [Gerrit] Update npm modules to ubuntu14 - change (mediawiki...mathoid)

2014-08-11 Thread Physikerwelt (Code Review)
Physikerwelt has submitted this change and it was merged.

Change subject: Update npm modules to ubuntu14
..


Update npm modules to ubuntu14

Ubunut 14 version of mathoid 0.2.5

Bug: 68099
Bug: 69298
Change-Id: I4d0eb9db7e4243c0cf09ec31b6ccf57b1027047a
---
M debian/changelog
M node_modules/express/node_modules/connect/node_modules/formidable/package.json
M node_modules/express/node_modules/connect/package.json
M node_modules/express/node_modules/mime/package.json
R node_modules/express/node_modules/mkdirp/.gitignore
C node_modules/express/node_modules/mkdirp/.gitignore.orig
A node_modules/express/node_modules/mkdirp/.gitignore.rej
A node_modules/express/node_modules/mkdirp/examples/pow.js.orig
A node_modules/express/node_modules/mkdirp/examples/pow.js.rej
M node_modules/express/node_modules/mkdirp/package.json
R node_modules/express/node_modules/qs/.gitignore
M node_modules/express/node_modules/qs/package.json
M node_modules/express/package.json
M 
node_modules/jsdom/node_modules/contextify/build/Release/.deps/Release/contextify.node.d
M 
node_modules/jsdom/node_modules/contextify/build/Release/.deps/Release/obj.target/contextify.node.d
M 
node_modules/jsdom/node_modules/contextify/build/Release/.deps/Release/obj.target/contextify/src/contextify.o.d
M node_modules/jsdom/node_modules/contextify/build/Release/contextify.node
M 
node_modules/jsdom/node_modules/contextify/build/Release/obj.target/contextify.node
M 
node_modules/jsdom/node_modules/contextify/build/Release/obj.target/contextify/src/contextify.o
M node_modules/jsdom/node_modules/contextify/build/binding.Makefile
M node_modules/jsdom/node_modules/contextify/build/config.gypi
M node_modules/jsdom/node_modules/contextify/build/contextify.target.mk
M node_modules/jsdom/node_modules/contextify/node_modules/bindings/package.json
M node_modules/jsdom/node_modules/contextify/node_modules/nan/package.json
M node_modules/jsdom/node_modules/contextify/package.json
A node_modules/jsdom/node_modules/cssom/README.mdown
M node_modules/jsdom/node_modules/cssom/package.json
M node_modules/jsdom/node_modules/cssstyle/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/domelementtype/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/domhandler/package.json
M node_modules/jsdom/node_modules/htmlparser2/node_modules/domutils/package.json
M node_modules/jsdom/node_modules/htmlparser2/node_modules/entities/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/package.json
M 
node_modules/jsdom/node_modules/htmlparser2/node_modules/readable-stream/package.json
M node_modules/jsdom/node_modules/htmlparser2/package.json
M node_modules/jsdom/node_modules/nwmatcher/package.json
M node_modules/jsdom/node_modules/xmlhttprequest/package.json
M node_modules/jsdom/package.json
A node_modules/querystring/.History.md.un~
A node_modules/querystring/.Readme.md.un~
A node_modules/querystring/.package.json.un~
M node_modules/querystring/package.json
A node_modules/querystring/test/.index.js.un~
M node_modules/request/CHANGELOG.md
M node_modules/request/README.md
M node_modules/request/index.js
M node_modules/request/node_modules/aws-sign2/package.json
M node_modules/request/node_modules/forever-agent/package.json
M node_modules/request/node_modules/form-data/node_modules/async/package.json
R 
node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.gitignore
M 
node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json
M 
node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json
M node_modules/request/node_modules/form-data/node_modules/mime/package.json
M node_modules/request/node_modules/form-data/package.json
M node_modules/request/node_modules/hawk/node_modules/boom/package.json
M node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
M node_modules/request/node_modules/hawk/node_modules/hoek/package.json
M node_modules/request/node_modules/hawk/node_modules/sntp/package.json
M node_modules/request/node_modules/hawk/package.json
M 
node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
M 
node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
M 
node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
M node_modules/request/node_modules/http-signature/package.json
M node_modules/request/node_modules/json-stringify-safe/package.json
M 

[MediaWiki-commits] [Gerrit] add math browsertests - change (mediawiki/vagrant)

2014-08-07 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: add math browsertests
..

add math browsertests

Change-Id: I6d0222d15e6c160f551011ced760f797109abacd
---
M puppet/manifests/roles/math.pp
D settings.d/00-debug.php-example
2 files changed, 2 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/32/152432/1

diff --git a/puppet/manifests/roles/math.pp b/puppet/manifests/roles/math.pp
index d432c94..99f9f66 100644
--- a/puppet/manifests/roles/math.pp
+++ b/puppet/manifests/roles/math.pp
@@ -9,7 +9,8 @@
 include packages::imagemagick
 
 mediawiki::extension { 'Math':
-needs_update = true,
+needs_update  = true,
+browser_tests = true,
 }
 
 package { [
diff --git a/settings.d/00-debug.php-example b/settings.d/00-debug.php-example
deleted file mode 100644
index 9e3dafc..000
--- a/settings.d/00-debug.php-example
+++ /dev/null
@@ -1,54 +0,0 @@
-?php
-
-/**
- * Debug settings for MediaWiki
- *
- * This file contains various MediaWiki configurations designed to assist
- * feature development, profiling, and debugging work. To enable these
- * settings, remove the '-example' suffix from this file's name. For an
- * overview of using settings.d/ to manage MediaWiki configurations, see the
- * README file in this folder. For a detailed description of the configuration
- * variables set below, and a survey of some common debugging techniques, see
- * http://www.mediawiki.org/wiki/Manual:How_to_debug.
- */
-
-//
-// Tools
-//
-
-$wgDebugToolbar = false;
-
-
-//
-// Output settings
-//
-
-$wgShowDebug = false;
-$wgShowExceptionDetails = true;
-// $wgDebugRedirects = false;
-// $wgShowSQLErrors = true;
-// $wgDebugDumpSql  = true;
-// $wgMemCachedDebug = false;
-// $wgShowDBErrorBacktrace = false;
-
-
-//
-// Logging
-//
-
-$mwLogDir = __DIR__ . '/../logs';
-$wgDebugLogFile = $mwLogDir/debug.log;
-$wgDBerrorLog = $mwLogDir/dberror.log;
-// $wgRateLimitLog = $mwLogDir/ratelimit.log;
-$wgDebugLogGroups['exception'] = $mwLogDir/exception.log;
-$wgDebugLogGroups['resourceloader'] = $mwLogDir/resourceloader.log;
-// $wgDebugLogGroups['somegroup'] = $mwLogDir/somegroup.log
-
-
-// ResourceLoader-specific
-
-// $wgDebugRawPage = true;
-// $wgResourceLoaderMaxage['versioned']['server'] = 1;
-// $wgResourceLoaderMaxage['versioned']['client'] = 1;
-// $wgResourceLoaderMaxage['unversioned']['server'] = 1;
-// $wgResourceLoaderMaxage['unversioned']['client'] = 1;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d0222d15e6c160f551011ced760f797109abacd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Update MathSearch role - change (mediawiki/vagrant)

2014-08-07 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Update MathSearch role
..

Update MathSearch role

* MathSearch uses the master branch of the Math extension now

Change-Id: I44936742367fc4f4f3b6f083ec3be8c806e51b5d
---
M puppet/manifests/roles/math_search.pp
1 file changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/20/152720/1

diff --git a/puppet/manifests/roles/math_search.pp 
b/puppet/manifests/roles/math_search.pp
index 55effb5..491e574 100644
--- a/puppet/manifests/roles/math_search.pp
+++ b/puppet/manifests/roles/math_search.pp
@@ -1,15 +1,12 @@
-# == Class: role::math::search
+# == Class: role::mathsearch
 #
 # The MathSearch extension integrates the MathWeb Search, a
 # content-based search engine for mathematical formulae. It indexes
 # MathML formulae, using a technique derived from automated theorem
 # proving: term indexing.
-class role::mathsearch inherits role::math {
+class role::mathsearch {
 include role::geshi
-
-Mediawiki::Extension['Math'] {
-branch + 'dev',
-}
+include role::math
 
 mediawiki::extension { 'MathSearch':
 require  = Mediawiki::Extension['Math'],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44936742367fc4f4f3b6f083ec3be8c806e51b5d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de

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


[MediaWiki-commits] [Gerrit] Add log entry - change (mediawiki...mathoid)

2014-07-31 Thread Physikerwelt (Code Review)
Hello GWicke,

I'd like you to do a code review.  Please visit

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

to review the following change.

Change subject: Add log entry
..

Add log entry

If $wgMathDebug is set the math extension, expects
a debug value to be set.
---
M mathoid-worker.js
1 file changed, 31 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/99/150799/1

diff --git a/mathoid-worker.js b/mathoid-worker.js
index 9a0a0e3..5e832c9 100644
--- a/mathoid-worker.js
+++ b/mathoid-worker.js
@@ -82,38 +82,39 @@
 });
 
 
-
 function handleRequest(req, res, q, type) {
-   var mml =true;
-   //Keep format variables constant
-   if(type == tex){
-   type = TeX
-   }
-   if(type == mml || type == MathML){
-   type = MathML
-   mml = false;
-   }
-   if(type == ascii || type == asciimath ){
-   type = AsciiMath
-   }   
-   mjAPI.typeset({math:q, format:type, svg:true, img:true, mml:mml}, 
function (data) {
-   if(data.errors){
-   data.success = false;
-   } else {
-   data.success = true;
-   }   
-   var jsonData = JSON.stringify(data);
-   errBuf = new Buffer(jsonData);
-   res.writeHead(200,
-   {
-   'Content-Type': 'application/json',
-   'Content-length': errBuf.length
-   });
-   res.end(errBuf);
+var mml = true;
+//Keep format variables constant
+if (type == tex) {
+type = TeX
+}
+if (type == mml || type == MathML) {
+type = MathML
+mml = false;
+}
+if (type == ascii || type == asciimath) {
+type = AsciiMath
+}
+mjAPI.typeset({math: q, format: type, svg: true, img: true, mml: mml}, 
function (data) {
+if (data.errors) {
+data.success = false;
+data.log = Error: + JSON.stringify(data.errors);
+} else {
+data.success = true;
+data.log = success;
+}
+var jsonData = JSON.stringify(data);
+errBuf = new Buffer(jsonData);
+res.writeHead(200,
+{
+'Content-Type': 'application/json',
+'Content-length': errBuf.length
+});
+res.end(errBuf);
 
-   requestQueue.shift();
-   handleRequests();//*/
-});
+requestQueue.shift();
+handleRequests();
+});
 }
 
 handleRequests = function() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I975f53f99979f1ea8b7aa4d2d5ba501635009de5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: GWicke gwi...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Add log entry - change (mediawiki...mathoid)

2014-07-31 Thread Physikerwelt (Code Review)
Hello GWicke,

I'd like you to do a code review.  Please visit

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

to review the following change.

Change subject: Add log entry
..

Add log entry

If $wgMathDebug is set the math extension, expects
a debug value to be set.
---
M mathoid-worker.js
1 file changed, 12 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/00/150800/1

diff --git a/mathoid-worker.js b/mathoid-worker.js
index 9a0a0e3..601e187 100644
--- a/mathoid-worker.js
+++ b/mathoid-worker.js
@@ -82,26 +82,27 @@
 });
 
 
-
 function handleRequest(req, res, q, type) {
-   var mml =true;
+   var mml = true;
//Keep format variables constant
-   if(type == tex){
+   if (type == tex) {
type = TeX
}
-   if(type == mml || type == MathML){
+   if (type == mml || type == MathML) {
type = MathML
mml = false;
}
-   if(type == ascii || type == asciimath ){
+   if (type == ascii || type == asciimath) {
type = AsciiMath
-   }   
-   mjAPI.typeset({math:q, format:type, svg:true, img:true, mml:mml}, 
function (data) {
-   if(data.errors){
+   }
+   mjAPI.typeset({math: q, format: type, svg: true, img: true, mml: mml}, 
function (data) {
+   if (data.errors) {
data.success = false;
+   data.log = Error: + JSON.stringify(data.errors);
} else {
data.success = true;
-   }   
+   data.log = success;
+   }
var jsonData = JSON.stringify(data);
errBuf = new Buffer(jsonData);
res.writeHead(200,
@@ -112,8 +113,8 @@
res.end(errBuf);
 
requestQueue.shift();
-   handleRequests();//*/
-});
+   handleRequests();
+   });
 }
 
 handleRequests = function() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice1e6dbf786ed9af53a05dc740c93738f6b30bfa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt w...@physikerwelt.de
Gerrit-Reviewer: GWicke gwi...@wikimedia.org

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


<    1   2   3   4   5   6   7   8   9   10   >