Extension:Livelets

Note: this extension is no longer under active development.

Development may get under way again later, but it's currently on the back-burner

The idea of this extension is to allow live articles to be transcluded which are loaded in a separate request using MediaWiki's ajax functionality. Later the ajax will also allow these embedded articles (which we call livelets) to be kept up to date automatically when they change. It uses parser-functions syntax to make it very similar in usage to normal templates.

Installation
To install this extension, copy Livelets.php and save into your extensions directory or in a subdirectory thereof. The file then needs to be included in your LocalSettings.php file as usual.

Wait Image
You may also like to include a small animation which displays when very large live content is being retrieved so the user knows that something is happening. We use the following "daisy" image on our site, but any image will do. Save it as wait.gif in the livelets directory and ensure that it is accessible by the web server.



Current State & Usage
Currently the livelet only loads once using Ajax after the page content has loaded and is not dynamically kept up to date. It's used in a similar way to transcluding a template as follows:

Uses
The OrganicDesign site uses 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.

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 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