JavaScript gadget – show log ID tooltips on pages where log events are listed.
- By
[[Special:Redirect/logid/
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.
- phab:T125293 is tracking this issue since January 2016.
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.
Usage
editInclude the following line into your common.js, global.js etc.:
mw.loader.load( "https://en.wiki.x.io/w/index.php?title=User:PerfektesChaos/js/logidTooltip/r.js&action=raw&ctype=text/javascript" );
Behaviour
editOn 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 [[Special:Redirect/logid/0123456]] 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
editIndividual 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:
- Then you need the thumb URL at Commons of that file.
- Extract the two leading hexcodes, the slash and file name from URL:
e5/Toicon-icon-lines-and-angles-think.svg
- Pass that string to a
mw.hook( "logidTooltip-icon" )
request.
The JavaScript code looks as follows:
// send icon request first
mw.hook( "logidTooltip-icon" ).fire( "e5/Toicon-icon-lines-and-angles-think.svg" );
// finally, load gadget
mw.loader.load( "https://en.wiki.x.io/w/index.php?title=User:PerfektesChaos/js/logidTooltip/r.js&action=raw&ctype=text/javascript" );
Internationalization
editNot really required for gadget itself now.
Suggestions on foreign languages may be offered, as well as a translation of this page.
Codes
editSource code |
|
ResourceLoader |
|
Namespaces | Special |
Cookies | None |
mw.hook
|
|
MediaWiki | 1.30 |