User talk:Ilmari Karonen/ifdthumbnails.js
This is a
Usage
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
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:
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
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
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.cssThis script has been tested and confirmed to work on:
- Mozilla Firefox2.0.0.17 and 3.0.3
- Konqueror 3.5.9
- Opera9.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.