Commit graph

262 commits

Author SHA1 Message Date
Frédéric Wang d4e928a486 SVG images should not be loaded when MathML is used
- Use span with a background-image instead of <img> for the fallback SVG so
  that they don't load in Gecko.
- Make the image fallback a span inline-block so that it can have a dimension.

Bug: 71929
Change-Id: I7f820cd5766db1fece452ebfc72915a55e42c82e
2014-10-12 23:00:55 +00:00
Frédéric Wang 3d0b787cbe Move vertical-align back to ext.math.css
This improves If8ee1cf6453257a0a2f6aa186d4007954a8e5d8e

Change-Id: I794b39a5d322a92d9f722ded790e213803448127
2014-10-12 18:22:06 +00:00
Frédéric Wang 296c79e070 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
2014-10-12 13:42:01 +02:00
Frédéric Wang 74e4c3733d (Experimental) Fix centering of SVG image in display mode.
Change-Id: I7d5ec171c39b2eec563e074a4062b3e3682790f7
2014-10-11 21:21:46 +02:00
Frédéric Wang ee479e8e68 Fix centering of PNG image in display mode.
Revert the mistake made in https://gerrit.wikimedia.org/r/#/c/139120.

Change-Id: I31420ba3ab1e1b47c3e7307ac4a9aca2a6a8223f
2014-10-11 21:17:15 +02:00
Frédéric Wang 8e66e40780 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
2014-10-11 17:21:30 +00:00
Frédéric Wang 0ddd3afaea 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
2014-10-11 13:21:59 +00:00
Frédéric Wang 82f919b496 Upgrade Latin Modern Math to 1.959
Bug: 70360
Change-Id: Icb6ae3770a3d56bc03453ff5604eabb4699f2595
2014-10-11 13:26:37 +02:00
Frédéric Wang c3894c2c49 Display MathML when MathPlayer is installed
When MathPlayer is installed, we show the MathML instead of the SVG fallback.
This will in particular allow the sync highlighting feature of MathPlayer.
This also introduces a module ext.math.js that could be used to do some
Javascript postprocessing.

Bug: 71748
Change-Id: I438a20032c312d12321ca4c5686bcfd107656b37
2014-10-10 20:20:47 +02:00
Frédéric Wang 050564646d Modify the math font-family for native MathML
- add "Cambria" to workaround a bug on Firefox Windows.
- remove obsolete local fonts (MathJax and STIXGeneral).

Change-Id: I06e757b029b8778b88bc6e75e20929e0c945e364
2014-10-09 21:09:10 +02:00
Frédéric Wang 9f6257c329 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
2014-10-05 17:48:41 +00:00
Frédéric Wang 639d8a766f Separating MediaWiki specific files from MathJax module
This commit separates the files wiki2jax.js and texvc.js from the
MathJax modules. This allows for MathJax updates without affecting
MediaWiki files. It also defines the MediaWiki path configuration,
although this will really only be usable in MathJax 2.4. Finally,
it fixes jshint errors in texvc.js and wiki2jax.js

Moved texvc.js and wiki2jax.js to extensions/Math/modules/mediawiki-extensions directory

Change-Id:  I97d68c0555bc9fbdd6bf42912aa249d57b3d9359
2014-08-29 21:03:41 +02:00
Physikerwelt 7f6db28dd6 Revert "Added a hook for modifications to MathJax"
This reverts commit 0a8fbac418.

Change-Id: If4442d07e4d82e1f45211bb2b331221c62fadbb8
2014-08-19 19:13:35 +00:00
Translation updater bot 0a8fbac418 Added a hook for modifications to MathJax
The signal 'ext.math.mathjax.customize' is added to the
mathJax.Init function. Extensions can call this signal for
modifications to MathJax.

Change-Id: Ia2bae50cd1fcd15d4775d7b9666679c477060659
2014-08-19 11:07:57 -04:00
Frédéric Wang f590974c25 Add default display options
In some cases for example if the vagrant role
mobilefrontend is enabled the stylesheets are not
processed on mobile devices.
Without a default setting for the display attribute
all elements are displayed at the same time.

Change-Id: Ic0e95effaf0b413ec4c5878e1cfd5c269daa44c3
2014-07-25 17:19:30 +00:00
physikerwelt (Moritz Schubotz) bc519c22f4 Move @namespace css style to top
According to PHPStrom the @namespace css
element must be before normal css rules

Change-Id: I43eb10e976446bf846856f9c4f462a5be034062f
2014-07-25 13:00:13 -04:00
Trevor Parscal b3335f60c4 Specify dialog size in VisualEditor
Corresponds to changes to window system of OOUI and thus VisualEditor Ia74732e

Change-Id: I72f410e09eddc82e562b6beb74772636b896dcd7
2014-07-19 22:36:15 +00:00
Ed Sanders 47a6bd2073 Fix rerendering in VE
this.$element is no longer a wrapper, so use .filter instead
of .find. Don't use domElements argument as this has already
been written to this.$element at this stage (will remove this
argument in VE core).

Change-Id: If24580102201e2b83b57c63d85335bd728a28784
2014-07-14 17:45:24 +00:00
Frédéric Wang 382454a979 Update modules/ext.math.css
Currently, the PNG fallback is hidden in the MathML mode and the MathML & SVG
are respectively hidden and visible by default; the visibility of the
SVG/MathML output is only changed for Gecko. This does not work well for
IE < 9, which does not support SVG. This commit tries to improve the selection
of PNG, SVG or MathML according to the browser capatibility.

Change-Id: Ie9b0fdb66c51fbf6be98df092ce4de29fbba6068
2014-06-30 10:52:59 +00:00
Ed Sanders 7c08fc5b72 Migrate VE icon from VE extension
Removed from VE with Ic8074be2.

Change-Id: I33cdb6204b4abc44398ecedd65f7d9251e73e9b0
2014-06-21 14:52:16 +00:00
Ed Sanders e0a7cdf26d Remove display:inline-block highlight hacks for math nodes
With getClientRects these are no longer necessary.

Depends on I09f1c0850 in VE core.

Change-Id: I2c4c1809a92c6d2cbf6769782f7595a508d823ea
2014-06-16 14:48:29 +01:00
Frédéric Wang a3015f6e79 Hide redundant output in the MathML mode.
In the MathML mode, the SVG is always visible and for Gecko the MathML
output is visible too. This commit modifies ext.math.css to hide redundant
output for a given mathematical formula.

Change-Id: I5d48ec4f2a40246567b201e82444e61d408cb3b5
2014-06-11 14:16:57 +02:00
Frédéric Wang 27aee07cb0 Fonts for native MathML
This sets the default font-family on <math> elements so that we try to use
OpenType MATH fonts that are likely to be installed or fallback to WOFF and
obsolete mathematical fonts.

Bug: 65532
Change-Id: Id4517a3ce5eab4acdf2264712ba132b972120042
2014-06-10 11:07:10 +00:00
jenkins-bot 09359385b4 Merge "Use new MWInlineExtensionNode and DM node construction" 2014-06-07 03:47:54 +00:00
physikerwelt c390f6479a Add getHtmlOutput method
Currently the method render always returns
a html string that can be a string that
represents the correct result or a rendered
error message.
This change adds a mechanism that allows
to fetch the HTML output.
In a followup commit the rendering function
is changed to return a boolean value rather
than the rendering result.
This will simplify the error handling and caching.

Change-Id: I80760493e391911c41eb69d75a93c6a34db8852e
2014-06-06 21:52:35 +02:00
Ed Sanders 03f09e4e26 Use new MWInlineExtensionNode and DM node construction
Depends on I0ddcabeb and I8d4f37b6 in core.

Change-Id: I7d5e1174c4f8a49d926b287b8dd109e3148cf95b
2014-06-03 19:24:30 +01:00
Frédéric Wang a586c80083 Revome useless MathJax files added in Ib7f2e4b8eb7250ea4fc24aac3cedf196211f38c2
These files were added in but the change was totally unrelated to the
AsciiMath issue mentioned there and moreover this commit bypassed review.
These entity references are useless for LaTeXML
(which does not generate entity names), for the client-side MathJax
(which does not use MathML input) and for mathoid (which uses
phantomjs=webkit and thus already parses the HTML5 entity names correctly).
Finally, these files are likely to disappear in future MathJax versions.
So let's remove these files until it is clear what the intention was.

Change-Id: Iee875632411b98d1e86d3bb10f69ae3797105de7
2014-05-08 08:47:04 +02:00
physikerwelt (Moritz Schubotz) 7c0a940a78 Add missing MathJax files
some files required for Mathoid were missing in the
modules/MahtJax folder

For example I15cb2d1cb0533a2fa0e21012198387501a3b42ea
requires AsciiMath and LaTeXML requires named entities

Change-Id: Ib7f2e4b8eb7250ea4fc24aac3cedf196211f38c2
2014-05-07 11:50:14 +00:00
jenkins-bot e6a412132d Merge "Update for 126166 in VE Core" 2014-04-21 22:46:32 +00:00
James D. Forrester c12523f908 Simplify VE inspector code by extending new MWLiveExtensionInspector
All live preview logic has been moved to ve.ui.MWLiveExtensionInspector so
so this can be simplified down to just static configuration.

Depends on I708c4cb012be in VE-MW.

Change-Id: I24b4788e97411eec18161709ca5d47c87d3f64da
2014-04-17 17:55:37 -07:00
Trevor Parscal bd8aca6e5d Update for 126166 in VE Core
Change-Id: Ie5d4dbbc8ae301017f8ae047fb492368b965f980
2014-04-15 16:22:03 -07:00
Ed Sanders 3032c22480 Update VE implementation to use model-only inpsectors
As we can't access the view node we have to use stagin transactions
to apply changes to the real document node.

In all cases we can now bypass the parent teardown method as the
model has already been updated.

Depends on If1250402f266 being pulled through to the VE extension.

Bug: 63785
Change-Id: Ic42db8531a5119e8454fb26c80565cef656d3a80
2014-04-14 18:52:09 -07:00
Trevor Parscal 01f3f8ee67 Update tool to use a command
Bug: 63541
Change-Id: Iaeaf183dc2d906364d1dc69270bcf06c24ba833a
2014-04-09 22:56:42 +00:00
Moritz Schubotz (Physikerwelt) 58f913ecb0 $wgMathValidModes and orthogonal MathJax enabler
To adjust the selectable math rendering modes in user preferences $wgMathValidModes
is introduced.

* $wgUseLaTeXML becomes unnecessary use $wgMathValidModes[] = MW_MATH_LATEXML;
  to enable the LaTeXML rendering mode
* add $wgMathValidModes[] = MW_MATH_MATHJAX; to enable MathJax

Currently, MathJax is bound to the MW_MATH_SOURCE rendering mode.
This change makes the base mode user configurable.
That means before MathJax is loaded the png fallback image could
be displayed.

ATTENTION: This change modifies global variables as follows:
* MW_MATH_MATHJAX is deprecated.

Bug: 57981
Change-Id: Ibf705cb66754d04e4c7eafd1e98608b25d7dbb94
2014-04-08 15:29:42 +00:00
Derk-Jan Hartman ec4b89854d Fix trailing commas in MathJax wiki2jax
This breaks MathJax in IE7

Change-Id: I998cb98e688ef3e075d9d08012331f5e55e30b83
2014-04-08 17:25:55 +02:00
jenkins-bot c782b62261 Merge "Add dependency for math edit button" 2014-04-07 21:26:50 +00:00
Derk-Jan Hartman 13df3c9b0c MathJax: Listen for wikipage.content hook
This brings us one step closer to solving the JS rendering bug. The
remaining issue is how to know that the enabler script needs to be
loaded.

Bug: 36060
Change-Id: I9cbd032afaf90a735c92f055c2bf82766e9acbe0
2014-04-07 18:04:02 +02:00
Derk-Jan Hartman 23f94d5b6a Add dependency for math edit button
Declare that ext.math.editbutton.enabler depends on
mediawiki.action.edit.

Follow up to: I3d126c1c252c27fa65ab8fb42ffab66a2d99cfa8
Bug: 60471
Change-Id: Ibcda91bbb164b0b896d4c3f5f7c2c6ea6658468e
2014-04-07 13:15:02 +00:00
Derk-Jan Hartman e1343c3f87 Fix globals in strict mode
I didn't really intend to make this strict yet, but since I did,
better make it work

Follow up to: I679246089ec485678088ff08f3a46d8b74a262c5
Change-Id: Ic6180b3188d46ce92e0547b0fbb6c333906c49f6
2014-04-07 12:31:34 +02:00
jenkins-bot ea48a4442f Merge "Editbutton for math" 2014-04-07 09:33:56 +00:00
Moritz Schubotz 9f7a1e51c4 Editbutton for math
Move the code that creates the Editbutton for math from core,
where it is removed in Ib17aa47c7d647e1ed293541adbdd1aa77e25e59e.

Imported button image from:
ssh://gerrit.wikimedia.org:29418/mediawiki/core.git/skins/common/button_math.png

We don't need to vary the icon per language, because there is not a
single language that has a non default icon.

Bug: 60471
Change-Id: I3d126c1c252c27fa65ab8fb42ffab66a2d99cfa8
2014-04-07 09:26:16 +00:00
Derk-Jan Hartman 28efa34ffd Convert MathJax enabler script to tabs
Per our coding conventions:
https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript

Change-Id: I679246089ec485678088ff08f3a46d8b74a262c5
2014-04-07 11:05:08 +02:00
Moritz Schubotz (Physikerwelt) c5b0b15d8f Fix MathJax centers equations
* Removes the MathJax heuristics that decides
  if equations are centered or left-aligned.
* Introduces the attribute display to specify
  if the math element is rendered in inline,
  display, or inline-displaystyle.
* add css rules for display / inline math images

Bug: 61051
Change-Id: Iba69903f781f0cb1606b8ddcffb90fb86c9b229b
2014-04-06 21:58:30 +00:00
Derk-Jan Hartman eda0726fd4 Reset the fontstack of mathjax back to defaults
I suspect we retained this of the import of Nageh's option, it was
never really a conscious decision. This makes is to so that locally
installed fonts are preferred over the Tex webfont.

Bug: 63016
Change-Id: I6876f4969314b2feea01ecfef29f98dcd5f1056a
2014-04-05 11:52:34 +02:00
Ed Sanders 31df8ff3a8 Emit rerender on math node if Tex image is not present
This happens with then empty tag is rendered.

Bug: 63093
Change-Id: I5cf731cedda134d2542946da82997bddf58b00b5
2014-03-31 16:07:59 -07:00
Roan Kattouw 91ac23377f Make VE math inspector title not be null
Forgot to update this for the deferMsg refactor.

Bug: 63083
Change-Id: Ib401c36d656344b74f2358e3e32870186e54e351
2014-03-25 11:35:22 -07:00
Roan Kattouw e7be4f5ba7 Minor fixes for VE Math code
* Update MWMathInspectorTool for deferMsg refactor
* Update ce.MWMathNode to add primaryCommandName

Change-Id: I344e3ef498c504d07b1f42954ab44b82ed3c0a50
2014-03-19 19:31:41 -07:00
Roan Kattouw fcf045f832 Add VisualEditor support
Moved from the VisualEditor extension, where it was removed in Iab0c56246626de1e0f

Change-Id: I8e582ee6deadc2750d30b49f0c6de31ed9c16a50
2014-03-20 01:29:25 +00:00
Davide P. Cervone 01ca982894 Push math nodes onto mathArray individually to avoid problem in IE < 9 where push.apply doesn't work on a nodeList. Also, avoid duplicate elements in the array by checking for namespace prefixes. This needs to work for both HTML and XHTML. Resolves issue #672.
Signed-off-by: physikerwelt <wiki@physikerwelt.de>

Change-Id: I0e2071aebee4e524960b01c4a5a10e49b5520846
(cherry picked from commit d463f88c18)
2014-02-17 03:29:45 +00:00
Frédéric Wang 2c3e4a4b5d Update to MathJax 2.3
* Uses the MediaWiki resource modules to load MathJax

Change-Id: I9471b1baf41d2bcc4fdc64a26e7d806e92b9b17f
2014-01-27 21:36:02 +00:00
Brad Jorsch 2b8534793f MathJax must not process every <strong class="error">
Many things in MediaWiki (and various on-wiki templates, at least on
enwiki) output error messages wrapped in <strong class="error">. MathJax
parsing all of these (added in I1199cb34) is completely broken.

What appears to have been intended is that MathJax would parse the
errors output by MathRenderer.php. So let's add a "texerror" class to
those and have MathJax look for that class instead.

Bug: 55675
Change-Id: Iaa6c3a892af463f38e6706f9407c6dcb948fe670
2014-01-15 12:05:55 -05:00
Moritz Schubotz 12a45cff1b Adding mathoid as tex to MathML and SVG renderer
Uses nodejs to call phantomjs that renders the
tex input using MathJax and returns a json object
that includes both the SVG and the MathML
representation.

The project was forked from
https://github.com/agrbin/svgtex.

Co-Authored-By: Gabriel Wicke <gwicke@wikimedia.org>
Co-Authored-By: Moritz Schubotz <wiki@physikerwelt.de>
Change-Id: Ie5f24006c3aacd8f61f48ca275acd63a418d7529
2013-10-04 17:03:34 -07:00
Frédéric Wang bfc9ce8e7b Improvements to prepare a MathJax+PNG option
- Remove MathMathJax.php, which uses exactly the same output as MathSource.php.
- Make wiki2jax able to handle texvc output as a preview before MathJax rendering.

Change-Id: I1199cb34d555d2a1e57da98857f41a22cfe81df4
2013-09-10 18:38:10 +02:00
Matthew Flaschen f420e06763 Set menuSettings.locale
That one is necessary, and MathJax.Localization.locale will copy it automatically.

Bug: 35038
Change-Id: I4e21cc5cdcb0d7a31a97b3b136d725f67a53f75c
2013-06-04 21:42:36 +00:00
Derk-Jan Hartman 296bc66540 MathJax Localization: Remove language menu
This way the cookie is never set and MathJax simply always follows
the MediaWiki language.

Follow up of Ibf43a3e44ea2bfdbd9fddc01c71c72ba097ff1b7
Bug: 35038

Change-Id: Ie7530d3a904fb39945ba8b8d261852c2b8cb666b
2013-06-04 22:47:48 +02:00
Derk-Jan Hartman df9cfe846b MathJax: Support localizations of MathJax
Adding the localizations which I missed when updating to 2.2 in
I9446121985ae27e65a429b5a558940ac30520d44
Forward the userlanguage from MediaWiki to MathJax
Note that MathJax preserves selected language in cookies, so once set,
you need to manually switch it every single time.

Bug: 35038
Change-Id: Ibf43a3e44ea2bfdbd9fddc01c71c72ba097ff1b7
2013-06-04 20:25:55 +00:00
Nageh 9f29f48506 MathJax: Use \mathbf instead \boldsymbol for the \bold command
\boldsymbol actually resulted in bold italic formatting, which was not
consistent with the texvc renderer. Use \mathbf (Bold face) instead.

Change-Id: I1a6fb07c55a2089c7acf50059a3a4a4e196812f1
2013-05-24 20:09:08 +00:00
jenkins-bot b05d44c0dc Merge "Math: Add texvc alias \image to MathJax" 2013-05-24 20:07:58 +00:00
jenkins-bot 41673ba3e5 Merge "Math: Add \Q, \H and \AA texvc commands to MathJax" 2013-05-24 20:06:17 +00:00
jenkins-bot b88647fae9 Merge "MathJax: Improve font style inheritence" 2013-05-24 07:58:54 +00:00
Derk-Jan Hartman 6b58a5143d Math: Add texvc alias \image to MathJax
Bug: 35186
Change-Id: If2fb219a1191caeecb0ed04bf0c0105621725dce
2013-05-19 20:12:52 +02:00
Derk-Jan Hartman 56be566d93 Math: Add \Q, \H and \AA texvc commands to MathJax
\Q and \H doublestruck versions of Q and H
\AA used for Angstrom symbol

Bug: 35186
Change-Id: I20ac8af2253835c20431585d9caebe4066606879
2013-05-19 20:05:34 +02:00
Derk-Jan Hartman 0967b6b364 Math: Upgrade MathJax to v2.2
Change-Id: I9446121985ae27e65a429b5a558940ac30520d44
2013-05-19 17:10:27 +02:00
Nageh d9a2017e45 MathJax: Support the texvc command \vline
Bug: 35186
Change-Id: If38014bde908bb202dc63213fa21a72b52a6a42d
2013-05-04 07:23:58 +00:00
Nageh b0e074169e MathJax: Improve font style inheritence
This makes HTML rendered mtext inherit its font properties.

Change-Id: I744750ff3d667006e725c04b88d83a3b259d4de5
2013-05-01 23:31:42 +00:00
Derk-Jan Hartman 83b4107df4 MathJax: Remove our RGB extension again, added in MathJax 2.1
Turns out that with the upgrade to 2.1 this is now included in core
MathJax, so we don't need the extension anymore.
http://docs.mathjax.org/en/latest/whats-new-2.1.html

Change-Id: I653c05aaf6d94851fdf6b1649d2d5c7477d46b7e
2013-04-29 00:15:25 +02:00
jenkins-bot 4aa2741e8f Merge "MathJax: Ignore pagecolor command" 2013-04-28 21:52:16 +00:00
nageh 99a23e4af0 Add support to MathJax for RGB colors
PS2: Make the number matcher limited to 3 digits. Fix at base 10.

Originally, but had broken merge: Iff04d5d650ae87d957d57420f71975ccdf4a5370

Change-Id: I6885ea90e920734e324b6d1d1f70af69cdeab033
2013-04-28 14:37:46 +02:00
jenkins-bot 318f6777f5 Merge "MathJax: Update to version 2.1" 2013-04-28 12:19:03 +00:00
Nageh 5f349cc9da MathJax: Ignore pagecolor command
This command was not yet supported. This implements it as a noop.
In MathJax it's not really useful to be able to define the background
color as sometimes is required in rendered png mode.

Bug 35186

Change-Id: If6573901bafd8599a01979bcbff89e52b51e4ffd
2013-04-28 14:12:12 +02:00
Derk-Jan Hartman 6a519421c4 Bug 41677: Protect against tex nodes wrapped in tex nodes.
This gracefully handles: <span class="tex"><span class="tex"
dir="ltr">$ x^2 $</span></span>, generated when you put math tags
inside element attributes.

Change-Id: I997fc5e87b320879c99f7560fb023876ab6ef573
2013-04-28 11:54:20 +02:00
Derk-Jan Hartman ba87a7cc96 MathJax: Update to version 2.1
http://docs.mathjax.org/en/latest/whats-new-2.1.html

Change-Id: I11123c5ee311369dd4d990417de5a9664d1cd717
2013-04-28 11:21:07 +02:00
Derk-Jan Hartman d1035123e1 MathJax: Remove support for wikEd and AjaxPreview
With the new renderTex hook of https://gerrit.wikimedia.org/r/61183
there is no need for hardcoded support for these 2 scripts. The
scripts in question should call the hook themselves.

PS2: Fix wikEd reference of jsHint
Supersedes: https://gerrit.wikimedia.org/r/23073

Bug: 35478
Change-Id: I9811832430e9ddd8a4c03f265d07529a76efc38a
2013-04-27 19:22:20 +00:00
Derk-Jan Hartman 6d99438a7c MathJax: Add a renderTex hook to render elements on demand
Example usage: $('#wikiPreview').renderTex();

This supersedes: https://gerrit.wikimedia.org/r/23073
Bug: 35478

Change-Id: I18e2f089d56e42b8e603ac45d726942bb478580b
2013-04-27 19:20:39 +00:00
jenkins-bot 691d1b3186 Merge "(bug 35188) Do not poison the tex formula with markup" 2013-04-27 19:19:47 +00:00
jenkins-bot 0313f73814 Merge "MathJax: Allow user to configure MathJax" 2013-04-27 19:11:47 +00:00
nageh b08fbbbe38 (bug 35188) Do not poison the tex formula with markup
We move the block/inline styling (aka display vs textstyle) markup into
a filter used just before rendering. This way the 'used' formula will
not suddenly contain styling information that wasn't part of the
original formula.

Change-Id: Ie0c308c31d38581e556dc73109879c7a3d365121
2013-04-27 14:41:32 +00:00
Derk-Jan Hartman 32acbe3f47 MathJax: Allow user to configure MathJax
The user can provide his own mathJax.config object.

Supersedes: https://gerrit.wikimedia.org/r/61182
PS2: Add relevant info for this feature to README

Bug: 35478
Change-Id: I97800317366aafcaad87ecf6644e9417c698c5da
2013-04-27 16:27:15 +02:00
jenkins-bot 8afccbe888 Merge "(bug 36855) escape literal % in tex input" 2013-04-27 14:10:31 +00:00
jenkins-bot da02740c14 Merge "(bug 35556) Allow MathJax to report errors." 2013-04-27 14:07:19 +00:00
Timo Tijhof c14159404f JSHint: Equality, unused arguments and other minor remnants.
After this jshint passes.

Change-Id: Iee640a1d485ac23caaa783b0069ce9f1616db9ad
2013-02-06 20:20:14 -08:00
Timo Tijhof 282960c4ba JSHint: Fix var statement and global scope issues.
Change-Id: Ia567d10b72f86963eb344cd5579738532531d3d9
2013-02-06 20:14:02 -08:00
Timo Tijhof 8a29221a83 JSHint: Fix curly braces.
Change-Id: Ib59ab38b2c3d9270d882798242e796b823206a50
2013-02-06 20:08:22 -08:00
Antoine Musso ca6a896cb0 JSHint: Fix quotmark and semicolon warnings.
Change-Id: I2ab9e7ce308fd47336f86d2571e8450347321f10
2013-02-06 20:02:47 -08:00
Derk-Jan Hartman 7e58acc95a (bug 36855) escape literal % in tex input
This removes support for MathML % comments, just as with texvc

PS2: Fix for regex lookbehind issue

Change-Id: I0cb026d749733ed3dbba8faacb163be4438fc6bb
2012-11-01 16:22:59 +01:00
Derk-Jan Hartman 25cce43f9f (bug 35556) Allow MathJax to report errors.
Change-Id: Ibed05d3a4a28f7f99bc379f765d633256a8ddc12
2012-09-07 15:40:44 +02:00
Siebrand Mazeland 7b2b7301e0 Maintenance for Math extension.
* Replace deprecated wfMsg* calls with alternatives.
* Add FIXME for occurrence I don't know how to replace.
* Update some docs.
* Sprinkle a few semi-colons over the JavaScript.

Change-Id: I755a95f8bba48a23ef8c432e232adfaef4caae70
2012-08-31 01:25:48 +02:00
Brion Vibber 6e110abf85 Disable dangerous \href and \style commands
MathJax's TeX input by default includes \href and \style commands, which can be
used to inject JavaScript and web bugs. Disabling them by overriding them with
named function macros.

Change-Id: Id21253e9d1621b5ec4e93e28361c498c484b1b7b
2012-04-18 11:14:26 -07:00
Brion VIBBER f1a0b5c254 Merge "Remove textcolor macro. It was just a hack to make the colors work." 2012-03-26 22:42:38 +00:00
Derk-Jan Hartman f0c2308047 "\displaystyle" does not need curly braces as it does not take a parameter.
Thanks to User:Nageh for providing feedback:
https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Mathematics/Archive/2012/Mar#mathJax_progress

Change-Id: I52781773c7146f87a839720867a49f1dd6d74483
2012-03-27 00:39:55 +02:00
Derk-Jan Hartman 2205264ada Remove textcolor macro. It was just a hack to make the colors work.
Change-Id: Ifbb05f3750075cbb4104bba5d1ef865fee8857e5
2012-03-27 00:22:22 +02:00
Brion VIBBER 7756451286 Merge "Adding arccot, arcsec and arccsc for bug 35186." 2012-03-26 22:00:12 +00:00
Derk-Jan Hartman ef921fc4ef Load the TeX extension cancel, because it is supported by texvc and in use on wiki. Fixes part of Bug 35186
Change-Id: Icfb2894e4f755ae364a29bcace3e1d14b52c9e87
2012-03-26 23:36:14 +02:00
Derk-Jan Hartman 5013c60be1 Adding arccot, arcsec and arccsc for bug 35186.
This says to treat these commands as Named functions, just as arcsin, arctan etc.

Change-Id: Ib11d9cb99f4ced0a063fd0913b9cacf544049f36
2012-03-26 23:21:33 +02:00
Derk-Jan Hartman e592db16e7 Adding the tex colors to our texvc configuration, Fixes the lacking colors as pointed out in bug 35186.
We can remove the pre mathjax 2.0 color hack now that the color extensions is enabled.

Change-Id: I7863e3131689b2140e31cd09a3d663113f686b83
2012-03-26 00:09:56 +02:00
Brion Vibber b572b021b9 followup r113661 - fix for renamed func 2012-03-12 20:59:32 +00:00
Brion Vibber 7335093337 use pre-minified MathJax files, they load faster 2012-03-12 20:54:04 +00:00
Brion Vibber c89a0003f1 tweaks to MathJax setup & customizations from mathjax-users list
Some fixes, cleanup, and modernization
2012-03-12 20:41:43 +00:00
Brion Vibber 87cbb1f4c8 MathJax loading fixes from mathjax-users list:
* fix for $ stripping in IE
* wrap everything in {} for \displaystyle
2012-03-07 19:33:08 +00:00
Brion Vibber b93e71e0ae fix for MathJax zoom setting: should be 'Click' not 'click'
[per feedback on mathjax-users list]
2012-03-07 00:06:40 +00:00
Brion Vibber 261310bad9 Tweak MathJax loading per recommendations from mathjax-users list:
* drop some of the init lines that don't appear to work/be needed
* only load MathJax.js through ResourceLoader; let MathJax's loader handle the rest

This gets us working in Chrome, where previously we hadn't initialized correctly. Should also help in IE, still needs testing.
Will probably want to swap in the pre-minimized versions of the files at some point, but the expanded ones are fine at this stage of work.
2012-03-06 21:57:12 +00:00
Brion Vibber 2be6ad801a Avoid conflict between MathJax's TeX finder and our own: remove theirs so we don't end up putting preview markup inside other markup 2012-03-05 22:45:56 +00:00
Brion Vibber e85a658c2f switch two files in MathJax setup that were incorrectly split to the wrong filenames :) 2012-03-05 22:24:54 +00:00
Brion Vibber a4c39f94a6 remove stub file -- unneeded as it's been expanded into other files 2012-03-05 19:51:17 +00:00
Brion Vibber d84a00a9ed * (bug 34828) Fix MathJax initializer to operate on images as well as text form
Warning: this piggybacks on 'alt' text and can be broken if a manual alt text was specified on a <math> bit. Needs to be more nativey.
Also cleaned up the conditional setup code since we're already only called when a <math> is present.
2012-03-02 00:26:56 +00:00
Brion Vibber 296b767c62 uncomment a couple bits in mathjax setup that had been disabled while fiddling 2012-03-02 00:07:32 +00:00
Brion Vibber f8ad1f3e86 Fix for font path on MathJax 2.0 2012-03-01 02:00:16 +00:00
Brion Vibber 83a8af23f8 MathJax 2.0 update mostly works! 2012-03-01 01:57:44 +00:00
Brion Vibber f5df298230 Straight update of MathJax to 2.0 -- doesn't currently load correctly if experimental $wgMathUseMathJax is enabled, be warned!
Using the unpacked files; minus the PNG fonts.
2012-03-01 01:21:20 +00:00
Tim Starling 74d5aa19f8 * (bug 34538) Fixed compatibility with $wgResourceLoaderExperimentalAsyncLoading in some extensions.
* Tested AbuseFilter.
* Did not test ArticleCreationWorkflow, Configure, ContributionTracking, FlaggedRevs, FundraiserPortal, InlineCategorizer, MarkAsHelpful, Math/Mathjax.
* Fixed a typo in a comment in LiveTranslate.
* Did not review extensions alphabetically after MoodBar.
2012-02-21 04:03:00 +00:00
Brion Vibber f0f9ec9b9f Drop a trailing ',' in an array def; causes errors in IE 6 and IE 7 2011-12-08 23:00:10 +00:00
Brion Vibber a36b0e04d8 Initial experimental import of MathJax source into Math extension as a client-side rendering supplement to the PNG rendering.
* Pulled in MathJax 1.1 (minus the 112 megabytes of PNG "fonts")
* Pulled in some of <https://en.wikipedia.org/wiki/User:Nageh/mathJax> bits for initialization

This doesn't currently override PNG images, but does replace the text-form if you configure it.
2011-12-06 01:17:35 +00:00