Extension:Wiklets

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Wiklets

Release status: unstable

Implementation Parser functions
Description A parser function which allows its content to float in a popup div using Mat Kruse's JavascriptToolbox.
Author(s) User:Nad
Version 0.0.2 (2007-06-28)
MediaWiki >1.6.0
Download OrganicDesign:Extension:Wiklets.php

Note Note: This extension is not complete and not currently under development.

Contents

[edit] Usage (in progress)

The simplest case is to use just one parameter which is the content of the new wiklet as follows:

{{#wiklet: this is the text which will be in my new wiklet}}

But a number of other parameters can be supplied to adjust the behaviour of the wiklet, the following example includes all the possible parameters:

{{#wiklet:title=foo|size=1|move=1|width=100px|height=200px|x=300px|y=100px
|This is the content
}}

[edit] Usage (current)

Currently the extenions uses iFrames rather than div's which are not yet developed. The disadvantage of this is that inline content (that supplied directly in the parser-function) is not displayed. It can only work from the src parameter which is an article title to be loaded by the browser as a separate request after page-load. Here's an example of current usage:

{{#wiklet:src=Main Page|style=width:200px;height:420px;position:absolute;top:50px;left:425px}}

[edit] Javascript

Copy the wiklets source code from OrganicDesign:Extension:Wiklets.php and copy into a file called Wiklets.php your extensions directory (or into a Wiklets subdirectory of extensions if you prefer). The include from your LocalSettings.php file as is usual with MediaWiki extensions.

The Wiklets extension uses the draggable iFrame library from Mat Kruse's JavascriptToolbox to implement the popup-window functionality. Download the dragiframe.js source and save in your extensions directory. The $wgWikletsLoadJS global configuration variable must then be set to the relative URL of the location you saved the Javascript. Your Wiklets inclusion code in your LocalSettings.php file should then look something like the following example,

include("$IP/extensions/Wiklets/Wiklets.php");
$wgWikletsLoadJS = "/wiki/extensions/dragiframe.js";
  • You may need to change the filepaths to suit your own set up
  • Don't forget to ensure that the Javascript file is readable by the webserver using the URL you've specified
  • You may prefer to use Extension:Javascript which adds all the scripts links checking for duplicates

[edit] See also

  • Extension:Livelets - This allows transcluded content in the page or in a wiklet to stay up-to-date automatically when it changes
  • Extension:WikiSkin - when Wiklets and Livelets are ready, this will be used to make a "desktop skin" for the wiki
Personal tools