Projet:Scripts et gadgets/Notices/WhatlinkshereDeluxe/en

Projet Fonctions disponibles Notices Discussion projet Signaler un bug Demander une nouvelle fonction
PROJET SCRIPTS ET GADGETS
Centraliser les fonctions JavaScript et CSS pour éviter la dispersion du code.
(fr) (en)[edit]

WhatlinkshereDeluxe is a javascript gadget permitting to count the links to a page with Ajax requests on the mediawiki API and provinding some related functionalities.

Description modifier

Special:Whatlinkshere modifier

The gadget support all options of the special page:

  • namespace choice
  • count of:
    • redirects
    • links
    • inclusions
    • file usage (if the target is a file page)

Page moving or deletion modifier

Action still ongoing modifier

The gadget count all type of links to the target page:

  • redirects
  • links
  • inclusions
  • file usage (if the target is a file page)

Once the action is done modifier

Moving modifier

The gadget lists all double redirects pointing to the page (and talkpage) then, if there is, provide buttons to fix, delete or ask for deletion of these double redirects.

Deletion modifier

The gadget lists all redirects pointing to the page then, if there is, provide buttons to delete these redirects.

Special:Nuke modifier

The gadget count all type of links to the target pages:

  • redirects
  • links
  • inclusions
  • file usage (if the target is a file page)

Categories modifier

The gadget add a link next to the "Pages" and "Media" section titles. This link launch the count all type of links to the pages of the category:

  • redirects
  • links
  • inclusions
  • file usage (if the target is a file page)

Installation modifier

On fr.wikipedia.org modifier

To install this gadget, add to your common.js the following code:

obtenir('WhatlinkshereDeluxe');

On another wiki modifier

The installation on another wiki is possible if the mediawiki version is recent enought.

Several variables could need to be customized.

Create a .js page (gadget or user subpage) and add there the following code, editing what is needed:

window.WhatlinkshereDeluxe_getSiteCustom = function(){

    /* **** Texts depending on the site or its language **** */
 
    // Help page about double redirects
    WhatlinkshereDeluxe_Texts["DoubleRedirects_HelpPage"]        = "Aide:Double redirection";

    // Template to add in the page to request its deletion ($ stuffs are parameters substed by the javascript )
    WhatlinkshereDeluxe_Texts["DoubleRedirectsDeleteTemplate"]   = "{{Suppression Immédiate|raison=$reason|utilisateur=$user}}";

    // Reason of a redirect deletion
    WhatlinkshereDeluxe_Texts["DoubleRedirectsDeleteReason"]     = "Redirection cassée, inutile ou non pertinente";

    // Edit summary when fixing a double redirect ($1 is old pagename, $2 is new pagename)
    WhatlinkshereDeluxe_Texts["DoubleRedirectsFixSummary"]       = "Correction double redirection : [[$1]] → [[$2]]";

    // Edit summary when requesting a deletion ($1 is the request reason)
    WhatlinkshereDeluxe_Texts["DoubleRedirectsAskDeleteSummary"] = "Demande de suppression immédiate ($1)";


    /* **** User groups a user need to be into in order to perform some actions **** */

    // Move a page
    WhatlinkshereDeluxe_MoveGroups = [ "autoconfirmed" ];

    // Delete a page
    WhatlinkshereDeluxe_DeleteGroups = [ "sysop" ];

    // Mass deletion
    WhatlinkshereDeluxe_NukeGroups = [ "sysop" ];


    /* **** Options **** */

    // Preloading of the linked pages to the pages of a category
    WhatlinkshereDeluxe_PreloadOnCategoryPage = false;

}

mw.loader.load("//fr.wikipedia.org/w/index.php?title=Mediawiki:Gadget-WhatlinkshereDeluxe.js&action=raw&ctype=text/javascript");

User customization modifier

Some options may be customized by the user.

To do so, add to your common.js subpage the following code, editing what is needed:

window.WhatlinkshereDeluxe_getUserCustom = function(){

    // Preloading of the linked pages to the pages of a category
    WhatlinkshereDeluxe_PreloadOnCategoryPage = true;

}

Translation modifier

The gadget texts can be translated.

For that, it is needed to create a page named MediaWiki:Gadget-WhatlinkshereDeluxe.js/i18n/XX.js, whith XX the lang code of the needed language (example: MediaWiki:Gadget-WhatlinkshereDeluxe.js/i18n/en.js).

If you want to create a translation in a language that is not done yet, ask it to a sysop on page WP:DIMS providing the needed code in a sandbox.

If you want to edit an existing translation, ask it to a sysop on page WP:DIMS.


Existing translations
Talks