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
[edit]For a page containing only {{fact}}, as of 2011-01-29:
- Before
Templates used in this preview:
- Template:Basepage subpage ( ) (protected)
- Template:Cat handler ( ) (protected)
- Template:Citation needed ( ) (protected)
- Template:Fact ( ) (protected)
- Template:Fix ( ) (protected)
- After
Templates used in this preview:
- 2010-10-19 11:26 (hist) Template:Citation needed ( ) (protected) Fram: Undo all cat removal. Why? These are useful...
- 2010-10-19 11:24 (hist) Template:Fix ( ) (protected) Fram: Undid revision 390626762 by [[Special:Contributions/Rich Farmbrough|Rich Farmbrough]] ([[User talk:Rich Farmbrough|talk]]) Why? These are useful...
- 2010-10-03 19:24 (hist) Template:Basepage subpage ( ) (protected) WOSlinker: remove {{pp-template}}
- 2010-10-01 12:09 (hist) Template:Cat handler ( ) (protected) WOSlinker: remove {{pp-template}}
- 2010-09-01 19:32 (hist) Template:Fact ( ) (protected) Amatulic: +R from move
Usage
[edit]To use the script, add the following to your skin-specific Javascript file.
importScript('User:Anomie/previewtemplatelastmod.js'); // Linkback: [[User:Anomie/previewtemplatelastmod.js]]
Note that this script has only been extensively tested on Monobook, although it does appear to work correctly in Vector too.
Styling
[edit]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:
span.PreviewTemplateLastMod_comment {
color:#888;
}
span.PreviewTemplateLastMod_no_comment {
color:#ccc;
}