Extension:JavascriptSlideshow

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
JavascriptSlideshow

Release status: stable

Implementation Tag, Parser function
Description Create a slideshow (using Javascript) from multiple included div elements
Author(s) Chris Reigrut, Yaron Koren, DaSch, Alexia E. Smith, Nick White
Latest version 1.2.3 (2013-05-09)
MediaWiki 1.17+
PHP 5.3+
Database changes No
License GNU General Public License 3.0 or later
Download
README
Example PDF Keynote embedded as Slideshow
Tags
<slideshow>
Hooks used
ParserFirstCallInit

MakeGlobalVariablesScript

Translate the JavascriptSlideshow extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The JavascriptSlideshow extension creates a slideshow which can:

  • Create a "rotating" slideshow (i.e. one that changes from one picture to another)
  • Create stop-action animation from multiple images or multiple pieces of text

Repository[edit | edit source]

Download[edit | edit source]

Download using Git

git clone https://github.com/DaSchTour/JavascriptSlideshow.git

Options / attributes[edit | edit source]

id
The id to be given to the div containing the content. This allows you to pre-specify the id for styling purposes. If none is specified, the id will be a randomly generated number starting with 'slideshow_' (e.g. slideshow_12345).
refresh
The time, in milliseconds, between transitions. The default is 1000 milliseconds (one second).
sequence
The sequence in which to display the content. Must be one of the following values:
  • random: This is the default.
  • forward
  • backward

transition
How to transition (change) between content. Must be one of the following values:
  • cut: A straight cut from the current content to the new content. This is the default.
  • fade: A one-second fade between the current content and the new content.
  • blindDown: The new content "rolls down" over the exising content.
transitiontime
The time, in milliseconds, that transitions take to complete. The default is 400 milliseconds. Increase it to make transitions slower.
center
if 'true', center the slideshow (only works for a slideshow of images, not text).

Examples[edit | edit source]

Tag[edit | edit source]

<slideshow sequence="random" transition="fade" refresh="10000">
<div>[[Image:Image1.jpg|thumb|right|128px|Caption 1]]</div>
<div>[[Image:Image2.jpg|thumb|right|128px|Caption 2]]</div>
<div>[[Image:Image3.jpg|thumb|right|128px|Caption 3]]</div>
</slideshow>

This results in a div (with a randomly generated id) that randomly changed every 10 seconds between the three images specified (which happen to be wiki images).

Parser function[edit | edit source]

{{#slideshow:
<div>Tick</div><div>Tock</div>
|id=bar refresh=1000
}}

would result in a div (with an id of bar) that changed every second between the words Tick and Tock.

Installation[edit | edit source]

  • Download and extract the file(s) in a directory called JavascriptSlideshow in your extensions/ folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/JavascriptSlideshow/JavascriptSlideshow.php";
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Revision history[edit | edit source]

1.2.3 (05/09/2013)
Make it work with PHP 5.2 (for some Mediawiki 1.19 installs) – Download
1.2.2 (03/18/2013)
Add 'center' option, use css to stop initial image flashing and ensure it looks reasonable without javascript – Download
1.2.1 (03/18/2013)
Fix bug ensuring image width is always set correctly – Download
1.2.0 (02/21/2013)
Improve translation and validation – Download
1.1.0 (02/20/2013)
Use HTML5 data attributes to allow multiple slideshows, add transitiontime option, bug fixes – Download
1.0.3 (02/20/2013)
Version that works without HTML5 – Download (IMPORTANT: Only use this version if you can't use HTML5 in your wiki. This version might not work with some version of MediaWiki!)
1.0.2 (02/19/2013)
Small bug fixes – Download
1.0.1 (02/18/2013)
Bug fix for IE6/8 – Download
1.0 (02/14/2013)
Overhauled code and bug fixes for OOP updated code
0.4 (01/29/2013)
Reworked Version, now at github
0.3 (03/25/2012)
Support added for MediaWiki 1.17 and higher, removed for versions of MediaWiki below 1.17; use of Scriptaculous replaced with jQuery. slideshow.php slideshow.js.
0.2.1 (09/15/2008)
More changes to the way that the divs are displayed, and added a spacer div (since the main div is now positioned absolutely in order to deal with IEs CSS failings). slideshow.php slideshow.js.
0.2.0 (09/02/2008)
Modified the way that the embedded divs are displayed to allow more control over styling. slideshow.php slideshow.js.
0.1.0 (07/30/2008)
Initial release, marked beta. slideshow.php slideshow.js.