User:PerfektesChaos/js/logidTooltip

JavaScript gadget – show log ID tooltips on pages where log events are listed. If MediaWiki software will show the ID numbers one day there is still an added value by offering wikitext which can be grabbed by C&P.
 * By 0123456  it is possible to link one particular log action, like blocking, moving etc.
 * Problem: Pages where related action is listed do not show the ID.
 * T125293 is tracking this issue since January 2016.

Usage
Include the following line into your common.js, global.js etc.:

Behaviour
On certain pages every logbook action will be equipped in the end with an arrow:.

The pages in question are:
 * Special:log with all “subpages”
 * recent changes
 * current watch list
 * any deleted page which will show the related deletion logbook

Within such pages:
 * If mouse pointer is hovering over that arrow a browser tooltip will show the logID number.
 * When clicking on that arrow a small popup will show up.
 * The popup shows wikitext like &#91;&#91;Special:Redirect/logid/0123456&#93;&#93; which can be copied.
 * That text is also linked. The page with only that entry can be opened directly, or URL might be copied by browser context menu.
 * A second click on that arrow will close the popup again.
 * First click might take one second or another, depending on libraries which have been loaded already in page. The large OOui system will be requested, and if not yet present some delay maight occur once.

Configuration
Individual desire may be passed to the gadget before loading.

Currently it is possible to exchange the icon:
 * You might want to display a light bulb instead: Toicon-icon-lines-and-angles-think.svg
 * Then you need the thumb URL at Commons of that file.
 * Extract the two leading hexcodes, the slash and file name from URL:
 * Pass that string to a  request.

The JavaScript code looks as follows:

Internationalization
Not really required for gadget itself now.

Suggestions on foreign languages may be offered, as well as a translation of this page.

Codes
de:User:PerfektesChaos/js/logidTooltip