User talk:Ilmari Karonen/ifdthumbnails.js

This is a user script to add thumbnails of the nominated images to Files for deletion (formerly "images for deletion", hence the name) and Possibly unfree files and their subpages.

Usage
To enable this script, add the following line to your monobook.js page (or the equivalent page for other skins):

Remember to clear your cache after saving. When you next visit FfD, it should look something like this:



If it doesn't, or if you get an error message, please let me know.

Usage on Commons
This script also works on the Deletion requests page on the Wikimedia Commons, although such usage is still somewhat experimental. To use this script on Commons, you need to specify the full URI of the script:

Alternatively, you can copy the " " function from my monobook.js on Commons and use that.

Technical details
This script collects a list of nominated images by looking at the headings on the page, and then uses Pathoschild's AJAX framework to make a MediaWiki API query to obtain the thumbnail URLs and sizes. Then it's just a simple matter of adding the image elements below the headings.

The thumbnails are styled and floated using a small fragment of CSS included at the beginning of the script. For that purpose, the &lt;a&gt; tags surrounding the images are given the class name "ifd-thumbnail". The script also adds the rule " " to keep the floated images from extending past the next heading. You're welcome to modify or override the styles in your monobook.css — just remember to make your style rules more specific or use the "!important" keyword.

This script has been tested and confirmed to work on:
 * Mozilla Firefox 2.0.0.17 and 3.0.3
 * Konqueror 3.5.9
 * Opera 9.27
 * Internet Explorer 7.0.5730.11

Known issues

 * The API queries will not be properly cached until bug 14402 is fixed. This wastes some bandwidth and may slow down the appearance of the thumbnails on high-latency connections.

=Discussion= You're welcome to leave any comments, suggestions or bug reports below. Note that I may not always look at this page very often, so if the issue is important or urgent (e.g. if the script stops working), please notify me on my talk page or by e-mail.