Bump. I've been messing with jQuery some more using the updated version that comes with Mediawiki. Here are a couple useful tips:
http://www.mediawiki.org/wiki/Manual:Collapsible_elementsAs of Mediawiki 1.18, using jQuery for collapsing elements is now supported natively. Just add the class 'mw-collapsible' and 'mw-collapsed' to a table or div and it just works. This allowed me to get rid of 4 separate javascript functions in my Common.js. The jQuery features a little animation when expanding/collapsing things. You can customize it a little bit, but it mainly is for hiding navigation bars that are so widely used. Here it is in action:
http://dragon-quest.org/wiki/Category:Navigation_templates/Sandbox.
I also made use of this feature to redo our spoiler template, which is used to hide spoiler information. Check it out in use here:
http://dragon-quest.org/wiki/Dragon_Quest_V#Characters.
Finally, our wiki was dealing with a race condition with jQuery libraries being loaded for Common.js. I am using jquery.ui.tabs and jquery.ui.accordion to format things. Sometimes the libraries would get loaded and look fine, other times they would not get loaded in time and the pages looked bad. I think I have fixed it now by forcing mediawiki to load them as dependencies.
jQuery( document ).ready( function( $ ) {
mw.loader.using( 'jquery.ui.tabs', function() {createJQueryTabs();} );
mw.loader.using( 'jquery.ui.accordion', function() {accordionVideos();} );
} );
So at the end of page loading, the resource loader ensures that each library is loaded before calling the functions which then go and create the tab/accordion formattings on the page. I need to do some testing in different browsers still.
The only bad news I found is that the resource loader by default does not load any extra modules when using the MobileFrontend extension (aka mobile browser formatting). That means that any special formattings won't happen and the pages will likely look bad. Not sure if I will do anything to deal with that at this point or not.