https://bugzilla.wikimedia.org/show_bug.cgi?id=35478

--- Comment #3 from Michael M. <[email protected]> 2012-03-28 09:22:57 UTC 
---
Created attachment 10339
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=10339
Proposed code for ext.math.mathjax.enabler.js

The proposed code (easier to read than a diff) does the following:

* apply coding conventions
* remove global variable mathJax (not to be mixed up with MathJax), moved this
to mediaWiki.mathJax
* remove special code for WikEd and AjaxPreview, this did only work when
ext.math.mathjax.enabler.js was loaded in edit mode, which only happened when
showing a preview with math.
* introduce a jQuery method to render all TeX inside a jQuery collection, it
hooks into the MathJax system, so will work no matter when you call it.

It can be used as $content.renderTeX( function () { alert('Done!'); } );
I don't think that the Math extension should implement it's own hook system,
but wait for bug 23580. Gadgets can use code like

mw.loader.using( 'ext.math.mathjax.enabler', function () {
 $newContent.renderTeX();
} );

to load the code (if this didn't already happen) and render the formulas in the
new content.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to