mediawiki-userfunctions
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Gadget UserFunctions

Provides functions similar to Extension:UserFunctions based on JavaScript.

Basic usage

* <span class="user-functions" data-username></span>
* <span class="user-functions" data-if-logged-in="{true | false}"></span>
* <span class="user-functions" data-if-username="{string | string[]}"></span>
* <span class="user-functions" data-if-usergroup="{string | string[]}"></span>

Data types

boolean

  • false: false no 0 will give false
  • true: any other value will give true

examples

<!-- true -->
<span class="user-functions" data-if-logged-in>logged in</span>
<span class="user-functions" data-if-logged-in="">logged in</span>
<span class="user-functions" data-if-logged-in="whatever">logged in</span>
<!-- false -->
<span class="user-functions" data-if-logged-in="false">logged in</span>
<span class="user-functions" data-if-logged-in="no">logged in</span>
<span class="user-functions" data-if-logged-in="0">logged in</span>

string[]

  • String will be split by |.
  • String starts with ! means false

example: foo|!bar{foo: true, bar: false}

Package Sidebar

Install

npm i mediawiki-userfunctions

Weekly Downloads

9

Version

2.0.1

License

MIT

Unpacked Size

12.9 kB

Total Files

5

Last publish

Collaborators

  • dragon-fish