Wikipedia:Metadata gadget

The metadata script is a gadget that displays the quality assessment of every article page you visit. This allows you to get a general idea of an article's quality without going to the talk page or reading the entire article yourself.

The information is displayed in the tagline directly below the article header. It also colours the article header based on that information, using a colour scheme based on the grading scheme colours.

This script finds the assessment information entirely from the intro section of the article's talk page. In addition to displaying the article's rating, it also notes current and past featured/good article status, nominations, and reviews, along with any current peer reviews.

Installation
You can enable this script through Special:Preferences on the Gadgets tab, in the Appearance section. Turn on the checkbox labelled "Display an assessment of an article's quality as part of the page header for each article".

In the past, you could install the script by adding the text  to your personal script page. However, this practice can make the script load unreliably, and versions of the script in the user namespace are likely to be out of date! If you must load the script manually, do so by wrapping code dependent on the gadget in a  call, as so:

Source code

 * The source code is at MediaWiki:Gadget-metadata.js.
 * The stylesheet is at MediaWiki:Gadget-metadata.css.

History

 * This script originated with User:Outriggr's metadata.js script, which had the same basic function but is no longer maintained.
 * It was previously maintained by User:Pyrospirit, who maintained it until becoming inactive in 2012 ( last version based on Pyrospirit's code )
 * In 2015, User:Nihiltres overhauled the script and took over as maintainer.

Bugs and feature requests
If you find a bug, please report it at MediaWiki talk:Gadget-metadata.js, making sure to include some information about what went wrong, what browser you're using, what page it occurred on, and so forth. It's helpful to ping the current maintainer (e.g., ) as part of the report.

Requests for a feature to be added to the script should also be made at the same talk page. Improvements can be made to its current function of displaying an article's assessment in the page header, but there are no plans to add whole new features—these can be created as user-scripts or separate gadgets.

Known bugs

 * The  parameter value in the WikiProject template for WikiProject Military history might not match the output; the script reflects the   value and not the template-rendered result. Please fix that value to match the output if you notice a discrepancy.
 * When an article is currently undergoing a Good Article reassessment and has had certain combinations of past reassessments, the script will create a link to the wrong page. (For example, if an article has a second individual reassessment with no community reassessments, the link will point to the first one rather than the second.) This should only occur on a small minority of pages. (This issue needs reconfirmation since Nihiltres' overhaul.)

Colours
This script uses custom CSS classes from MediaWiki:Gadget-metadata.css to assign colours to page headers. To change the colours used by this script, you must override these classes in your custom user stylesheet page. For help with custom CSS, see Help:Cascading Style Sheets.

Any style aspect of the article header can be customized for a specific assessment. Here are some examples of what you can add to your user stylesheet page to do this:

Assessment info
The tagline where assessment info is displayed can be customized as well. There are three CSS classes used on that line:
 * contains the main assessment of the article, located at the beginning of the line. By default, anything in it is italicized.
 * contains all information on that line after the free encyclopedia. By default, it italicizes text.
 * contains any information on a peer review of the article. It does nothing by default, and it is empty if the article is not being peer reviewed.

You can customize these using your user stylesheet page (monobook.css). You do not need to use  unless you are overriding the italics declared by the first two classes. Here are some examples:

Optional components
There are some optional add-on scripts that can be installed to change or add to the functionality of the main script in some way.

Here are a couple of the most useful optional components:
 * User:Pyrospirit/metadata/projectbanners.js adds a [ show ] link to the right of the assessment line on each article page. Clicking this link displays a table that lists each WikiProject template on the article's talk page, along with that project's assessment and importance ratings, if any. (Example shown at right.) This provides substantially more information than the unmodified script. This add-on hasn't yet been updated to work with the current version of the script.
 * User:Nihiltres/assesslinks.js (an updated version of User:Pyrospirit/metadata/assesslinks.js) allows you to see the assessment of every article linked from a given page. To activate the script, click the toolbox item titled "Assess links" in the sidebar. The script will then run, colouring each article link based on the colour scheme used for article assessment. Unassessed articles are outlined in red, and redirect pages are coloured magenta. It makes a large number of AJAX requests to retrieve so many assessments at once. You can install it by adding to your scripts page.
 * User:Evad37/Metadata-timeless – allows you to use the Metadata gadget with the Timeless skin.

Interaction with other scripts
This script adds a single object,, to the global scope. This object contains all the script's functions and data. The script is available on all pages, but only runs automatically in the main namespace. The script's behaviour can be customized by redefining methods of the  object and re-running the script with.