Extension:Livelets

The idea of this extension is to allow live articles that have some complex content in them to be turned into separate request using MediaWiki's ajax functionality. This means the whole page can load quickly and be readable as soon as possible allowing the slower portions to load in their own time afterwards.

Later we'll be adding the ability to make these areas "live" whereby the content in them will stay up to date automatically without the whole page having to be reloaded.

Some of our sites use a livelet in the sidebar to load the main tree which can be very large for some users and would cause the site to be sluggish if it had to load the whole tree for each new page request. Having the large content in a livelet speeds up the site in two ways, firstly the large content only starts loading after the main page is loaded and accessible. And secondly, because the large content is a separate request with its own static URL, it can be cached locally by the browser.

Installation
Create a Livelets folder in your extensions directory. Download the latest snapshot and extract it to your extensions directory. Then include it in your LocalSettings.php file as in the following example.

Most people like to have an animated ajax loader image such as these ones from the Wikimedia commons. The livelet containers render with a div element inside them with an class value of livelet-loader so that you can add some CSS rules such as the following example which renders a small box containing a rotating daisy. You can add this CSS to your MediaWiki:Common.css article.

Usage
To create livelets, simple wrap any areas of wikitext in the #live parser-function. In the following example, a transclusion of the page called Template:MyVerySlowTable has been turned into a livelet:

Current State
Currently the livelet only loads once using Ajax after the page content has loaded and is not dynamically kept up to date.

Live Updates Using SWF
The default installation of Livelets uses Ajax technology which is used by many extensions and by the MediaWiki code itself and is considered safe. The problem with ajax however, is that changes cannot propagate automatically from the server to the clients, the clients must poll the server at a regular interval to see if any changes have taken place. Using SWF technology allows a fully asynchronous connection to be established between the server and the clients making the system fully event driven without any regular polling involved. However this method raises some security concerns as outlined by the XSS alert template above.

The SWF functionality is not complete enough for use yet, but will require the following additional files to be installed into the livelet extension directory:
 * livelets.pl
 * livelets.swf - compiled from livelets.as using the Flashlets extension

Todo

 * ajax polling of header for auto-updating
 * perl/swf for asynchronous update (no polling)

Change log

 * Version 1.0.0: Total rewrite to make current as of MediaWiki version 1.16
 * Version 0.2.6: Missing pagename parameter in AJAX request
 * Version 0.2.5: Removed dependence on Mootools and no longer requires a separate javascript file