Last modified: 2014-11-17 10:36:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37478, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35478 - Remove support for WikEd and ajaxPreview from ext.math.mathjax.enabler.js
Remove support for WikEd and ajaxPreview from ext.math.mathjax.enabler.js
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
unspecified
All All
: Low normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-26 09:18 UTC by Michael M.
Modified: 2014-11-17 10:36 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Proposed code for ext.math.mathjax.enabler.js (1.76 KB, text/javascript)
2012-03-28 09:22 UTC, Michael M.
Details

Description Michael M. 2012-03-26 09:18:36 UTC
While user scripts on en.wikipedia of course have to be compatible with important gadgets it should be just the other way round for MediaWiki extensions. Since ext.math.mathjax.enabler.js is not loaded in edit mode for most users, it doesn't work anyway. So I suggest just to drop the support for those two gagdets. Once bug 23580 is resolved an apropiate hook should be used, then all gadgets can comfortably work together with MathJax.
Comment 1 Derk-Jan Hartman 2012-03-26 18:07:27 UTC
There should be a hook for preview mode somewhere. Several other scripts use it as well.
Comment 2 Derk-Jan Hartman 2012-03-26 19:47:50 UTC
That would be:
$j( mw ).bind( 'LivePreviewPrepare' , function(){ // start loading });

but only works for livepreview it seems...
Comment 3 Michael M. 2012-03-28 09:22:57 UTC
Created attachment 10339 [details]
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.
Comment 4 Derk-Jan Hartman 2012-09-07 14:18:41 UTC
https://gerrit.wikimedia.org/r/23073
Comment 5 Gerrit Notification Bot 2013-04-27 13:31:05 UTC
Related URL: https://gerrit.wikimedia.org/r/61182 (Gerrit Change I97800317366aafcaad87ecf6644e9417c698c5da)
Comment 6 Gerrit Notification Bot 2013-04-27 13:31:51 UTC
https://gerrit.wikimedia.org/r/23073 (Gerrit Change Ic05659eaca35a939289bf49b17084299319d8c4d) | change ABANDONED [by TheDJ]
Comment 7 Gerrit Notification Bot 2013-04-27 13:54:52 UTC
Related URL: https://gerrit.wikimedia.org/r/61183 (Gerrit Change I18e2f089d56e42b8e603ac45d726942bb478580b)
Comment 8 Gerrit Notification Bot 2013-04-27 14:12:44 UTC
Related URL: https://gerrit.wikimedia.org/r/61184 (Gerrit Change I9811832430e9ddd8a4c03f265d07529a76efc38a)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links