Jump to content

Rozšíření:JavaScriptSlideshow

From mediawiki.org
This page is a translated version of the page Extension:JavascriptSlideshow and the translation is 100% complete.
Příručka k rozšířením MediaWiki
JavascriptSlideshow
Stav rozšíření: stabilní
Zavádění Značka , Funkce analyzátoru
Popis Umožňuje vytvořit prezentaci (pomocí JavaScriptu) z více zahrnutých prvků div
Autoři
Správci Miraheze, Brent Laabs
Nejnovější verze 2.2.0 (2025-03-22)
MediaWiki 1.43+
PHP 8.1+
Změny v databázi Ne
‎<slideshow>
Licence GNU General Public License 3.0 nebo novější
Stáhnout
Přeložte rozšíření JavascriptSlideshow, používá-li lokalizaci z translatewiki.net

The JavaScriptSlideshow extension creates a slideshow that can:

  • Vytvořte "rotující" prezentaci (tj. takovou, která se mění z jednoho obrázku na druhý)
  • Vytvořte animaci stop-action z více obrázků nebo více kusů textu

Instalace

  • Stáhněte soubor/y a vložte je do adresáře pojmenovaného JavascriptSlideshow ve vaší složce extensions/.
    Vývojáři a přispěvatelé kódu by si místo toho měli nainstalovat rozšíření from Git pomocí:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/JavascriptSlideshow
    
  • Na konec vašeho souboru LocalSettings.php přidejte následující kód:
    wfLoadExtension( 'JavascriptSlideshow' );
    
  • Yes Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.

Možnosti / atributy

Name Description Default
id ID, které bude přiřazeno prvku div obsahujícímu obsah. To vám umožňuje předem zadat ID pro účely stylingu. 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. 1000 milliseconds (one second)
sequence The sequence in which the content is displayed. It must be one of the following values:
  • forward
  • backward
  • random
forward
transition How to transition (change) between content. It must be one of the following values:
  • cut: A straight cut from the current content to the new content.
  • fade: A one-second fade between the current and new content.
  • blindDown: The new content "rolls down" over the existing content.
cut
transitiontime The time, in milliseconds, that transitions take to complete. Increase it to make transitions slower. 400
center If 'true', center the slideshow (it only works for slideshows of images, not text).

Příklady

Značka

<slideshow sequence="random" transition="fade" refresh="1000">
<div>[[File:Tabby cat with blue eyes-3336579.jpg|thumb|300px|Cat with blue eyes.]]</div>
<div>[[File:Cat cute persian cat.jpg|300px|A cat.]]</div>
<div>This slide has no image.

It can have multiple paragraphs.
</div>
<div>[[File:Cute cat (1698598876).jpg|300px|Another cat.]]</div>
</slideshow>

This results in a div (with a randomly generated ID) that randomly changes every 1 second between the three images specified (which happen to be wiki images) and a slide that has no image (to demonstrate that this is possible).

Funkce parseru

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

Související odkazy