LastEdited

LastEdited adds details about the last edit to the current page. These details include the time (minutes/hours/days/months/years) ago the last edit was made, user who made the edit, edit summary given (if any), the current page size in bytes and a link to open a modal to review the changes. The modal includes a link to the actual diff page, a link to undo the edit and a link to rollback the edits if the user has the required rights.
The date and time are added by default and cannot be changed, while the other options can be configured.
== ==
== ==
Key 	 	Type 	Possible values 	Default
avatar 	Editor's user avatar 	boolean	truefalse 	true
avatarsize 	Size of the avatar 	integer	None specific 	15
size 	Current page size (in bytes) 	boolean	truefalse 	true
diff 	Appends the last diff link 	boolean	truefalse 	true
diffModal 	If the diff link should be loaded in LastEdited's diff modal. Useful in cases the user prefers opening diff links in QuickDiff.	boolean	truefalse 	true
comment 	Edit summary given* 	boolean	truefalse 	true
newpage 	Decides whether LastEdited will render on newly created pages without any edits (excluding the page creation edit) 	boolean	truefalse 	true
mainpage 	Decides whether LastEdited will render on the main page 	boolean	truefalse 	true
time 	Decides whether the time mentioned must be in the "time ago" format or a timestamp 	string 	timestamptimeago 	timeago
timezone 	Decides whether the timestamp shown is in local or UTC format* 	string 	UTClocale 	local
lang 	Changes the language displayed* 	string 	Any valid language code 	None specific
position.element 	Controls where the details will be added 	object 	Any valid element present on the page	None specific
position.method 	Controls whether the details need to be appended or prepended to the element defined in position.element 	string 	appendprepend 	None specific
namespaces.exclude	List of namespace IDs to exclude 	array 	None specific 	[]
pages 	List of pages to exclude 	array 	None specific 	[]
All configurations made to the script are to be stored in the lastEdited object. Here is an example, using Japanese language:
window.lastEdited = {
	avatar: true,
	avatarsize: 20,
	size: false,
	diff: true,
	comment: false,
	newpage: false,
	mainpage: true,
	time: 'timestamp',
	timezone: 'UTC',
	lang: 'ja',
	position: {
		element: document.getElementById('WikiaPageHeader'),
		method: 'append'
	},
	namespaces: {
		exclude: []
	},
	pages: []
};
=== Toolbar example ===
The following can be used to add the script to the toolbar instead of appending it to the title.
=== Notes ===
* If edit summary is not given with the edit, the whole part will be omitted, regardless of the value of comment.
* lang is meant for personal use only. Using it sitewidely is not encouraged.
* timezone is applicable only if time is set to timestamp.
* For any styling, the class of the outer div is lastEdited and that of the avatar icon is lastEdited-avatar.
* Make sure to follow the customization policy while selecting position.element. If not provided, the default positions are below the title on pages, and below the edit button on userpages.
** Please use the talkpage if you can't figure out how to get the details to show up at a particular place.
* The table below shows a full list of default namespaces that can be used with the script with their ids for exclusion:
== To do ==
* Handle errors if rollback fails
== Changelog ==
Date 	Description
November 1st, 2017 	Script rewritten to use jQuery functions instead of DOM API.
Added a diffModal configuration option.
No longer throwing errors on ?action=edit.
Extracted CSS to a separate stylesheet.
mw.config caching.
Extracted translation data to JSON to support the translations editor.
Finding a user's avatar is no longer requiring another HTTP request.
Script is showing a throbber before it finishes loading.
Diff modal is loading faster.
November 27th, 2016	Added a few requested features.
October 14th, 2016 	Script rewritten; added functionalities:
* Minor edits are now marked.
* Change in size is indicated.
* Position of the details can be configured.
* More responsive modal.
* Edits can be rollbacked from the modal.
July 9th, 2015 	Added Monobook support.
April 4th, 2015 	Date and time merged together to give an approximate time since the last edit using timeago.
April 3rd, 2015 	Added i18n support.
Redid namespace support; added options to include/exclude namespaces and exclude pages.
April 2nd, 2015 	Re-added previously removed editor's avatar.
December 30th, 2014	Added editor's avatar, per request.
December 1st, 2014 	Namespace support.
November 15th, 2014	Features updated.
October 8th, 2014 	Initial release.