User talk:Ilmari Karonen/ifdthumbnails.js
This is a user script to add thumbnails of the nominated images to Wikipedia:Files for deletion (formerly "images for deletion", hence the name) and Wikipedia:Possibly unfree files and their subpages.
Usage
[edit]To enable this script, add the following line to your monobook.js page (or the equivalent page for other skins):
importScript("User:Ilmari Karonen/ifdthumbnails.js");
Remember to clear your cache after saving. When you next visit FfD, it should look something like this:
![](http://upload.wikimedia.org/wikipedia/en/thumb/f/fe/Ifdthumbnails_screenshot.png/400px-Ifdthumbnails_screenshot.png)
If it doesn't, or if you get an error message, please let me know.
Usage on Commons
[edit]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:
importScriptURI("http://en.wikipedia.org/w/index.php?title=User:Ilmari_Karonen/ifdthumbnails.js&action=raw&ctype=text/javascript");
Alternatively, you can copy the "importScriptFromEnwiki()
" function from my monobook.js on Commons and use that.
Technical details
[edit]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 <a> tags surrounding the images are given the class name "ifd-thumbnail". The script also adds the rule "h4 { clear: right; }
" 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
[edit]- 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
[edit]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.