Extension:JavascriptSlideshow

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
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
Last version 1.2.3 (2013-02-21)
MediaWiki 1.17+
License GPL
Download github
Example PDF Keynote embedded as Slideshow
Check usage and version matrix

JavascriptSlideshow 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

Contents

Repository [edit]

Download [edit]

Git Download (clone)

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

Options / attributes [edit]

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]

Tag [edit]

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

{{#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]

  • Download and extract the files in a directory called "JavascriptSlideshow" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/JavascriptSlideshow/JavascriptSlideshow.php" );
  • Yes check.svg Done – Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Revision history [edit]

1.2.3 (05/09/2013)
Make it work with PHP 5.2 (for some Mediawiki 1.19 installs).
1.2.2 (03/18/2013)
Add 'center' option, use css to stop initial image flashing and ensure it looks reasonable without javascript.
1.2.1 (03/18/2013)
Fix bug ensuring image width is always set correctly.
1.2.0 (02/21/2013)
Improve translation and validation.
1.1.0 (02/20/2013)
Use HTML5 data attributes to allow multiple slideshows, add transitiontime option, bug fixes.
1.0.3 (02/20/2013)
Version that works without HTML5 – Download
1.0.2 (02/19/2013)
Small bug fixes.
1.0.1 (02/18/2013)
Bug fix for IE6/8.
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.

Sites using this extension [edit]