User:PerfektesChaos/js/externalLinkProblem

JavaScript gadget – display and manage problematic external links in page view or preview.

Problematic external links may be:
 * URL which could not be responded for several weeks or months now. This might have been detected automatically by some bots or tools, but also manually.
 * URL which are inappropriate, e.g. occurring on spam blacklist. If an URL got banned there, this won’t affect any page, nor does it hinder editing and saving this page including undesired URL, as long the list of external links did not change by the edit.
 * URL which should be rewritten as wikilinks to enable whatlinkshere or global usage.

Functionality
On any subject page in selected namespaces the existence of problematic external links is indicated to the user.
 * A box is displayed in page head region.
 * External links in question are listed to the users.
 * Hints on causes, remedies or other additional information may be given for each link.
 * On displayed HTML, the problematic links might be marked and equipped with helpful functionality.

Proliferation
Currently the background infrastructure is available on German Wikipedia only.

The gadget is developed to be used on any wiki, especially being supported by a wmflabs.org database tool.

Usage
Insert these lines into personal common.js:

User configuration
The initial environment and the behaviour can be equipped by each user individually.

Quick interactive costumization
Options can be set interactively on as soon as the script has been loaded. On pages where the box appears, a button is offered in the top right corner, which opens Special:Gadgets in a new browser tab or window.

When reloading a page the preferences declared here come into effect. This dynamic assignment overrides the static setting by application object.

Anonymous users can use this mode, too; options will be stored in browser profile rather than on wiki server.

Configuration by JavaScript
Insert the following lines into common.js etc. (best before mw.loader.load):

Origin of information
There are two ways how the list of undesired URL could be retrieved:
 * 1) From a template transclusion on the adjacent talk page.
 * 2) From a tool searching a database on wmflabs.org (not yet existing).

Sub-modules
The code is divided into several modules. Only the head module is to be loaded by user into selected pages. The head module will decide on appropriate further steps and load required sub-modules, scripts, resources when really needed. This keeps the head module as slim and fast as possible if nothing to do.

The following table shows which scripts are loaded under which conditions:

Other languages
This gadget is prepared for multilingual support.
 * If you like a version in your own language, please forward translations to me:
 * This documentation page.
 * The  mapping on top of source code in gui and others.
 * Further ISO 639 language codes your translation might support.


 * German Translation

Codes
de:User:PerfektesChaos/js/externalLinkProblem