This is the documentation page for the LastEditor.js user script.
LastEditor is a JavaScript user script that displays data about a page's last editor. The script provides links to the user's page, talk page, and contributions page, as well as displaying the time elapsed since the last edit, a link to the diff in question, an [m] marker in case of minor edits, and the edit summary of the last edit.
The script is inspired by Slyst'sLastEdited script in use on the Wikia network in terms of its design and general appearance, and borrows a pair of functions from PleaseStand'sUserInfo script to replicate the TimeAgo jQuery plugin.
Alternatively, the script accepts a window object of user-defined variables that can alter script performance at will. By default, the script will display all data and will be prepended to the header of all pages listed in namespaces 0, 4, 8, and 10 (mainspace, Project, MediaWiki, and template). The window variables enable users to remove the time elapsed text, the diff link, and the edit summary, as well as adjust namespaces to suit their specific needs and exclude certain pages. An example window object is shown below:
window.LastEditorOptions={namespaces:[0,4,8,12,14],// Custom namespace selectionexcluded:["Elfin_woods_warbler"],// Excluded page (must be encoded)showTime:false,// Indicates that the duration of time not be shown showDiff:false,// Hides diff linkshowSummary:false// Hides new line summary};
Variables
Type
Valid values
Default value(s)
Description
namespaces
Array
Any valid namespace
[0, 4, 8, 10]
An array of namespaces upon whose pages the script will be appended
excluded
Array
Any encoded page
[] (empty array)
An array of pages to be excluded (must be wgPageName of page)
showTime
Boolean
true, false
true
Displays the duration of time that has elapsed since the last edit
showDiff
Boolean
true, false
true
Provides a link to the last revision of the page and displays a marker for minor edits