ବ୍ୟବହାରକାରୀ:Ansumang/metadata
Tourette Syndrome A featured article from Wikipedia, the free encyclopedia
United States An A-class article from Wikipedia, the free encyclopedia. Also a good article.
Wikipedia A good article from Wikipedia, the free encyclopedia. A former featured article.
Jammu and Kashmir A B-class article from Wikipedia, the free encyclopedia
U.S. Route 191 A C-class article from Wikipedia, the free encyclopedia
Real analysis A start-class article from Wikipedia, the free encyclopedia
Binary function A stub-class from Wikipedia, the free encyclopedia
List of medical abbreviations: Overview A list-class article from Wikipedia, the free encyclopedia
Wiki (disambiguation) A disambiguation page from Wikipedia, the free encyclopedia
Tornadoes of 2009 A current-class article from Wikipedia, the free encyclopedia
Days of Wrath A future-class article from Wikipedia, the free encyclopedia
Mehlingen An unassessed article from Wikipedia, the free encyclopedia
|
The metadata script is a user script 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 colors the article header based on that information, using a color scheme based on the {{grading scheme}} colors.
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
[ସମ୍ପାଦନା]There are two versions of this script available. The gadget version can be installed through Special:Preferences on the gadgets tab. This version will always be functional, but the latest improvements and bug fixes will be delayed by a few hours or so.
Alternately, you can install the userspace version on your your user script (js) page using {{subst:js|User:ansumang/metadata.js}}
. This is the version I use for testing changes to the script; so, while it may temporarily break or act oddly when I make changes to it, the useful changes—such as bug fixes—show up sooner as well.
If you install the script multiple times, only the first installation will run. Since gadgets load before manually installed scripts, the gadget version will always override the non-gadget version.
Source code
[ସମ୍ପାଦନା]- The gadget version's source code is at MediaWiki:Gadget-metadata.js.
- The non-gadget version in my userspace is at User:ansumang/metadata.js.
- The stylesheet for both versions is at User:ansumang/metadata.css.
- This script originated with User:Outriggr's metadata.js script, which had the same basic function but is no longer maintained.
Bugs and feature requests
[ସମ୍ପାଦନା]If you find a bug, please report it at User talk:ansumang/metadata, making sure to include some information about what went wrong, what browser you're using, what page it occurred on, and things like that.
Known bugs
[ସମ୍ପାଦନା]- 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.
Customization
[ସମ୍ପାଦନା]Colors
[ସମ୍ପାଦନା]This script uses custom CSS classes from User:ansumang/metadata.css to assign colors to page headers. To change the colors used by this script, you must override these classes in your custom user stylesheet page (monobook.css, modern.css, etc). 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:
/* Remove colors entirely */
.firstHeading {color: black !important;}
/* Make the title of good articles bright red */
.assess-ga-text {color: #ff0000 !important;}
/* Display the title of disambiguation pages and set index articles in italics */
.assess-dab-text, .assess-setindex-text {font-style: italic;}
Assessment info
[ସମ୍ପାଦନା]The tagline where assessment info is displayed can be customized as well. There are three CSS classes used on that line:
assess-article-rating
contains the main assessment of the article, located at the beginning of the line. By default, anything in it is italicized.assess-info-all
contains all information on that line after the free encyclopedia. By default, it italicizes text.assess-info-review
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 !important
unless you are overriding the italics declared by the first two classes. Here are some examples:
/* Makes assessment info non-italicized, and hides information on peer reviews. */
.assess-article-rating {font-style: normal !important;}
.assess-info-all {font-style: normal !important;}
.assess-info-review {display: none;}
Optional components
[ସମ୍ପାଦନା]WikiProject | Assessment | Importance |
---|---|---|
WPSpace | FA | Top |
WikiProject Geology | FA | Top |
WP1.0 | FA | Top |
Vital | FA | High |
There are some optional scripts that can be installed to change the functionality of the main script in some way. These can be found here (all pages ending with .js
). To install these scripts, place {{subst:js|ବ୍ୟବହାରକାରୀ:Ansumang/metadata/SCRIPTNAME.js}}
in your JavaScript page, where SCRIPTNAME
is the name of the script.
If you have the main script installed on the same page, make sure all optional components are located after the main script.
Here are a couple of the most useful optional components:
- 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.
- assesslinks.js allows you to see the assessment of every article linked from a given page. To run the script, click the toolbox item titled "Assess links" in the sidebar. The script will then run, coloring each article link based on the color scheme used for article assessment. Unassessed articles are outlined in red, and redirect pages are colored magenta.
Other settings
[ସମ୍ପାଦନା]By default, the script will run when the page finishes loading. You can override this behavior, in which case the global assessment
object will be created but will not run:
assessment.autorun = false;
Interaction with other scripts
[ସମ୍ପାଦନା]- For more details on this script's object model, see /objects.
This script adds a single object, assessment
, to the global scope. This object contains all of the script's functions and data. It is available on all pages, but only runs automatically in the main namespace. The script's behavior can be customized by redefining methods of the assessment
object.
Additionally, you can add functions to be run at various points during the script's execution using assessment.addHook(hookName, function)
. There are several hooks available within the script; search the code for this.callHooks
to find where they are run.
The point that is most useful is "onCompletedRequest"
, which runs after the AJAX request has completed and the header has been updated. See /projectbanners.js for an example of how it is used.