Markus - it's great that you're fine with adding jQuery in theory.
I just talked to Michael Dale and Roan Kattouw about this on IRC, two people who know a lot about jQuery in MediaWiki, and here were some conclusions:
- version 1.16 of MediaWiki will indeed include version 1.4.2 of jQuery, i.e. the latest version.
- this version includes a new function: $wgOut->includeJQuery(), which includes MW's jQuery file and makes sure that it doesn't get loaded more than once.
- there's a jQuery script loader tool for MediaWiki, known as JS2, that's currently an extension but at some point will be added into core - it's meant to retrieve only the parts of jQuery UI (and other plugins) that any current page needs, and to avoid loading the same JS twice.
- JS2 looks great, but it's probably too early for SMW to use it - it's probably best to wait until the MW version that directly includes JS2 (whatever version that is) is at least somewhat standard.
- they don't want to include jQuery UI directly in MediaWiki, because using it could interfere with the behavior of JS2.
The approach we came up with for SMW is: include the files for both jQuery and jQuery UI in SMW. Then, when it's needed, check to see if MW includes the file includeJQuery(), and if so call that; otherwise, load SMW's version. In either case, then load SMW's version of JQuery UI, if it's needed. If, in the future, new versions come out for either jQuery or jQuery UI that are incompatible with the other one, and MW or SMW switch to those, start to use version_compare() within SMW in order to guarantee compatibility.
I hope that all makes sense, and sounds reasonable...
On Wed, May 26, 2010 at 1:56 PM, Lane, Ryan <Ryan.Lane@ocean.navo.navy.mil>
> It's true that MediaWiki 1.16 will include jQuery, though itWhy don't we try to get MediaWiki to also include jQuery UI, if we feel it
> hasn't been released yet, and it'll take a while before
> everyone's using it. Plus, given that MediaWiki doesn't
> include jQuery UI, there might be some serious compatibility
> issues there.
would be beneficial?
We should also ask them if they'll include the newer version in 1.16;
> Jeroen, do you (or anyone else) know why MediaWiki isn't
> using the latest version of jQuery?
they've added support for 1.3.2 and 1.4.2 in trunk.
WikiWorks · MediaWiki Consulting · http://wikiworks.com