Fandom Developers Wiki
Advertisement

ThankYou adds a button to the left of the page, in the same area as the button to edit and expand the content area, that displays the page's latest 5 editors and a button to thank them.

Installation

Usage

The script is loaded in all existing pages in the main namespace, and only for logged-in users. It adds a button after the edit and expand buttons located in the left part of the page.

When clicked, it shows a small box that displays up to 5 users that have edited the page most recently, skipping any users that are currently blocked, bots and IPs. After moving the cursor over any of the avatars, it shows a button to send a Thanks to any of them.

It can be configured to not allow using the button on editors that haven't touched the page in more than a given amount of days.

The editors shown for each page try to be cached around 5 minutes. If you edit a page but your user isn't shown there, this might be the reason.

Configuration

Options are fetched from MediaWiki:Custom-ThankYou.json in your wiki. It is cached for a few minutes since it has to be requested every time you visit a page; if you change any options, you might have to wait around 10 minutes.

For personal usage, you can set any options you want to override in your /global.js or /common.js. For example:

window.tyMaxDays = 90;
window.tyMode = 'latest';
window.tyPosition = 0;

importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:ThankYou.js'
    ]
});


Options defined locally in the wiki through MediaWiki:Custom-ThankYou.json take precedence over the settings in your personal JavaScript.

Property Description Data type Default value
maxDays Only allow to thank users that have edited a page in the last X days. Editors from any longer are still displayed, but the button is disabled. Number 30
mode Specify the criteria to select the 5 users shown. There is currently only one mode implemented. latest latest
position At what position to place the button, following CustomTools' API. Number -1

Known issues

  • Avatars sometimes fail to load, and may cause the entire script to not load unless you reload the page.


Text above can be found here (edit)
Advertisement