User:Anomie/previewtemplatelastmod

This script provides more information in the "Pages transcluded onto the current version of this page" or "Templates used in this preview" box at the bottom of the preview screen. It also sorts the templates by last edit date. This can help in finding template vandalism, as the templates at the top of the list are most likely to have been vandalized.

Example
For a page containing only fact, as of 2011-01-29:

Templates used in this preview:
 * Before:
 * Template:Basepage subpage (protected)
 * Template:Cat handler (protected)
 * Template:Citation needed (protected)
 * Template:Fact (protected)
 * Template:Fix (protected)

Templates used in this preview:
 * After:
 * 2010-10-19 11:26 Template:Citation needed  (protected) Fram: Undo all cat removal. Why? These are useful...
 * 2010-10-19 11:24 Template:Fix  (protected) Fram: Undid revision 390626762 by Rich Farmbrough (talk) Why? These are useful...
 * 2010-10-03 19:24 Template:Basepage subpage  (protected) WOSlinker: remove
 * 2010-10-01 12:09 Template:Cat handler  (protected) WOSlinker: remove
 * 2010-09-01 19:32 Template:Fact  (protected) Amatulic: +R from move

Usage
To use the script, add the following to your skin-specific Javascript file. Note that this script has only been extensively tested on Monobook, although it does appear to work correctly in Vector too.

Styling
The following CSS classes may be used for styling the generated content:
 * PreviewTemplateLastMod_timestamp : The timestamp at the start of the line.
 * PreviewTemplateLastMod_history : The "hist" link.
 * PreviewTemplateLastMod_user : The "user" link.
 * PreviewTemplateLastMod_comment : The edit summary.
 * PreviewTemplateLastMod_no_comment : The text "(no summary)" displayed when the user did not give a summary.

For example, to display the comment in grey you could add the following to your skin-specific CSS file: