User:Terasail/ArticleInfo

This userscript displays page information at the top of the page, directly below the title. It has been based on the "XTools" gadget in preferences.

This script is designed to work on all wikis so that you can always track the page information on any wiki. However this will only work with the Vector 2022 or Vector legacy skins.

Local (English wiki)
To use this script on english wiki, add the following to your common.js page: importScript('User:Terasail/ArticleInfo.js'); // User:Terasail/ArticleInfo

Global (All wikis)
To use this script on all wikis (Commons, Meta, Mediawiki...), add the following to your global.js page: mw.loader.load("https://en.wikipedia.org/w/index.php?action=raw&title=User:Terasail/ArticleInfo.js&ctype=text/javascript"); // en:User:Terasail/ArticleInfo

Page information
The script will display a line of information below the title and above the Article/Talk/Read/Edit... toolbar. Which includes the following:
 * 1) The page wikiproject class, if it has one.
 * 2) The page protections in use.
 * 3) The number of revisions.
 * 4) The number of editors.
 * 5) The number of pageviews in the last 30 days.
 * 6) The number of page watchers (If more than 30).
 * 7) The page creation date in the form: DMY.
 * 8) The user who created the page.
 * 9) The username of the user who created the page.
 * 10) The number of edits the user has made.
 * 11) The user will also have the total number of user groups they are in.

A link to the xTools page information breakdown will be added to the actions section in the sidebar.

Example
The following is a recreation of how the information was shown at Hogwarts Legacy on 29 December 2023: Hogwarts Legacy Article Talk   1,524 Revisions  435 Editors  134,921 Pageviews  123 Watchers </li><li style="display:inline-block;"> Created 16 Sep 2020, by Salvidrim! (28,555 edits | 5 groups) </li></ul>

Classes
The page class will be displayed as a class icon if it has been given a wikiproject class. This will only work on en wiki, if a wikiproject banner is found but a class has not been given a questionmark icon will be displayed.

Page protection
Page protection will be displayed by showing the appropriate padlock icon. These would be Semi / Extended  / Template  / Full.

If the page is move protected, will be shown (Green padlock) and will not relate to the specific move protection (Semi/Extended...). This is also the same for upload protected pages, except with (Purple padlock). If a page is cascade protected then (Turquoise padlock) will also be shown. This means a maximum of 4 protection icons can be shown at the same time.


 * Pending changes can't be detected and therefore will not be shown.
 * Creation protected pages will not be marked since the page does not exist.

Revisions
The revision counter will only be able to count up to 30,000 revisions and after that point it will just display "30,000+" since there are limited pages with that many revisions and it would just increase the loading time of the information bar.

Page creator information
The user who created the page will have their username displayed along with their edit count. Their username can be clicked to take you to their userpage. The number of user groups they are in will be shown (If they have any).

User links
Within the toolbar, a new section "User Information" will be created above the "General/Tools" section. This will move the existing links User conributions, User logs and View user groups links into this section as well as adding two more links, Global account and Open xTools. These links will be specific to the userpage that you have open. In addition, the edit count and list of user groups will be shown at the top of the page, inline with the title.

User example
The following is a recreation of how the information was shown at User:Terasail on 29 December 2023: <div style="line-height:1.3;color:#000;font-size:1.8rem;font-family: 'Linux Libertine','Georgia','Times',serif;box-shadow: 0 1px #a2a9b1;">User:Terasail<span style="white-space: nowrap;border-left:1px solid #a2a9b1;color:#54595d;margin-left:5px;padding-left:5px;font-size:0.875rem;font-family:sans-serif;">Edits: 22,333 <span style="white-space: nowrap;border-left:1px solid #a2a9b1;color:#54595d;margin-left:5px;padding-left:5px;font-size:0.875rem;font-family:sans-serif;">Groups: EC, PM, FM, MMS, PCR, R, TE <span style="display:inline-flex;margin-right:16px;color:#202122;border-bottom:1px solid #000;padding:13px 0 5px 0;">User page Talk <ul style="margin:0;"><li style="display:inline-block;margin-right:0.25rem;padding-right:0.25rem;border-right:1px solid #c8ccd1"> 56 Revisions </li><li style="display:inline-block;margin-right:0.25rem;padding-right:0.25rem;border-right:1px solid #c8ccd1"> 3 Editors </li><li style="display:inline-block;margin-right:0.25rem;padding-right:0.25rem;border-right:1px solid #c8ccd1"> 441 <abbr title="Pageviews in the last 30 days">Pageviews </li><li style="display:inline-block;"> Created 25 Jun 2020, by Terasail (22,333 edits | 7 groups) </li></ul>

User groups list
If the user also has additional user groups they will be displayed in shortform:


 * confirmed: "C"
 * extendedconfirmed: "EC",
 * reviewer: "PCR",
 * rollbacker: "R",
 * autopatrolled: "AP",
 * autoreviewer: "AP",
 * patroller: "P",
 * filemover: "FM",
 * extendedmover: "PM",
 * accountcreator: "AC",
 * eventcoordinator: "EvCo",
 * templateeditor: "TE",
 * ipblock-exempt: "IPE",
 * abusefilter: "EFM",
 * abusefilter-helper: "EFH",
 * massmessage-sender: "MMS",
 * sysop: "A",
 * bureaucrat: "B",
 * steward: "S",
 * interface-admin: "IA",
 * suppress: "O",
 * checkuser: "CU",
 * bot: "BOT",
 * translationadmin: "TA",
 * import: "IM",
 * propertycreator: "PROP",
 * gwtoolset: "GWT",
 * transwiki: "TW",
 * uploader: "U",
 * centralnoticeadmin: "CNA",
 * oauthadmin: "OAA",
 * global-renamer: "GR",
 * flood: "Fl",
 * functioneer: "F",
 * functionmaintainer: "M",
 * wikifunctions-staff: "WFS",
 * image-reviewer: "IR",
 * upwizcampeditors: "UWC",
 * machinevision-tester: "MVT"

Questions / Issues
Please leave any questions or issues on my talk page, Thanks.