Extension:SimpleScript

From MediaWiki.org

Jump to: navigation, search

(($parserphase2off$))((%parserphase2off%))

           

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
SimpleScript

Release status: beta

ExtensionSimpleScript.png
Implementation  Parser function
Description
Author(s)  Jean-Lou Dupont
Last Version  1.0.0
MediaWiki  1.11
License No license specified
Download see Installation
See SVN ($Id: SimpleScript.doc.wikitext 691 2007-11-09 20:19:37Z jeanlou.dupont $)

check usage (experimental)

Contents

[edit] Purpose

Provides a simple and controlled way of including javascript <script> tags on a wiki page using sysop defined interwiki links. This capability allows, for example, the inclusion of gadgets e.g. Google Gadgets.

[edit] Usage

For proper operation, this extension requires Extension:ParserPhase2 since the generated HTML markup is usually 'sanitized' by MediaWiki. In order to get around this limitation, ParserPhase2 can be used to invoke the parser function *after* the sanitization process (i.e. tidy) is executed on the wiki page. ((%#sscript| interwiki link | desired uri | [error message to show upon bad interwiki prefix] %))

[edit] Setting InterWiki Links

See InterWikiLinkManager extension for more details.

[edit] Example

Assuming the interwiki link 'gmodule' points to Google Gadget Modules (i.e. the interwiki link prefix would look like http://gmodules.com/ig/ifr?$1):

((%#sscript| gmodule | title=Mareas+en+Bilbao&border=http%3A%2F%2Fgmodules.com%2Fig%2Fimages%2F&synd=open&up_Port=401&up_UTC=0&type=googlegadget&url=http%3A%2F%2Fhorloge.maree.frbateaux.net%2Fgh.xml&output=js&w=320&h=222| wrong interwiki prefix! %)) 

[edit] Security Note

  • It is advisable to use 'cascading protection'
  • When page protection is not relied on to provide protection

and consequently only the last contributor's right acts as protection measure, it is advised to use considerable care when using templates on the same page.

[edit] Google Gadgets

For a list of Google Gadgets and the instructions for embedding those, please see GoogleGadgets.

[edit] Dependancy



[edit] Installation

See the Mediawiki Extension table entry "download" above.[1]

[edit] LocalSettings.php

Extension:ExtensionManager: See footnote[2]

require_once( "$IP/extensions/SimpleScript/SimpleScript.php" );

[edit] PEAR

PEAR is a repository of en:PHP software code.

pear channel-discover mediawiki.googlecode.com/svn
  • Install extension through PEAR:
pear install mediawiki/SimpleScript
  • Add the following to LocalSettings.php[2][3]:
require 'MediaWiki/SimpleScript/SimpleScript.php';
  • Note that the required version of PEAR must be respected. Currently, the minimum version of PEAR usable with this channel is v1.6.2. Perform the following command to upgrade to the latest version of PEAR:
pear upgrade pear

[edit] Upgrades through PEAR

Sometimes, it is necessary to clear PEAR's cache in order to perform upgrades.

pear clear-cache

or use the force method:

pear upgrade --force mediawiki/SimpleScript

[edit] PEAR Web Frontend

For easier remote package management, PEAR Frontend WEB can be installed. Installation notes can be found here. An example of the WEB frontend is available here.

[edit] RSS feed

To keep kept up-to-date with this channel, use the following RSS feed__Rss2.jpg.

[edit] Notes

[edit] Other Extensions From the same author

Consult User Jldupont's page.


  1. The most recent release is always available through the extension's PEAR and SVN repositories. This page is not necessarily up-to-date.
  2. 2.0 2.1 2.2 Extension:ExtensionManager does not require any modification to LocalSettings.php because ExtensionManager includes the extension.
    Note that if PHP code caching is in place (e.g. APC, eAccelerator), then to successfully complete the installation a cache flush might be needed.
  3. Modifications to LocalSettings.php is only necessary if not using Extension:ExtensionManager

[edit] History