User:Anomie/unattributed-image-finder
This script adds the class unattributed-image
to images that appear to be using the link=
parameter but do not have categories indicating that they may be used without attribution.
You can then add CSS rules to apply various visible changes to the image. The default rule is available in User:Anomie/unattributed-image-finder.css.
Usage
[edit]To use the script, add the following to your skin-specific Javascript file.
importScript('User:Anomie/unattributed-image-finder.js'); // Linkback: [[User:Anomie/unattributed-image-finder.js]]
importStylesheet('User:Anomie/unattributed-image-finder.css'); // Linkback: [[User:Anomie/unattributed-image-finder.css]]
Note that this script has only been extensively tested on Monobook.
If you want it to be run on demand (i.e. by clicking a button next to "unwatch"), include it something like this:
UnattributedImageFinderOnDemand=true;
importScript('User:Anomie/unattributed-image-finder.js'); // Linkback: [[User:Anomie/unattributed-image-finder.js]]
importStylesheet('User:Anomie/unattributed-image-finder.css'); // Linkback: [[User:Anomie/unattributed-image-finder.css]]
addOnloadHook(function(){
addPortletLink('p-cactions', 'javascript:UnattributedImageFinder.onDemand()', 'unattributed-image-finder');
});
In either case, the line for unattributed-image-finder.css may be omitted, if you would rather add custom CSS rules to your skin-specific CSS file.
Please note that the line for unattributed-image-finder.css does not go in your skin.css, it goes in your skin.js along with the other lines. Alternatively, you can copy the contents of User:Anomie/unattributed-image-finder.css into your skin.css and customize the rules however you would like.
Caveats
[edit]To determine if an image is allowed to be used unattributed, the script checks the categories on the image page (here or at Commons, depending on the source of the image). This list of categories is not complete, so there may be false positives.
Testing
[edit]With the default rules, this old revision of Template:Unreferenced should show the main image in the template is problematic.