Jump to content

Extension:FloatingUI: Difference between revisions

From mediawiki.org
Content deleted Content added
Add composer and mark as beta
Marked this version for translation
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
{{Extension
{{Extension
|image =
|image =
|description = implements the FloatingUI Javascript library
|description = <translate><!--T:1--> Provides the <tvar name=1>FloatingUI</tvar> JavaScript library</translate>
|license = GPL-3.0-or-later
|license = GPL-3.0-or-later
|update = Continuous updates
|update = Continuous updates
|compatibility policy = master
|compatibility policy = master
|status = beta
|status = stable
|type = parser function
|type = parser function
|author = [[User:alistair3149|alistair3149]]
|author = [[User:alistair3149|alistair3149]]
|mediawiki = 1.39+
|mediawiki = 1.43+
|composer=starcitizentools/floating-ui|download = {{GithubDownload|StarCitizenTools|mediawiki-extensions-FloatingUI}}
|composer=starcitizentools/floating-ui|download = {{GithubDownload|StarCitizenTools|mediawiki-extensions-FloatingUI}}
|hook1 = ParserFirstCallInit
|hook1 = ParserFirstCallInit
}}
}}
<translate>
<!--T:2-->
The <tvar name=1>'''FloatingUI'''</tvar> extension provides the <tvar name=2>[https://floating-ui.com/ FloatingUI]</tvar> JavaScript library to MediaWiki.


==Installation== <!--T:3-->
The '''FloatingUI''' extension implements the [https://floating-ui.com/ FloatingUI] Javascript library.
</translate>


==Installation==
{{ExtensionInstall
{{ExtensionInstall
|registration=required
|registration=required
|download-link=[https://github.com/StarCitizenTools/mediawiki-extensions-FloatingUI/archive/main.zip Download]
|download-link=[https://github.com/StarCitizenTools/mediawiki-extensions-FloatingUI/archive/main.zip <translate><!--T:4--> Download</translate>]
}}
}}


<translate>
== Usage ==
== Usage == <!--T:5-->
This extension is in an early stage of development.

===Parser function=== <!--T:6-->
</translate>
<syntaxhighlight lang="Wikitext">
{{#floatingui:reference|content}}
</syntaxhighlight>

<translate>
=== Loading library === <!--T:7-->
</translate>
<translate><!--T:8--> There are several ways to load the library on a given page.</translate>
<translate><!--T:9--> Once the library is loaded, it can be accessed through <tvar name=1><code>window.FloatingUIDOM</code></tvar> in JavaScript.</translate>

<translate><!--T:10--> To attach the library to a wiki page, put the following wikitext onto the page:</translate>

<syntaxhighlight lang="Wikitext">
{{#floatingui:}}
</syntaxhighlight>

<translate><!--T:11--> Alternatively, you can load the ResourceLoader module in JavaScript:</translate>


<syntaxhighlight lang="JavaScript">
=== Loading library ===
mw.loader.load( 'ext.floatingUI.lib' );
There are several ways to load the library on a given page. Once the library is loaded, it can be accessed through <code>window.FloatingUIDOM</code> in Javascript.
</syntaxhighlight>


<translate>
To attach the library to a wikipage, put the following wikitext onto the page:
=== Defining elements === <!--T:12-->
<syntaxhighlight lang="JavaScript">{{#floatingui:}}</syntaxhighlight>
</translate>
Or alternatively, you can load the ResourceLoader module in Javascript:
# <translate><!--T:13--> Reference element has to have the HTML class <tvar name=1><code>ext-floatingui-reference</code></tvar>.</translate>
<syntaxhighlight lang="Wikitext">mw.loader.load( 'ext.floatingUI.lib' );</syntaxhighlight>
# <translate><!--T:14--> Floating element has to have the HTML class <tvar name=1><code>ext-floatingui-content</code></tvar> and place next to the reference element.</translate>


<translate>
=== Defining elements ===
== See also == <!--T:15-->
</translate>


{{Used by}}
# Reference element has to have the HTML class <code>ext-floatingui-reference</code>.
# Floating element has to have the HTML class <code>ext-floatingui-content</code> and place next to the reference element.

Latest revision as of 23:40, 6 June 2026

MediaWiki extensions manual
FloatingUI
Release status: stable
Implementation Parser function
Description Provides the FloatingUI JavaScript library
Author(s) alistair3149
Latest version 1.0.5 (Continuous updates)
Compatibility policy Master maintains backward compatibility.
MediaWiki 1.43+
Composer starcitizentools/floating-ui
Licence GNU General Public License 3.0 or later
Download

The FloatingUI extension provides the FloatingUI JavaScript library to MediaWiki.

Installation

[edit | edit source]
  • Download and place the file(s) in a directory called FloatingUI in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'FloatingUI' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

[edit | edit source]

Parser function

[edit | edit source]
{{#floatingui:reference|content}}

Loading library

[edit | edit source]

There are several ways to load the library on a given page. Once the library is loaded, it can be accessed through window.FloatingUIDOM in JavaScript.

To attach the library to a wiki page, put the following wikitext onto the page:

{{#floatingui:}}

Alternatively, you can load the ResourceLoader module in JavaScript:

mw.loader.load( 'ext.floatingUI.lib' );

Defining elements

[edit | edit source]
  1. Reference element has to have the HTML class ext-floatingui-reference.
  2. Floating element has to have the HTML class ext-floatingui-content and place next to the reference element.

See also

[edit | edit source]